From dfb369e87dd7638e84efe8feb9e7069e5238b44c Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Fri, 17 Jan 2025 07:23:31 +0200 Subject: Move global variable initialization into entry points for WGSL (#6106) * Add test that reproduces the issue in #5986 * Call moveGlobalVarInitializationToEntryPoints for WGSL as well This closes #5986. --------- Co-authored-by: Yong He --- source/slang/slang-emit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 176cd0558..4fee5c440 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -1471,6 +1471,7 @@ Result linkAndOptimizeIR( default: break; case CodeGenTarget::GLSL: + case CodeGenTarget::WGSL: moveGlobalVarInitializationToEntryPoints(irModule); break; // For SPIR-V to SROA across 2 entry-points a value must not be a global -- cgit v1.2.3