From c55805e9c6dc3a44e3983fea4245cb00d4e318d5 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 27 Sep 2024 19:27:20 -0700 Subject: Fix bug in `translateGlslGlobalVar()`. (#5181) --- source/slang/slang-ir-translate-glsl-global-var.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/slang/slang-ir-translate-glsl-global-var.cpp b/source/slang/slang-ir-translate-glsl-global-var.cpp index 8cb7fa8e9..4b2196e37 100644 --- a/source/slang/slang-ir-translate-glsl-global-var.cpp +++ b/source/slang/slang-ir-translate-glsl-global-var.cpp @@ -17,6 +17,8 @@ namespace Slang buildEntryPointReferenceGraph(referencingEntryPoints, module); List entryPoints; + List getWorkGroupSizeInsts; + // Traverse the module to find all entry points. // If we see a `GetWorkGroupSize` instruction, we will materialize it. // @@ -25,9 +27,10 @@ namespace Slang if (inst->getOp() == kIROp_Func && inst->findDecoration()) entryPoints.add(inst); else if (inst->getOp() == kIROp_GetWorkGroupSize) - materializeGetWorkGroupSize(module, referencingEntryPoints, inst); + getWorkGroupSizeInsts.add(inst); } - + for (auto inst : getWorkGroupSizeInsts) + materializeGetWorkGroupSize(module, referencingEntryPoints, inst); IRBuilder builder(module); for (auto entryPoint : entryPoints) -- cgit v1.2.3