summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-hlsl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-hlsl.cpp')
-rw-r--r--source/slang/slang-emit-hlsl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp
index 72b2a08b0..04f5bd643 100644
--- a/source/slang/slang-emit-hlsl.cpp
+++ b/source/slang/slang-emit-hlsl.cpp
@@ -191,8 +191,10 @@ void HLSLSourceEmitter::_emitHLSLParameterGroupFieldLayoutSemantics(IRVarLayout*
void HLSLSourceEmitter::_emitHLSLParameterGroup(IRGlobalParam* varDecl, IRUniformParameterGroupType* type)
{
+ LayoutResourceKind layoutResourceKind = LayoutResourceKind::ConstantBuffer;
if (as<IRTextureBufferType>(type))
{
+ layoutResourceKind = LayoutResourceKind::ShaderResource;
m_writer->emit("tbuffer ");
}
else
@@ -218,7 +220,7 @@ void HLSLSourceEmitter::_emitHLSLParameterGroup(IRGlobalParam* varDecl, IRUnifor
typeLayout = parameterGroupTypeLayout->getElementVarLayout()->getTypeLayout();
}
- _emitHLSLRegisterSemantic(LayoutResourceKind::ConstantBuffer, &containerChain, varDecl);
+ _emitHLSLRegisterSemantic(layoutResourceKind, &containerChain, varDecl);
auto elementType = type->getElementType();
if (shouldForceUnpackConstantBufferElements(type) || hasExplicitConstantBufferOffset(type))