From 537697d3aa21b418c348b1017005603668b6a4cb Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Thu, 16 Oct 2025 21:53:10 +0300 Subject: Inline global constants for shader style CPU targets (#8686) On the shader-host-callable target, test `gh-4874.slang` generates IR that contains global constants referencing global params. These need to get inlined into functions, as otherwise `introduceExplicitGlobalContext()` will fail with "no outer func at use site for global", making the test crash the compiler. --- tests/bugs/gh-4874.slang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/bugs/gh-4874.slang b/tests/bugs/gh-4874.slang index 403f6fc50..53a2aaf38 100644 --- a/tests/bugs/gh-4874.slang +++ b/tests/bugs/gh-4874.slang @@ -6,6 +6,7 @@ // //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -vk +//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -cpu // //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer outputBuffer; @@ -47,4 +48,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) // CHECK: 432 // CHECK: 543 // CHECK: 654 -} \ No newline at end of file +} -- cgit v1.2.3