Zebediah Figura : tests: Test casts to half.

Alexandre Julliard julliard at winehq.org
Wed Sep 15 16:20:12 CDT 2021


Module: vkd3d
Branch: master
Commit: 6fb5d2c11cc50487571917decd37e8b40a5bb767
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=6fb5d2c11cc50487571917decd37e8b40a5bb767

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Sep  9 21:11:33 2021 -0500

tests: Test casts to half.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 Makefile.am                    |  2 ++
 tests/cast-to-half.shader_test | 29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index d707a26..a1b6eb3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,6 +55,7 @@ vkd3d_shader_runners = \
 
 vkd3d_shader_tests = \
 	tests/cast-to-float.shader_test \
+	tests/cast-to-half.shader_test \
 	tests/conditional.shader_test \
 	tests/hlsl-array-dimension.shader_test \
 	tests/hlsl-bool-cast.shader_test \
@@ -268,6 +269,7 @@ tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la
 SHADER_TEST_LOG_COMPILER = tests/shader_runner_d3d12
 XFAIL_TESTS = \
 	tests/cast-to-float.shader_test \
+	tests/cast-to-half.shader_test \
 	tests/conditional.shader_test \
 	tests/hlsl-array-dimension.shader_test \
 	tests/hlsl-bool-cast.shader_test \
diff --git a/tests/cast-to-half.shader_test b/tests/cast-to-half.shader_test
new file mode 100644
index 0000000..6db5412
--- /dev/null
+++ b/tests/cast-to-half.shader_test
@@ -0,0 +1,29 @@
+[pixel shader]
+
+float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target
+{
+    return float4(((half)i) + 1.5, ((half)u) - 2.5, ((half)b) / 2, f);
+}
+
+[test]
+uniform 0 int -1
+uniform 1 uint 3
+uniform 2 int -2
+uniform 3 float 0.5
+draw quad
+probe all rgba (0.5, 0.5, 0.5, 0.5)
+
+[pixel shader]
+
+float4 main() : sv_target
+{
+    int i = -1;
+    uint u = 3;
+    bool b = true;
+    float f = 0.5;
+    return float4(((half)i) + 1.5, ((half)u) - 2.5, ((half)b) / 2, f);
+}
+
+[test]
+draw quad
+probe all rgba (0.5, 0.5, 0.5, 0.5)




More information about the wine-cvs mailing list