From 900433e3711816c96328277c6037e475bec707a2 Mon Sep 17 00:00:00 2001 From: Victor Chiletto Date: Tue, 26 Mar 2024 18:11:22 -0300 Subject: [PATCH] tests/hlsl: Add a test for dynamically indexed multisampled texture loads. --- tests/hlsl/texture-load.shader_test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hlsl/texture-load.shader_test b/tests/hlsl/texture-load.shader_test index 495fa88e..3858f7ca 100644 --- a/tests/hlsl/texture-load.shader_test +++ b/tests/hlsl/texture-load.shader_test @@ -117,3 +117,30 @@ float4 main(float4 pos : sv_position) : sv_target Texture2DMS s = t; return s.Load(pos.yx, 0); } + +% SM4.0 cannot dynamically index multisampled textures, it relies on loop unrolling. + +[require] +shader model >= 4.0 +shader model < 4.1 + +[pixel shader todo] +Texture2DMS t; + +float4 main(float4 pos : sv_position) : sv_target +{ + int i; + float4 o; + for (i = 0; i < 1; i++) + { + o = t.Load(pos.xy, i); + } + return o; +} + +[test] +todo draw quad +probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) +probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8) +probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1) +probe (1, 1) rgba (0.8, 0.0, 0.7, 1.0)