~~This goes atop !773. The last three commits belong to this MR.~~
Trampolines and launchers allow us to handle code doing multilevel jumps, but they partially virtualize the control flow, which potentially makes the jobs of downstream compilers harder. So we avoid them every time we can.
--
v2: vkd3d-shader/ir: Only emit launchers when needed.
vkd3d-shader/ir: Only emit trampolines when needed.
vkd3d-shader/ir: Swap selection branches if the if branch is empty.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/785
These tests cover code paths untested in DXIL, except for the last commit which is to catch any signed int resource issues.
--
v3: tests/hlsl: Add tests for texture UAV signed atomics.
tests/hlsl: Add tests for texture UAV atomics.
tests/hlsl: Add a test for UAV InterlockedExchange().
tests/hlsl: Add a test for a structured UAV scalar store.
tests/hlsl: Add tests for min() and integer max().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/684
This should be the last piece of the puzzle for SNK games.
Basically, support for "if" conditionals for shader model 3.0 and 4.0.
This is achieved through the use of the `if_comp` instruction (VKD3DSIH_IFC), but these are not handled by the cf_flattener.
So I wrote `vsir_program_lower_ifc()` as a normalization pass to turn them into VKD3DSIH_IF in 3/4.
This requires translating the condition of IFC into a separate vsir comparison instruction. I think I got the mapping right in `get_handler_idx_from_rel_op()` but it would be good if someone with more experience in SPIR-V takes a close look.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/794