summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-06 22:02:43 -0800
committerGitHub <noreply@github.com>2025-02-06 22:02:43 -0800
commitbae87afb20f95f9f27c64c4955bbc4464c576509 (patch)
tree44d079bd76002d69be20efdbd03ac6ff62ef8caf /source/slang/slang-check-decl.cpp
parent075b10e69055acc6536d74c1cb3399e0fe75338d (diff)
Support stage_switch. (#6311)
* Support stage_switch. * Update proposal status. * Fix gl_InstanceID. * Fix.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index ab3335bfb..39ab41421 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -12735,14 +12735,26 @@ struct CapabilityDeclReferenceVisitor
std::swap(stmt->targetCases[i], stmt->targetCases[i + 1]);
continue;
}
-
- if (!maybeRequireCapability)
- targetCap = (CapabilitySet(CapabilityName::any_target)
- .getTargetsThisHasButOtherDoesNot(set));
+ if (as<StageSwitchStmt>(stmt))
+ {
+ if (!maybeRequireCapability)
+ targetCap = (CapabilitySet(CapabilityName::any_target)
+ .getStagesThisHasButOtherDoesNot(set));
+ else
+ targetCap =
+ (maybeRequireCapability->capabilitySet.getStagesThisHasButOtherDoesNot(
+ set));
+ }
else
- targetCap =
- (maybeRequireCapability->capabilitySet.getTargetsThisHasButOtherDoesNot(
- set));
+ {
+ if (!maybeRequireCapability)
+ targetCap = (CapabilitySet(CapabilityName::any_target)
+ .getTargetsThisHasButOtherDoesNot(set));
+ else
+ targetCap =
+ (maybeRequireCapability->capabilitySet.getTargetsThisHasButOtherDoesNot(
+ set));
+ }
}
else
{