From dff2f746bc19dc5e783b6d3e1fbdb725a5f9a08c Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Fri, 26 Apr 2024 20:40:27 -0400 Subject: [PATCH] tests: Test complex array size expression. --- tests/hlsl/array-size-expr.shader_test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/hlsl/array-size-expr.shader_test b/tests/hlsl/array-size-expr.shader_test index a5666fd2..366e25d5 100644 --- a/tests/hlsl/array-size-expr.shader_test +++ b/tests/hlsl/array-size-expr.shader_test @@ -66,3 +66,27 @@ float4 main() : sv_target [test] todo draw quad probe all rgba (2, 3, 6, 1) + + +[pixel shader fail(sm>=6) todo] +static const struct +{ + float f; + float2x3 m[2]; +} a = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1}; + +float arr[a.m[1]._13_22_21.zxy.z]; // Fails on SM6 because size is float. + +float4 main() : sv_target +{ + return arr[4]; +} + +[test] +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 +todo draw quad +probe all rgba (42, 42, 42, 42)