[PATCH vkd3d 3/8] tests: Test redefining intrinsic functions.

Matteo Bruni mbruni at codeweavers.com
Wed Jan 19 05:52:01 CST 2022


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
I see, this shows that the override is per-overload, nice...

 Makefile.am                               |  2 ++
 tests/hlsl-intrinsic-override.shader_test | 31 +++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 tests/hlsl-intrinsic-override.shader_test

diff --git a/Makefile.am b/Makefile.am
index 20fee06d..0c2fbf7d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,7 @@ vkd3d_shader_tests = \
 	tests/hlsl-duplicate-modifiers.shader_test \
 	tests/hlsl-for.shader_test \
 	tests/hlsl-function-overload.shader_test \
+	tests/hlsl-intrinsic-override.shader_test \
 	tests/hlsl-invalid.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
 	tests/hlsl-majority-typedef.shader_test \
@@ -293,6 +294,7 @@ XFAIL_TESTS = \
 	tests/hlsl-duplicate-modifiers.shader_test \
 	tests/hlsl-for.shader_test \
 	tests/hlsl-function-overload.shader_test \
+	tests/hlsl-intrinsic-override.shader_test \
 	tests/hlsl-majority-pragma.shader_test \
 	tests/hlsl-majority-typedef.shader_test \
 	tests/hlsl-nested-arrays.shader_test \
diff --git a/tests/hlsl-intrinsic-override.shader_test b/tests/hlsl-intrinsic-override.shader_test
new file mode 100644
index 00000000..55a23f21
--- /dev/null
+++ b/tests/hlsl-intrinsic-override.shader_test
@@ -0,0 +1,31 @@
+[pixel shader]
+
+float2 max(float2 a, float2 b)
+{
+    return a + b;
+}
+
+float4 main() : sv_target
+{
+    return float4(max(0.1, 0.2), max(float2(0.1, 0.2), float2(0.3, 0.4)));
+}
+
+[test]
+draw quad
+probe all rgba (0.3, 0.3, 0.4, 0.6)
+
+[pixel shader]
+
+float2 max(float2 a, float3 b)
+{
+    return a + b.xy;
+}
+
+float4 main() : sv_target
+{
+    return float4(max(0.1, 0.2), max(float2(0.1, 0.2), float2(0.3, 0.4)));
+}
+
+[test]
+draw quad
+probe all rgba (0.3, 0.3, 0.3, 0.4)
-- 
2.34.1




More information about the wine-devel mailing list