mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/hlsl: Flatten conditional blocks containing discard_nz instructions.
For any `discard_nz c` instruction in a conditional block, we replace c with
(cond && c) in a then block,
and
(!cond && c) in an else block.
This commit is contained in:
Notes:
Henri Verbeet
2025-10-30 19:59:51 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1732
@@ -16,7 +16,7 @@ uniform 0 float4 9 8 7 6
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader todo(sm<4)]
|
||||
uniform float4 x;
|
||||
|
||||
float4 main() : sv_target
|
||||
@@ -29,10 +29,10 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1 2 3 4
|
||||
todo(sm<6 | msl) draw quad
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
uniform 0 float4 9 8 7 6
|
||||
todo(sm<6 | msl) draw quad
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
|
||||
[pixel shader todo(sm<4)]
|
||||
@@ -56,7 +56,7 @@ uniform 0 float4 9 8 7 6
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader todo(sm<4)]
|
||||
uniform float4 x;
|
||||
|
||||
float4 main() : sv_target
|
||||
@@ -72,10 +72,10 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1 2 3 4
|
||||
todo(sm<6 | msl) draw quad
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
uniform 0 float4 9 8 7 6
|
||||
todo(sm<6 | msl) draw quad
|
||||
todo(sm<4 | glsl | msl & sm>=6) draw quad
|
||||
probe (0, 0) f32(1, 2, 3, 4)
|
||||
|
||||
[require]
|
||||
|
||||
Reference in New Issue
Block a user