diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-06 14:53:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-06 14:53:27 -0700 |
| commit | 618428a87b8295347288262ea13eff63cc62aa56 (patch) | |
| tree | a602766742a437c3f0577ae6e3c1077c1b4e082c /source/slang/slang-emit.cpp | |
| parent | 2220d26c24b259075182672be22e1494b4affc95 (diff) | |
Delete `wrap-global-context` pass. (#4114)
* Delete `wrap-global-context` pass.
The pass was added for the metal backend without realizing that the existing `explicit-global-context` does 99% of the job. Instead of duplicating the logic in a different pass for metal, we extend same explicit-global-context pass to work for metal.
* Fix build.
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index afdd37fce..39ebaa64d 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -70,7 +70,6 @@ #include "slang-ir-synthesize-active-mask.h" #include "slang-ir-validate.h" #include "slang-ir-wrap-structured-buffers.h" -#include "slang-ir-wrap-global-context.h" #include "slang-ir-liveness.h" #include "slang-ir-glsl-liveness.h" #include "slang-ir-translate-glsl-global-var.h" @@ -886,9 +885,9 @@ Result linkAndOptimizeIR( case CodeGenTarget::GLSL: case CodeGenTarget::SPIRV: case CodeGenTarget::SPIRVAssembly: - case CodeGenTarget::Metal: moveGlobalVarInitializationToEntryPoints(irModule); break; + case CodeGenTarget::Metal: case CodeGenTarget::CPPSource: case CodeGenTarget::CUDASource: moveGlobalVarInitializationToEntryPoints(irModule); @@ -1097,12 +1096,6 @@ Result linkAndOptimizeIR( validateIRModuleIfEnabled(codeGenContext, irModule); } - // Metal does not allow global variables and global parameters, so - // we need to convert them into an explicit global context parameter - // passed around through a function parameter. - if (target == CodeGenTarget::Metal) - wrapGlobalScopeInContextType(irModule); - auto metadata = new ArtifactPostEmitMetadata; outLinkedIR.metadata = metadata; |
