summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-modifier.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-01-24 15:36:49 -0800
committerGitHub <noreply@github.com>2024-01-24 15:36:49 -0800
commite7b6de334f320429462a0257e2191ccf3cbc9a0d (patch)
tree7e2f6802a2f6fa5217903948efbd994b51e103b7 /source/slang/slang-check-modifier.cpp
parentdd57306d951dbcaf6471659fcd1d2c37738f36d0 (diff)
[SPIRV] Support `globallycoherent` and `[vk::index()]`. (#3488)
* [SPIRV] Support `globallycoherent` modifier. * Fix. * Disable executable cooperative vector tests. * Update expected failure. * [SPIRV] Emit varying output index decoration. * Add test. * Update tests. * Fix test. * Emit `SpvExecutionModeEarlyFragmentTests`. * Lower `StructuredBuffer<bool>`. * Support globallycoherent on ByteAddressBuffer. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
-rw-r--r--source/slang/slang-check-modifier.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp
index c9800b325..413e1c157 100644
--- a/source/slang/slang-check-modifier.cpp
+++ b/source/slang/slang-check-modifier.cpp
@@ -1033,9 +1033,12 @@ namespace Slang
case ASTNodeType::RayPayloadAccessSemantic:
case ASTNodeType::RayPayloadReadSemantic:
case ASTNodeType::RayPayloadWriteSemantic:
- case ASTNodeType::GloballyCoherentModifier:
return (as<VarDeclBase>(decl) && isGlobalDecl(decl)) || as<ParamDecl>(decl) || as<GLSLInterfaceBlockDecl>(decl);
+ case ASTNodeType::GloballyCoherentModifier:
+ case ASTNodeType::HLSLVolatileModifier:
+ return as<VarDecl>(decl) && (isGlobalDecl(decl) || as<StructDecl>(getParentDecl(decl)) || as<GLSLInterfaceBlockDecl>(decl));
+
// Allowed only on parameters, struct fields and global variables.
case ASTNodeType::InterpolationModeModifier:
case ASTNodeType::HLSLNoInterpolationModifier:
@@ -1090,7 +1093,6 @@ namespace Slang
case ASTNodeType::HLSLColumnMajorLayoutModifier:
case ASTNodeType::GLSLRowMajorLayoutModifier:
case ASTNodeType::HLSLEffectSharedModifier:
- case ASTNodeType::HLSLVolatileModifier:
return as<VarDeclBase>(decl) || as<GLSLInterfaceBlockDecl>(decl);
case ASTNodeType::GLSLPrecisionModifier: