Module: vkd3d Branch: master Commit: c43c900a300b0c3acf619bceeecac68b72414b9e URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/c43c900a300b0c3acf619bceeecac6...
Author: Francisco Casas fcasas@codeweavers.com Date: Tue Apr 23 16:35:50 2024 -0400
tests: Test x + 0 and x * 1 indentities.
---
tests/hlsl/arithmetic-float-uniform.shader_test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/tests/hlsl/arithmetic-float-uniform.shader_test b/tests/hlsl/arithmetic-float-uniform.shader_test index a49d3f00..0797b237 100644 --- a/tests/hlsl/arithmetic-float-uniform.shader_test +++ b/tests/hlsl/arithmetic-float-uniform.shader_test @@ -187,3 +187,21 @@ uniform 4 double2 1.625 -5.0 uniform 8 double2 1.00000007 -1.0 todo(sm<6) draw quad probe all rgba (2.62500024, 209.5, 0.0, 0.0) + + +% Test result when instructions might be removed because they are identities such as (+0) or (*1). +[pixel shader] +float4 a; + +float4 main() : sv_target +{ + float4 zero = {0, 0, 0, 0}; + float4 one = {1, 1, 1, 1}; + + return a + zero + a * one + zero * one; +} + +[test] +uniform 0 float4 0.2 0.3 9.1 3.2 +todo(glsl) draw quad +probe all rgba (0.4, 0.6, 18.2, 6.4)