I'd like to hear from others as well, but that syntax doesn't seem ideal. Using "," for "and" in particular seems prone to confusion. Some possible alternatives:
- "todo(sm<4,sm>=6)" and "todo(sm<4+sm>=6)"
- "todo(sm<4 | sm>=6)" and "todo(sm<4 & sm>=6)"
- "todo(sm<4 ∪ sm>=6)" and "todo(sm<4 ∩ sm>=6)"
I am for the "todo(sm<4 & sm>=6)" syntax and using multiple "todo()" for ORs, since allowing to mix "&" and "|" inside the same qualifier may make the precedence between the operators confusing.
I think we can just stick to the C rules. I.e., '&' having higher precedence than '|'. We could also support parentheses, if it comes to that. For the moment though, I don't think we need anything more complex than "sm<4 | sm>=6", and we could conceivably just hardcode that for this MR, and then work on extending the capabilities of the parser in a separate MR. Note also that even in the presumably rare cases where we might want to use something like "todo(sm<4&(vk | gl))", we could just rewrite that as "todo(sm<4&vk | sm<4&gl)", which arguably even makes it clearer.
0x88760b59 is D3DXERR_INVALIDDATA.
Ok, I suppose that we still have to handle it as E_FAIL though. I made the mapping trace message more specific, and also renamed `map_unidentified_hrs()` to `map_special_hrs()`, since we *indentified* this one.
I think that's fine for the moment. In the longer term though, I wonder if we shouldn't simply use FAILED() for "fail", and potentially invent something new if we ever end up caring about the exact return value.
+static void read_string_args(const char *line, const char **const rest, + enum shader_model *sm_min, enum shader_model *sm_max) +{ ... + if (*line == '&' || *line == ' ') + { + ++line; + }
Does that mean we can do something like "todo(sm>=4&&&&&&&&&&&&&&&&sm<6)"?
+#if defined(VKD3D_CROSSTEST) + trace("Compiling SM4 shaders with d3dcompiler_47.dll and executing with d3d11.dll\n"); +#elif defined(_WIN32) + trace("Compiling SM4 shaders with vkd3d-shader and executing with d3d11.dll\n"); +#endif
The "#elif defined(_WIN32)" can just be "#else"; the code wouldn't get executed otherwise. Also, if we add something like this in shader_runner.h
```c #ifdef VKD3D_CROSSTEST # define HLSL_COMPILER "d3dcompiler_47.dll" #else # define HLSL_COMPILER "vkd3d-shader" #endif ```
we can do the following:
```c trace("Compiling SM4 shaders with %s and executing with d3d11.dll\n", HLSL_COMPILER); ```
here and in e.g. shader_runner_d3d9.c.
+#if defined(VKD3D_CROSSTEST) + trace("Compiling SM4 shaders with d3dcompiler_47.dll and executing with d3d12.dll\n"); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, SHADER_MODEL_4_0, SHADER_MODEL_5_1); +#else + trace("Compiling SM4 shaders with vkd3d-shader and executing with vkd3d\n"); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, SHADER_MODEL_4_0, SHADER_MODEL_5_1); +#endif
Note that the run_shader_tests() calls are the same in both cases, so these don't need to be inside #if/#else/#endif.