From e6c9625e0f0d5d9703451fd2ebb8b206d210009c Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 28 Feb 2022 18:09:27 -0800 Subject: Use GLSL scalar layout for constant buffers. (#2147) --- source/slang/slang-parameter-binding.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-parameter-binding.cpp') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index abbc010f8..7fbc59dc7 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -678,7 +678,7 @@ RefPtr getTypeLayoutForGlobalShaderParameter( // An "ordinary" global variable is implicitly a uniform // shader parameter. return createTypeLayout( - layoutContext.with(rules->getConstantBufferRules()), + layoutContext.with(rules->getConstantBufferRules(context->getTargetRequest())), type); } @@ -2080,7 +2080,8 @@ static RefPtr computeEntryPointParameterTypeLayout( // constant buffer (e.g., the `$Params` constant buffer seen in fxc/dxc output). // return createTypeLayout( - context->layoutContext.with(context->getRulesFamily()->getConstantBufferRules()), + context->layoutContext.with( + context->getRulesFamily()->getConstantBufferRules(context->getTargetRequest())), paramType); } else @@ -2431,7 +2432,9 @@ static ParameterBindingAndKindInfo maybeAllocateConstantBufferBinding( UInt space = context->shared->defaultSpace; auto usedRangeSet = findUsedRangeSetForSpace(context, space); - auto layoutInfo = context->getRulesFamily()->getConstantBufferRules()->GetObjectLayout( + auto layoutInfo = context->getRulesFamily() + ->getConstantBufferRules(context->getTargetRequest()) + ->GetObjectLayout( ShaderParameterKind::ConstantBuffer); ParameterBindingAndKindInfo info; -- cgit v1.2.3