diff --git a/tests/compute/type-legalize-global-with-init.slang b/tests/compute/type-legalize-global-with-init.slang index 573ac98499..a3a1429aae 100644 --- a/tests/compute/type-legalize-global-with-init.slang +++ b/tests/compute/type-legalize-global-with-init.slang @@ -14,19 +14,15 @@ RWStructuredBuffer inputBuffer; static const RWStructuredBuffer gBuffer = inputBuffer; -struct Stuff -{ - RWStructuredBuffer a; - RWStructuredBuffer b; -} - -static const Stuff gStuff = { inputBuffer, inputBuffer }; +// Note: due to #4874 we cannot assign functions to globals +// which contain resource types. +static const RWStructuredBuffer gStuff = inputBuffer; uint test(uint x) { return gBuffer[x] - + gStuff.a[x + 1] * 16 - + gStuff.b[x + 2] * 256; + + gStuff[x + 1] * 16 + + gStuff[x + 2] * 256; } [numthreads(4, 1, 1)]