mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Remove conditional branching when condition is a compile time constant.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
f3389789b2
commit
7c378cc6f9
Notes:
Alexandre Julliard
2023-10-05 22:37:46 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/375
@@ -82,3 +82,20 @@ float4 main(uniform float4 u) : sv_target
|
||||
uniform 0 float4 0.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
probe all rgba (0.9, 0.8, 0.7, 0.6)
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
bool c = false;
|
||||
float a = -1.0f;
|
||||
if (c)
|
||||
return float4(1.0, 2.0, 3.0, 4.0);
|
||||
else if (a > 0)
|
||||
return float4(5.0, 6.0, 7.0, 8.0);
|
||||
else
|
||||
return float4(9.0, 10.0, 11.0, 12.0);
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (9.0, 10.0, 11.0, 12.0)
|
||||
|
Reference in New Issue
Block a user