diff options
| author | Yong He <yonghe@outlook.com> | 2024-09-27 19:27:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-27 19:27:20 -0700 |
| commit | c55805e9c6dc3a44e3983fea4245cb00d4e318d5 (patch) | |
| tree | b0904f55df01e3ca524cfb375350c6a23deafa37 /source | |
| parent | 5a84e520a808e28e0cc60f86981e4d8db81f8ad3 (diff) | |
Fix bug in `translateGlslGlobalVar()`. (#5181)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-translate-glsl-global-var.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<IRInst*> entryPoints; + List<IRInst*> 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<IREntryPointDecoration>()) 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) |
