From efa8d1ab40c24a15678dd4143c9cc7b7b64e04d8 Mon Sep 17 00:00:00 2001 From: dubiousconst282 <87553666+dubiousconst282@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:20:06 -0300 Subject: Add generic descriptor indexing intrinsic (#4389) * Add ResourceArray intrinsic type * Move aliased parameter generation to GLSL legalization * Add DynamicResourceEntry type for proxying layout of GenericResourceArray * Reimplement as DynamicResource * Add reflection test * Don't reuse alias cache between different parameters * Add dynamic cast extensions for buffer types * Minor format fix * Fix VarDecl diagnostics after finding non-appliable initializer candidates --------- Co-authored-by: Yong He --- source/slang/slang-check-decl.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 23c10ddc2..969c87981 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -2037,10 +2037,11 @@ namespace Slang if (overloadContext.bestCandidates[0].status != OverloadCandidate::Status::Applicable) { getShared()->cacheImplicitCastMethod(key, ImplicitCastMethod{}); - return; } - - getSink()->diagnose(varDecl, Diagnostics::ambiguousDefaultInitializerForType, type); + else + { + getSink()->diagnose(varDecl, Diagnostics::ambiguousDefaultInitializerForType, type); + } } else if(overloadContext.bestCandidate) { @@ -2053,16 +2054,17 @@ namespace Slang if (overloadContext.bestCandidate->status != OverloadCandidate::Status::Applicable) { getShared()->cacheImplicitCastMethod(key, ImplicitCastMethod{}); - return; } - - // If we had a single best candidate *and* it was applicable, - // then we use it to construct a new initial-value expression - // for the variable, that will be used for all downstream - // code generation. - // - varDecl->initExpr = CompleteOverloadCandidate(overloadContext, *overloadContext.bestCandidate); - getShared()->cacheImplicitCastMethod(key, ImplicitCastMethod{ *overloadContext.bestCandidate, 0}); + else + { + // If we had a single best candidate *and* it was applicable, + // then we use it to construct a new initial-value expression + // for the variable, that will be used for all downstream + // code generation. + // + varDecl->initExpr = CompleteOverloadCandidate(overloadContext, *overloadContext.bestCandidate); + getShared()->cacheImplicitCastMethod(key, ImplicitCastMethod{*overloadContext.bestCandidate, 0}); + } } } -- cgit v1.2.3