From e411fcb60ecd60c0cbce53aa9f1c12dd8a4b7a7e Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 14 Oct 2024 22:33:32 +0200 Subject: [PATCH] tests: Test discontiguous signature masks with SM<4 shaders. --- tests/hlsl/interface-packing.shader_test | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/hlsl/interface-packing.shader_test b/tests/hlsl/interface-packing.shader_test index bc5bbaa1..6c2d8cd2 100644 --- a/tests/hlsl/interface-packing.shader_test +++ b/tests/hlsl/interface-packing.shader_test @@ -123,3 +123,38 @@ todo probe (5, 0) rgba ( 7.0, 18.0, 19.0, 0.0) todo probe (6, 0) rgba (27.0, 28.0, 0.0, 0.0) todo probe (7, 0) rgba ( 8.0, 9.0, 10.0, 11.0) todo probe (8, 0) rgba (23.0, 24.0, 25.0, 0.0) + +[require] +shader model >= 3.0 + +[input layout] +0 r32g32-float POSITION + +[vb 0] +-1.0 -1.0 +-1.0 3.0 +3.0 -1.0 + +[vertex shader] +void main(float2 in_pos : POSITION, out float4 pos : SV_Position, out float4 color : COLOR) +{ + pos = float4(in_pos, 0.0f, 1.0f); + color = float4(1.0f, 2.0f, 3.0f, 4.0f); +} + +[pixel shader] +% The point of this test is to check that signature masks are handled correctly +% when they are not contiguous, so we attempt reading only component .xw from +% `color'. This happens when the shader is compiled by native, but not by us, +% currently, so it's not very useful for the moment. I'm leaving it anyway +% so that it either becomes useful when our HLSL compiler becomes more optimized +% or can be eventually rewritten in assembly/bytecode when the shader runner +% supports that. +float4 main(float4 pos : SV_Position, float4 color : COLOR) : SV_Target +{ + return float4(color.x, 10.0f, 11.0f, color.w); +} + +[test] +draw triangle list 3 +todo(sm<4) probe (0, 0) rgba (1.0, 10.0, 11.0, 4.0)