diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-06-13 14:54:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 14:54:58 -0400 |
| commit | ecc6ecb3a25a28eb5e85cfdb2bf170448ab9a4e7 (patch) | |
| tree | 5bdb6d9d846eb3e8e1890958b173dcee33528138 /source/slang | |
| parent | 0bf0bf77ac697d2a0fc7d90ec2899c6393b4306a (diff) | |
Fix cuda/cpp/metal crash for when using GLSL style shader inputs (#4378)
Decorations were not expected as an input, this causes a crash.
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-ir-explicit-global-context.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-ir-explicit-global-context.cpp b/source/slang/slang-ir-explicit-global-context.cpp index 9bbaf3875..9d3f09712 100644 --- a/source/slang/slang-ir-explicit-global-context.cpp +++ b/source/slang/slang-ir-explicit-global-context.cpp @@ -462,11 +462,15 @@ struct IntroduceExplicitGlobalContextPass for( IRUse* use = globalVar->firstUse; use; use = nextUse ) { nextUse = use->nextUse; + auto user = use->getUser(); + + // Ensure the use site checked actually requires a replacement + if (as<IRDecoration>(user)) + continue; // At each use site, we need to look up the context // pointer that is appropriate for that use. // - auto user = use->getUser(); auto contextParam = findOrCreateContextPtrForInst(user); builder.setInsertBefore(user); |
