From e9260bba3ac22a9df88ad1085829d3b4d9abb6d3 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Mon, 10 Jun 2024 13:14:48 -0400 Subject: [PATCH] tests: Test shader compilation within function definitions. --- tests/hlsl/effect-compile.shader_test | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/hlsl/effect-compile.shader_test b/tests/hlsl/effect-compile.shader_test index dc5c3e1c..6dd06340 100644 --- a/tests/hlsl/effect-compile.shader_test +++ b/tests/hlsl/effect-compile.shader_test @@ -66,6 +66,17 @@ technique float4 main() : sv_target { return 0; } +[pixel shader fail(sm<6)] +float4 fun() : sv_target { return 0; } + +float4 main() : sv_target +{ + PixelShader ps1 = compile ps_2_0 fun(); // Object literals not allowed inside functions. + + return 0; +} + + % Test the CompileShader() syntax. [pixel shader todo fail(sm>=6)] float arg1, arg2; @@ -139,3 +150,14 @@ float4 main() : sv_target { return 0; } PixelShader ps1 = CompileShader(ps_2_0, main()); PixelShader ps2 = ps1; + + +[pixel shader fail(sm<6)] +float4 fun() : sv_target { return 0; } + +float4 main() : sv_target +{ + PixelShader ps1 = CompileShader(ps_2_0, fun()); // Object literals not allowed inside functions. + + return 0; +}