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.
I added support for '&' and '|' with the first having more precedence. The code is more complicated than just allowing multiple todo()s though.
Does that mean we can do something like "todo(sm>=4&&&&&&&&&&&&&&&&sm<6)"?
Huh, yes, if for some reason we want to. I just realized the new version also allows for that, I will send another update.
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
#ifdef VKD3D_CROSSTEST # define HLSL_COMPILER "d3dcompiler_47.dll" #else # define HLSL_COMPILER "vkd3d-shader" #endif
we can do the following:
trace("Compiling SM4 shaders with %s and executing with d3d11.dll\n", HLSL_COMPILER);
here and in e.g. shader_runner_d3d9.c.
The trace in the `#elif` also worked, but yep, an `#else` would have been enough. I applied the rest of your suggestion so it is no longer relevant.