diff options
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index cc65edd2f..081ccbb0b 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -720,6 +720,13 @@ struct SemanticsDeclReferenceVisitor : public SemanticsDeclVisitorBase, // Pass down the callee location processDeclModifiers(expr->declRef.getDecl(), expr->loc); } + + void visitMemberExpr(MemberExpr* expr) + { + dispatchIfNotNull(expr->baseExpression); + visitDeclRefExpr(expr); + } + void visitStaticMemberExpr(StaticMemberExpr* expr) { dispatchIfNotNull(expr->declRef.declRefBase); @@ -2009,7 +2016,7 @@ void SemanticsDeclHeaderVisitor::checkPushConstantBufferType(VarDeclBase* varDec { varDecl->type.type = getConstantBufferType( cbufferType->getElementType(), - m_astBuilder->getStd430LayoutType()); + m_astBuilder->getDefaultPushConstantLayoutType()); } } else if (isGlobalShaderParameter(varDecl)) @@ -2017,8 +2024,9 @@ void SemanticsDeclHeaderVisitor::checkPushConstantBufferType(VarDeclBase* varDec // If this is a global variable with [vk::push_constant] attribute, // we need to make sure to wrap it in a `ConstantBuffer`. // - varDecl->type.type = - getConstantBufferType(varDecl->type, m_astBuilder->getStd430LayoutType()); + varDecl->type.type = getConstantBufferType( + varDecl->type, + m_astBuilder->getDefaultPushConstantLayoutType()); } } } @@ -13660,8 +13668,12 @@ CapabilitySet SemanticsDeclCapabilityVisitor::getDeclaredCapabilitySet(Decl* dec // For every existing target, we want to join their requirements together. // If the the parent defines additional targets, we want to add them to the disjunction set. // For example: - // [require(glsl)] struct Parent { [require(glsl, glsl_ext_1)] [require(spirv)] void - // foo(); } + // [require(glsl)] + // struct Parent { + // [require(glsl, glsl_ext_1)] + // [require(spirv)] + // void foo(); + // } // The requirement for `foo` should be glsl+glsl_ext_1 | spirv. // CapabilitySet declaredCaps; @@ -14197,19 +14209,18 @@ void SemanticsDeclCapabilityVisitor::diagnoseUndeclaredCapability( } } - //// The second scenario is when the callee is using a capability that is not provided by - /// the - /// requirement. / For example: / [require(hlsl,b,c)] / void caller() / { / - /// useD(); - ///// require capability (hlsl,d) / } / In this case we should report that useD() is - /// using a - /// capability that is not declared by caller. - //// - - //// If we reach here, we are case 2. + // The second scenario is when the callee is using a capability that is not provided by the + // requirement. For example: + // [require(hlsl,b,c)] + // void caller() + // { + // useD(); // requires capability (hlsl,d) + // } + // In this case we should report that useD() is using a capability that is not declared by + // caller. If we reach here, we are case 2. We will produce all failed atoms. This is important + // since provenance of multiple atoms can come from multiple referenced items in a function + // body. - // We will produce all failed atoms. This is important since provenance of multiple atoms - // can come from multiple referenced items in a function body. HashSet<Decl*> printedDecls; auto simplifiedFailedAtomsSet = failedAtomsInsideAvailableSet.newSetWithoutImpliedAtoms(); for (auto i : simplifiedFailedAtomsSet) |
