From 23c65b873f8002b74d60f61cacb3614da60e078d Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 5 Feb 2024 22:36:02 -0800 Subject: Add per-buffer data layout control. (#3551) * Add per-buffer data layout control. Fixes #3534. * Fixes. * Robustness. * Update test. * Fix. --- source/slang/slang-ir-lower-append-consume-structured-buffer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-lower-append-consume-structured-buffer.cpp') diff --git a/source/slang/slang-ir-lower-append-consume-structured-buffer.cpp b/source/slang/slang-ir-lower-append-consume-structured-buffer.cpp index 5a7c7ee1c..1d4f10bb9 100644 --- a/source/slang/slang-ir-lower-append-consume-structured-buffer.cpp +++ b/source/slang/slang-ir-lower-append-consume-structured-buffer.cpp @@ -33,8 +33,12 @@ namespace Slang builder.addDecoration(elementBufferKey, kIROp_CounterBufferDecoration, counterBufferKey); - auto elementBufferType = builder.getType(kIROp_HLSLRWStructuredBufferType, elementType); - auto counterBufferType = builder.getType(kIROp_HLSLRWStructuredBufferType, builder.getIntType()); + IRInst* operands[2] = { elementType, type->getDataLayout() }; + auto elementBufferType = builder.getType(kIROp_HLSLRWStructuredBufferType, 2, operands); + + operands[0] = builder.getIntType(); + operands[1] = builder.getType(kIROp_DefaultBufferLayoutType); + auto counterBufferType = builder.getType(kIROp_HLSLRWStructuredBufferType, 2, operands); builder.createStructField(structType, elementBufferKey, elementBufferType); builder.createStructField(structType, counterBufferKey, counterBufferType); -- cgit v1.2.3