summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-parameter-binding.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-07 14:26:37 -0700
committerGitHub <noreply@github.com>2023-07-07 14:26:37 -0700
commit643aaa13d2c6e0c4994437aa9fba6716787608ce (patch)
tree279794cfafecc89f0be133d2a81750d59d9ee94a /source/slang/slang-parameter-binding.cpp
parentfb6605c2a7bc17d3b3b79dabd07e1f05267eb33a (diff)
Make DeclRefBase a Val, and DeclRef<T> a helper class. (#2967)
* Make DeclRefBase a Val, and DeclRef<T> a helper class. * Fixes. * Workaround gcc parser issue. * Revert NodeOperand change. * Fix. * Fix clang incomplete class complains. * Fix code review. * Small cleanups and improvements. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
-rw-r--r--source/slang/slang-parameter-binding.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp
index 4679e58c3..e22bc0597 100644
--- a/source/slang/slang-parameter-binding.cpp
+++ b/source/slang/slang-parameter-binding.cpp
@@ -960,7 +960,7 @@ static void addExplicitParameterBindings_HLSL(
// TODO: warning here!
}
- addExplicitParameterBinding(context, parameterInfo, varDecl, semanticInfo, count);
+ addExplicitParameterBinding(context, parameterInfo, varDecl.getDecl(), semanticInfo, count);
}
}
@@ -1048,7 +1048,7 @@ static void addExplicitParameterBindings_GLSL(
auto count = resInfo->count;
semanticInfo.kind = kind;
- addExplicitParameterBinding(context, parameterInfo, varDecl, semanticInfo, count);
+ addExplicitParameterBinding(context, parameterInfo, varDecl.getDecl(), semanticInfo, count);
return;
}
@@ -1071,7 +1071,7 @@ static void addExplicitParameterBindings_GLSL(
//
// TODO(JS): I suppose there is some ambiguity here, because if we did a semantic lookup, and it didn't have a vulkanKind
// or didn't parse correctly we wouldn't issue this message.
- getSink(context)->diagnose(varDecl, Diagnostics::cannotInferVulkanBindingWithoutRegisterModifier, varDecl);
+ getSink(context)->diagnose(varDecl.getDecl(), Diagnostics::cannotInferVulkanBindingWithoutRegisterModifier, varDecl);
return;
}
@@ -1098,7 +1098,7 @@ static void addExplicitParameterBindings_GLSL(
{
// If we made it here, there are shift options, but there isn't one for the space/kind specified
// That could be a problem and unexpected, so issue a warning
- getSink(context)->diagnose(varDecl, Diagnostics::hlslToVulkanMappingNotFound, varDecl);
+ getSink(context)->diagnose(varDecl.getDecl(), Diagnostics::hlslToVulkanMappingNotFound, varDecl);
return;
}
@@ -1111,7 +1111,7 @@ static void addExplicitParameterBindings_GLSL(
const LayoutSize count = resInfo->count;
- addExplicitParameterBinding(context, parameterInfo, varDecl, semanticInfo, count);
+ addExplicitParameterBinding(context, parameterInfo, varDecl.getDecl(), semanticInfo, count);
}
// Given a single parameter, collect whatever information we have on
@@ -2071,7 +2071,7 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
auto fieldResInfo = fieldVarLayout->FindResourceInfo(kind);
if( !fieldResInfo )
{
- if(!firstImplicit) firstImplicit = field;
+ if(!firstImplicit) firstImplicit = field.getDecl();
// In the implicit-layout case, we assign the field
// the next available offset after the fields that
@@ -2083,7 +2083,7 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
}
else
{
- if(!firstExplicit) firstExplicit = field;
+ if(!firstExplicit) firstExplicit = field.getDecl();
// In the explicit case, the field already has offset
// information, and we just need to update the computed
@@ -2108,7 +2108,7 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
if( auto concreteType = findGlobalGenericSpecializationArg(
layoutContext,
- globalGenericParamDecl) )
+ globalGenericParamDecl.getDecl()) )
{
// If we know what concrete type has been used to specialize
// the global generic type parameter, then we should use
@@ -2134,7 +2134,7 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
// to the generic type, since we can't know how many "slots"
// of varying input/output it would consume.
//
- return createTypeLayoutForGlobalGenericTypeParam(layoutContext, type, globalGenericParamDecl);
+ return createTypeLayoutForGlobalGenericTypeParam(layoutContext, type, globalGenericParamDecl.getDecl());
}
}
else if (auto associatedTypeParam = declRef.as<AssocTypeDecl>())
@@ -2726,7 +2726,7 @@ static RefPtr<EntryPointLayout> collectEntryPointParameters(
// Any generic specialization applied to the entry-point function
// must also be applied to its parameters.
- paramDeclRef.substitutions = entryPointFuncDeclRef.substitutions;
+ paramDeclRef = context->getASTBuilder()->getSpecializedDeclRef(paramDeclRef.getDecl(), entryPointFuncDeclRef.getSubst());
// When computing layout for an entry-point parameter,
// we want to make sure that the layout context has access
@@ -3782,7 +3782,7 @@ RefPtr<ProgramLayout> generateParameterBindings(
if( varLayout->typeLayout->FindResourceInfo(LayoutResourceKind::Uniform) )
{
needDefaultConstantBuffer = true;
- diagnoseGlobalUniform(&sharedContext, varLayout->varDecl);
+ diagnoseGlobalUniform(&sharedContext, varLayout->varDecl.getDecl());
}
}
}