From e7b6de334f320429462a0257e2191ccf3cbc9a0d Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Jan 2024 15:36:49 -0800 Subject: [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`. * Support globallycoherent on ByteAddressBuffer. --------- Co-authored-by: Yong He --- source/slang/slang-check-modifier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-modifier.cpp') 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(decl) && isGlobalDecl(decl)) || as(decl) || as(decl); + case ASTNodeType::GloballyCoherentModifier: + case ASTNodeType::HLSLVolatileModifier: + return as(decl) && (isGlobalDecl(decl) || as(getParentDecl(decl)) || as(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(decl) || as(decl); case ASTNodeType::GLSLPrecisionModifier: -- cgit v1.2.3