summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-lower-append-consume-structured-buffer.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-05 22:36:02 -0800
committerGitHub <noreply@github.com>2024-02-05 22:36:02 -0800
commit23c65b873f8002b74d60f61cacb3614da60e078d (patch)
tree9629ffeed059cd67e70d5a98427922697ba46543 /source/slang/slang-ir-lower-append-consume-structured-buffer.cpp
parentaf035fb6da2a19ccc647515e9b1edf35777f8c89 (diff)
Add per-buffer data layout control. (#3551)
* Add per-buffer data layout control. Fixes #3534. * Fixes. * Robustness. * Update test. * Fix.
Diffstat (limited to 'source/slang/slang-ir-lower-append-consume-structured-buffer.cpp')
-rw-r--r--source/slang/slang-ir-lower-append-consume-structured-buffer.cpp8
1 files changed, 6 insertions, 2 deletions
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);