From cb514ef6e00dd03976ea75bf3460e0f66892408e Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Tue, 14 Oct 2025 15:27:14 -0500 Subject: [PATCH] tests: Test a shader with many semantics. --- Makefile.am | 1 + tests/hlsl/many-semantics.shader_test | 37 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/hlsl/many-semantics.shader_test diff --git a/Makefile.am b/Makefile.am index 39221850f..3136915fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -190,6 +190,7 @@ vkd3d_shader_tests = \ tests/hlsl/majority-pragma.shader_test \ tests/hlsl/majority-syntax.shader_test \ tests/hlsl/majority-typedef.shader_test \ + tests/hlsl/many-semantics.shader_test \ tests/hlsl/math.shader_test \ tests/hlsl/matrix-indexing.shader_test \ tests/hlsl/matrix-semantics.shader_test \ diff --git a/tests/hlsl/many-semantics.shader_test b/tests/hlsl/many-semantics.shader_test new file mode 100644 index 000000000..d296637fd --- /dev/null +++ b/tests/hlsl/many-semantics.shader_test @@ -0,0 +1,37 @@ +[input layout] +0 r32g32-float position +0 r32-float color 0 +0 r32-float color 1 +0 r32-float texcoord 0 +0 r32-float texcoord 1 +0 r32-float texcoord 2 +0 r32-float texcoord 3 +0 r32-float texcoord 4 +0 r32-float texcoord 5 +0 r32-float texcoord 6 +0 r32-float texcoord 7 + +[vb 0] +-1.0 -1.0 0.5 0.6 0.1 0.2 0.3 0.4 0.05 0.06 0.07 0.08 +-1.0 1.0 0.5 0.6 0.1 0.2 0.3 0.4 0.05 0.06 0.07 0.08 + 1.0 -1.0 0.5 0.6 0.1 0.2 0.3 0.4 0.05 0.06 0.07 0.08 + 1.0 1.0 0.5 0.6 0.1 0.2 0.3 0.4 0.05 0.06 0.07 0.08 + +[vertex shader] +void main(float4 pos : position, inout float color[2] : color, + inout float texcoord[8] : texcoord, out float4 out_pos : sv_position) +{ + out_pos = pos; +} + +[pixel shader] +float4 main(float color[2] : color, float texcoord[8] : texcoord) : sv_target +{ + return float4(texcoord[0], texcoord[1], texcoord[2], texcoord[3]) + + float4(texcoord[4], texcoord[5], texcoord[6], texcoord[7]) + + float4(color[0], color[1], 0, 0); +} + +[test] +todo(sm<4 | msl & sm>=6) draw triangle strip 4 +probe (0,0) f32(.65, .86, .37, .48) 1