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

Zebediah Figura zfigura at codeweavers.com
Fri Dec 17 11:48:20 CST 2021


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 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 20fee06d0..0c2fbf7d7 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 000000000..55a23f21d
--- /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