diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-11 12:31:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-11 12:31:37 -0700 |
| commit | 6909d65c77bb4e7c9cfb281bd1684a58d5f8b94d (patch) | |
| tree | 396a628b7fda779dcc6e820e86d44e29d0c7be95 /source/slang/slang-ir-specialize-target-switch.cpp | |
| parent | ef20d9309674dc8c25a9798d95138cf739299928 (diff) | |
SPIRV backend: add support for tessellation stages, (#4336)
Diffstat (limited to 'source/slang/slang-ir-specialize-target-switch.cpp')
| -rw-r--r-- | source/slang/slang-ir-specialize-target-switch.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/slang/slang-ir-specialize-target-switch.cpp b/source/slang/slang-ir-specialize-target-switch.cpp index 46ea51192..e3ef06e18 100644 --- a/source/slang/slang-ir-specialize-target-switch.cpp +++ b/source/slang/slang-ir-specialize-target-switch.cpp @@ -9,6 +9,16 @@ namespace Slang { void specializeTargetSwitch(TargetRequest* target, IRGlobalValueWithCode* code, DiagnosticSink* sink) { + if (auto gen = as<IRGeneric>(code)) + { + auto retVal = findGenericReturnVal(gen); + if (auto innerCode = as<IRGlobalValueWithCode>(retVal)) + { + specializeTargetSwitch(target, innerCode, sink); + return; + } + } + bool changed = false; for (auto block : code->getBlocks()) { @@ -76,14 +86,6 @@ namespace Slang if (auto code = as<IRGlobalValueWithCode>(globalInst)) { specializeTargetSwitch(target, code, sink); - if (auto gen = as<IRGeneric>(code)) - { - auto retVal = findGenericReturnVal(gen); - if (auto innerCode = as<IRGlobalValueWithCode>(retVal)) - { - specializeTargetSwitch(target, innerCode, sink); - } - } } } } |
