Skip to content
Snippets Groups Projects

tests: Add a test for side effects of ternary operator.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:ternary_test into master
1 file
+ 15
0
Compare changes
  • Side-by-side
  • Inline
@@ -31,3 +31,18 @@ float4 main() : sv_target
uniform 0 float4 1.1 3.0 4.0 5.0
draw quad
probe all rgba (1.1, 2.0, 0.0, 0.0)
[pixel shader]
float4 f;
float4 main() : sv_target
{
float f1 = 0.1, f2 = 0.2, f3;
f3 = f.x ? (f1 = 0.5) + 0.2 : (f2 = 0.6);
return float4(f1, f2, f3, 0.0);
}
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (0.5, 0.6, 0.7, 0.0)
Loading