From 56cd64ccba591edb3a29681f689f46870194f142 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Thu, 15 Aug 2024 17:38:09 -0400 Subject: [PATCH] tests: Test shader compilation with default values. --- tests/hlsl/effect-compile.shader_test | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/hlsl/effect-compile.shader_test b/tests/hlsl/effect-compile.shader_test index f1a19f25..acfab529 100644 --- a/tests/hlsl/effect-compile.shader_test +++ b/tests/hlsl/effect-compile.shader_test @@ -183,6 +183,42 @@ float4 main() : sv_target return 0; } + +% Default values are allowed for uniform variables. +[pixel shader todo fail(sm>=6)] +float4 fun(uniform float4 a, uniform float4 b = {1, 2, 3, 4}) : sv_target +{ + return 8*a + b; +} + +technique10 T1 +{ + pass P1 + { + PixelShader = compile ps_4_0 fun(5); + } +} + +float4 main() : sv_target { return 0; } + + +[pixel shader todo fail(sm>=6)] +float4 fun(float4 a : COLOR0 = {-1, -2, -3, -4}, uniform float4 b = {1, 2, 3, 4}) : sv_target +{ + return 8*a + b; +} + +technique10 T1 +{ + pass P1 + { + PixelShader = compile ps_4_0 fun(); + } +} + +float4 main() : sv_target { return 0; } + + [require] shader model >= 5.0 shader model < 6.0