Hull Shaders contain two functions instead of just one, so all the algorithms that require computing a CFG need to be run twice. Here we refactor the code so that this can be done more easily.
This MR is relatively long, but it is essentially just moving code around, so hopefully it is not too difficult to review anyway.
--
v4: vkd3d-shader/ir: Split handling jumps when emitting a structured program.
vkd3d-shader/ir: Split handling selections when emitting a structured program.
vkd3d-shader/ir: Split handling loops when emitting a structured program.
vkd3d-shader/ir: Split handling blocks when emitting a structured program.
vkd3d-shader/ir: Refactor declaration emission outside of the CFG structure.
vkd3d-shader/ir: Split undominated SSA materialization.
vkd3d-shader/ir: Split program structurization.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/778
~~This goes atop !764. The last three commits belong to this MR.~~
Since we want to get rid of loops and 'break's as much as possible, we try to move 'break's out of selection constructs as much as possible so it's easier to match them with loops. This MR introduces a few other tricks to help that.
--
v4: vkd3d-shader/ir: Move breaks out of selections again after having optimized loops.
vkd3d-shader/ir: Append code to the non-breaking branch if there is breaking one.
vkd3d-shader/ir: Prepare for changing the destination list in vsir_cfg_optimize_recurse().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/773
I'm working on adding all the intrinsics we haven't implemented yet. Here's sinh, cosh, and tanh.
Sinh/cosh are implemented in the same commit because they forward to the same backing function (because the identities used only differ by a plus or minus).
--
v6: vkd3d-shader/hlsl: Implement tanh.
vkd3d-shader/hlsl: Implement hyperbolic sin and cos.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/740
Some tests require Vulkan extension VK_KHR_surface, which is not exposed by Mesa unless at least a platform is configured.
Hopefully this should at last make llvmpipe 24 not crash in d3d12.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/783
Includes !782 to prevent the 32-bit Windows CI crashing.
--
v10: vkd3d-shader/dxil: Support SV_Depth, SV_DepthGreaterEqual and SV_DepthLessEqual.
tests/hlsl: Add tests for SV_DepthLessEqual and SV_DepthGreaterEqual.
tests/hlsl: Add tests for SV_Depth.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/777
Creates test for the following things:
- Whether a combination of BackBufferCount + SwapEffect results in another buffer being added that acts as a front buffer. We used to have bugs caused by this in DXVK ages ago.
- GetFrontBufferData actually copying data from the front buffer to the target surface and not from one of the back buffers. This is motivated by a DXVK bug with a modded version of Silent Hill 2 we had recently.
- GetFrontBufferData produces a specific fixed alpha value depending on whether the swapchain is windowed or fullscreen. That's a TODO for now because neither Wine nor DXVK implements this and it's a bit annoying to implement this while not a single application is known to rely on this.
- GetFrontBufferData is supposed to capture a screenshot of the entire monitor. So this MR adds a test to make sure that the application window is positioned correctly in the target surface after calling GetFrontBufferData. Total War Medieval 2 actually hit this issue with DXVK on its loading screen in windowed mode.
All the new tests pass on Windows 11 on the Nvidia D3D9 driver.
--
v2: d3d9: Add test for GetFrontBufferData window placement.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5500
Creates test for the following things:
- Whether a combination of BackBufferCount + SwapEffect results in another buffer being added that acts as a front buffer. We used to have bugs caused by this in DXVK ages ago.
- GetFrontBufferData actually copying data from the front buffer to the target surface and not from one of the back buffers. This is motivated by a DXVK bug with a modded version of Silent Hill 2 we had recently.
- GetFrontBufferData produces a specific fixed alpha value depending on whether the swapchain is windowed or fullscreen. That's a TODO for now because neither Wine nor DXVK implements this and it's a bit annoying to implement this while not a single application is known to rely on this.
- GetFrontBufferData is supposed to capture a screenshot of the entire monitor. So this MR adds a test to make sure that the application window is positioned correctly in the target surface after calling GetFrontBufferData. Total War Medieval 2 actually hit this issue with DXVK on its loading screen in windowed mode.
All the new tests pass on Windows 11 on the Nvidia D3D9 driver.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5500