From e805fe3e362c43cb41e32adf16f996a3de452bb3 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Wed, 18 Dec 2024 00:22:07 -0600 Subject: [PATCH] tests: Adjust array-size-expr.shader_test to pass with 1.x. Pixel shader 1.x constants must be between -1 and 1, or they will be clamped, even constants defined in the shader. Also mark 1.x-specific features if any. --- tests/hlsl/array-size-expr.shader_test | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/hlsl/array-size-expr.shader_test b/tests/hlsl/array-size-expr.shader_test index 34e639ba..c0f20d4a 100644 --- a/tests/hlsl/array-size-expr.shader_test +++ b/tests/hlsl/array-size-expr.shader_test @@ -1,11 +1,11 @@ [pixel shader] static const float4 array_st[(2 + 1) * 2] = { - 11, 12, 13, 14, - 21, 22, 23, 24, - 31, 32, 33, 34, - 41, 42, 43, 44, - 51, 52, 53, 54, - 61, 62, 63, 64, + .11, .12, .13, .14, + .21, .22, .23, .24, + .31, .32, .33, .34, + .41, .42, .43, .44, + .51, .52, .53, .54, + .61, .62, .63, .64, }; float4 main() : SV_TARGET @@ -15,19 +15,19 @@ float4 main() : SV_TARGET [test] draw quad -probe (0, 0) rgba (21, 22, 23, 24) +probe (0, 0) rgba (.21, .22, .23, .24) [pixel shader] static const float4 array_st[2*2][1+1] = { - 11, 12, 13, 14, - 21, 22, 23, 24, - 31, 32, 33, 34, - 41, 42, 43, 44, - 51, 52, 53, 54, - 61, 62, 63, 64, - 71, 72, 73, 74, - 81, 82, 83, 84, + .11, .12, .13, .14, + .21, .22, .23, .24, + .31, .32, .33, .34, + .41, .42, .43, .44, + .51, .52, .53, .54, + .61, .62, .63, .64, + .71, .72, .73, .74, + .81, .82, .83, .84, }; float4 main() : SV_TARGET @@ -37,11 +37,11 @@ float4 main() : SV_TARGET [test] draw quad -probe (0, 0) rgba (61, 62, 63, 64) +probe (0, 0) rgba (.61, .62, .63, .64) [pixel shader] static const int size = 8; -static const float array[size] = {1, 2, 3, 4, 5, 6, 7, 8}; +static const float array[size] = {.1, .2, .3, .4, .5, .6, .7, .8}; float4 main() : sv_target { @@ -50,13 +50,13 @@ float4 main() : sv_target [test] draw quad -probe (0, 0) rgba (2, 3, 6, 1) +probe (0, 0) rgba (.2, .3, .6, .1) % Additional level of indirection [pixel shader fail(sm>=6)] -static const float array[8] = {1, 2, 3, 4, 5, 6, 7, 8}; +static const float array[8] = {.1, .2, 3, .4, .5, .6, .7, .8}; static const int idx = 2; -static const float array2[array[idx]] = {1, 2, 3}; +static const float array2[array[idx]] = {1, 2, .3}; float4 main() : sv_target { @@ -65,7 +65,7 @@ float4 main() : sv_target [test] draw quad -probe (0, 0) rgba (2, 3, 6, 1) +probe (0, 0) rgba (.2, .3, .6, .1) [pixel shader fail(sm>=6)] @@ -87,6 +87,6 @@ uniform 0 float 0.0 uniform 4 float 0.0 uniform 8 float 0.0 uniform 12 float 0.0 -uniform 16 float 42.0 +uniform 16 float 0.42 draw quad -probe (0, 0) rgba (42, 42, 42, 42) +probe (0, 0) rgba (0.42, 0.42, 0.42, 0.42)