From 026624a266bbad5181cdfbd3a9bfcdf84bf5b204 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 5 Nov 2024 22:10:38 +0100 Subject: [PATCH] tests: Work around a Metal bug in switch.shader_test. The Metal bug was reported to Apple as FB15617433. Since we don't care specifically about that bug, I'm just tweaking the test so that it doesn't hit that bad path any more. --- tests/hlsl/switch.shader_test | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/hlsl/switch.shader_test b/tests/hlsl/switch.shader_test index 3898c777..9aa59175 100644 --- a/tests/hlsl/switch.shader_test +++ b/tests/hlsl/switch.shader_test @@ -583,11 +583,14 @@ probe (0, 0) rgba (7.0, 8.0, 9.0, 10.0) % return from a switch nested in a loop [pixel shader fail(sm<4) todo(sm<4)] -uint4 v; +/* In theory this could be directly defined as uint4, but that hits some kind + * of optimization bug on Metal, which we work around this way. */ +float4 vf; float4 main() : sv_target { float4 c = {1.0, 2.0, 3.0, 4.0}; + uint4 v = vf; uint i, j; for (i = 0; i < v.z; i++) @@ -608,12 +611,10 @@ float4 main() : sv_target } [test] -if(sm<4) uniform 0 float4 0 0 3 1 -if(sm>=4) uniform 0 uint4 0 0 3 1 +uniform 0 float4 0 0 3 1 todo(msl) draw quad probe (0, 0) rgba (304.0, 305.0, 306.0, 307.0) -if(sm<4) uniform 0 float4 1 0 3 1 -if(sm>=4) uniform 0 uint4 1 0 3 1 +uniform 0 float4 1 0 3 1 todo(msl) draw quad probe (0, 0) rgba (3.0, 4.0, 5.0, 6.0)