vkd3d-shader/hlsl: Ensure that TERNARY condition is always bool.

Also, properly casting it to float in lower_ternary() for SM1
avoids creating ABS and NEG on bool types.
This commit is contained in:
Francisco Casas
2024-03-01 16:01:03 -03:00
committed by Alexandre Julliard
parent 9c0d04c862
commit 19fd43214b
Notes: Alexandre Julliard 2024-04-09 15:44:37 -05: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/744
11 changed files with 114 additions and 122 deletions

View File

@@ -1,4 +1,4 @@
[pixel shader todo(sm<4)]
[pixel shader]
uniform float4 u;
float4 main() : sv_target
@@ -8,20 +8,20 @@ float4 main() : sv_target
[test]
uniform 0 float4 -0.1 10.0 0.0 0.0
todo(sm<4 | glsl) draw quad
todo(glsl) draw quad
probe all rgba (1.0, 0.0, 0.0, 1.0)
[test]
uniform 0 float4 1.2 -0.1 0.0 0.0
todo(sm<4 | glsl) draw quad
todo(glsl) draw quad
probe all rgba (1.0, 1.2, 0.0, 1.0)
[test]
uniform 0 float4 1.2 2.0 3.0 0.0
todo(sm<4 | glsl) draw quad
todo(glsl) draw quad
probe all rgba (1.0, 1.2, 8.0, 1.0)
[pixel shader todo(sm<4)]
[pixel shader]
uniform float4 u;
float4 main() : sv_target
@@ -31,7 +31,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.2 2.0 3.0 0.0
todo(sm<4 | glsl) draw quad
todo(glsl) draw quad
probe all rgba (2.0, 2.4, 16.0, 2.0)
[pixel shader fail]