diff --git a/tests/hlsl/static-initializer.shader_test b/tests/hlsl/static-initializer.shader_test index 0647e2b8..c1cef48c 100644 --- a/tests/hlsl/static-initializer.shader_test +++ b/tests/hlsl/static-initializer.shader_test @@ -104,7 +104,6 @@ float4 main() : sv_target // This is allowed in 10.0.10011.16384 but not in 9.29.952.3111 static Texture2D tex; sampler sam; -uniform uint i; float4 main() : sv_target { @@ -114,6 +113,33 @@ float4 main() : sv_target } +[pixel shader fail(sm<6)] +// This fails, so SM4 resource samples always require a non-static +// sampler, whether the result is used or not. Unlike the texture which can be +// static if the result is not used. +Texture2D tex; +static sampler sam; + +float4 main() : sv_target +{ + float4 unused = tex.Sample(sam, float2(0, 0)); + + return 0; +} + + +[pixel shader fail] +// The sampler can also never be static on SM1 style resource samples. +static sampler sam; + +float4 main() : sv_target +{ + float4 unused = tex2D(sam, float2(0, 0)); + + return 0; +} + + [pixel shader fail] static Texture2D tex1; sampler sam;