From: Francisco Casas fcasas@codeweavers.com
--- Makefile.am | 1 + .../cast-componentwise-compatible.shader_test | 108 ++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 tests/cast-componentwise-compatible.shader_test
diff --git a/Makefile.am b/Makefile.am index 438c0158..953abaef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,6 +59,7 @@ vkd3d_shader_tests = \ tests/bitwise.shader_test \ tests/cast-broadcast.shader_test \ tests/cast-componentwise-equal.shader_test \ + tests/cast-componentwise-compatible.shader_test \ tests/cast-to-float.shader_test \ tests/cast-to-half.shader_test \ tests/cast-to-int.shader_test \ diff --git a/tests/cast-componentwise-compatible.shader_test b/tests/cast-componentwise-compatible.shader_test new file mode 100644 index 00000000..764b56d6 --- /dev/null +++ b/tests/cast-componentwise-compatible.shader_test @@ -0,0 +1,108 @@ +[pixel shader] +struct apple +{ + float3 aa; + int bb; +}; + +float4 main() : sv_target +{ + float f[4] = {1, 2, 3, 4}; + struct apple a; + + a = (struct apple) f; + return a.aa.xyzx; +} + + +[test] +todo draw quad +todo probe all rgba (1.0, 2.0, 3.0, 1.0) + + +[pixel shader] +Texture2D tex; + +struct apple +{ + int2 aa; + Texture2D bb; + float cc; +}; + +struct banana +{ + float aa[2]; + Texture2D bb; + int cc; +}; + +float4 main() : sv_target +{ + struct apple a = {1, 2, tex, 7.2}; + struct banana b; + + b = (struct banana) a; + return b.cc; +} + +[test] +todo draw quad +todo probe all rgba (7.0, 7.0, 7.0, 7.0) + + +[pixel shader] +Texture2D tex; + +struct apple +{ + int2 aa; + Texture2D bb; + float cc; + float4 dd; + Texture2D ee; +}; + +struct banana +{ + float aa[2]; + Texture2D bb; + int cc; +}; + +float4 main() : sv_target +{ + struct apple a = {1, 2, tex, 3, 4, 5, 6, 7, tex}; + struct banana b; + + b = (struct banana) a; + return b.cc; +} + +[test] +todo draw quad +todo probe all rgba (3.0, 3.0, 3.0, 3.0) + + +[pixel shader fail] +struct apple +{ + int2 aa; + float bb; +}; + +struct banana +{ + int2 aa; + float bb; + float cc; +}; + +float4 main() : sv_target +{ + struct apple a = {1, 2, 3}; + struct banana b; + + b = (struct banana) a; + return b.bb; +}