summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-15 13:01:31 -0700
committerGitHub <noreply@github.com>2023-08-15 13:01:31 -0700
commite34b005c47d265105e7bba509cadaa3e225237af (patch)
tree6b31e951eba7080526db2247ca05124967ab8e5b /source/slang
parent134f27df2695de086472ce70b1197b622fabc147 (diff)
Fix ByteAddressBuffer array legalization. (#3106)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-ir-byte-address-legalize.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-ir-byte-address-legalize.cpp b/source/slang/slang-ir-byte-address-legalize.cpp
index a6d0acee7..b3260c8c7 100644
--- a/source/slang/slang-ir-byte-address-legalize.cpp
+++ b/source/slang/slang-ir-byte-address-legalize.cpp
@@ -74,6 +74,8 @@ struct ByteAddressBufferLegalizationContext
void processGetEquivalentStructuredBuffer(IRInst* inst)
{
+ m_builder.setInsertBefore(inst);
+
// We need to see what type it is to be interpreted as.
auto type = inst->getDataType();
@@ -83,7 +85,6 @@ struct ByteAddressBufferLegalizationContext
// The buffer is operand 0
auto buffer = inst->getOperand(0);
-
// Get the equivalent structured buffer for the buffer.
if( auto structuredBuffer = getEquivalentStructuredBuffer(elementType, buffer) )
{