From 1b7340a6ed7e67b4526cf82dfd16dc9280e47c33 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 4 Feb 2025 15:02:42 +1000 Subject: [PATCH] tests/hlsl: Add a numeric types 16-bit test. --- tests/hlsl/numeric-types.shader_test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/hlsl/numeric-types.shader_test b/tests/hlsl/numeric-types.shader_test index b39fa612..593ff1d4 100644 --- a/tests/hlsl/numeric-types.shader_test +++ b/tests/hlsl/numeric-types.shader_test @@ -100,3 +100,26 @@ float4 main() : sv_target 13.0, 14.0, 15.0); return m[1]; } + + +[require] +shader model >= 6.2 +native-16-bit + +[pixel shader] +float4 main() : sv_target +{ + half4 a = {0, 1, 2, 3}; + half2 b = {4, 5}; + int16_t3 c = {6.4, 7, 8}; + int16_t d = 9.4; + uint16_t4x2 e = {14.4, 15, 16, 17, 18, 19, 20, 21}; + vector g = {22, 23, 24}; + matrix h = {25.4, 26, 27, 28, 29, 30}; + + return mul(e, b) + a + c.xyzx + d + g.xxyz + h[2].xyxy; +} + +[test] +draw quad +probe (0, 0) rgba (197.0, 218.0, 238.0, 257.0)