diff --git a/Makefile.am b/Makefile.am index d838007b..34f61ef9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -225,6 +225,7 @@ vkd3d_shader_tests = \ tests/hlsl/single-numeric-initializer.shader_test \ tests/hlsl/sm1-const-allocation.shader_test \ tests/hlsl/sm1-const-folding.shader_test \ + tests/hlsl/sm1-interstage-interface.shader_test \ tests/hlsl/sm6-ternary.shader_test \ tests/hlsl/sm6-uav-rwtexture.shader_test \ tests/hlsl/smoothstep.shader_test \ diff --git a/tests/hlsl/sm1-interstage-interface.shader_test b/tests/hlsl/sm1-interstage-interface.shader_test new file mode 100644 index 00000000..d9052006 --- /dev/null +++ b/tests/hlsl/sm1-interstage-interface.shader_test @@ -0,0 +1,61 @@ +[require] +shader model < 4.0 + +[input layout] +0 r32g32-float POSITION +0 r32g32-float TEXCOORD 0 +0 r32-float COLOR 1 +0 r32-float COLOR 0 +1 r32-float TEXCOORD 2 +1 r32-float TEXCOORD 3 + +[vb 0] +-1.0 -1.0 3.0 5.0 0.5 0.7 +-1.0 1.0 3.0 5.0 0.5 0.7 + 1.0 -1.0 3.0 5.0 0.5 0.7 + 1.0 1.0 3.0 5.0 0.5 0.7 + +[vb 1] +2.0 6.0 +2.0 6.0 +2.0 6.0 +2.0 6.0 + +[vertex shader] + +struct vertex +{ + float4 position : POSITION; + float2 t0 : TEXCOORD0; + float t2 : TEXCOORD2; + float t3 : TEXCOORD3; + float c0 : COLOR0; + float c1 : COLOR1; +}; + +void main(in vertex vin, out vertex vout) +{ + vout = vin; +} + +[pixel shader] + +struct vertex +{ + float t3 : TEXCOORD3; + float c1 : COLOR1; + float2 t0 : TEXCOORD0; + float c0 : COLOR0; +}; + +void main(struct vertex i, out float4 o : SV_Target) +{ + o.x = i.t0.y + i.t3; + o.y = i.c1; + o.z = i.c0; + o.w = i.t0.x; +} + +[test] +draw triangle strip 4 +probe (0,0) rgba(11.0, 0.5, 0.7, 3.0) diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index de1c87df..4ea90488 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -293,6 +293,8 @@ static D3DDECLTYPE vertex_decl_type_from_format(DXGI_FORMAT format) static D3DDECLUSAGE vertex_decl_usage_from_name(const char *name) { + if (!strcasecmp(name, "color")) + return D3DDECLUSAGE_COLOR; if (!strcasecmp(name, "position") || !strcasecmp(name, "sv_position")) return D3DDECLUSAGE_POSITION; if (!strcasecmp(name, "psize"))