Skip to content

Commit 1908392

Browse files
authored
Fix loading empty structs from structured buffers (#6439)
Closes #5751
1 parent f90a763 commit 1908392

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/slang/slang-ir-legalize-types.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,12 @@ static LegalVal legalizeInst(
21492149
// This case should only happen when compiling for a target that does not support
21502150
// GpuForeach
21512151
return LegalVal();
2152+
case kIROp_StructuredBufferLoad:
2153+
// empty types are removed, so we need to make sure that we're still
2154+
// loading a none type when we try and load from a to-be-optimized
2155+
// out structured buffer
2156+
SLANG_ASSERT(type.flavor == LegalType::Flavor::none);
2157+
return LegalVal();
21522158
default:
21532159
// TODO: produce a user-visible diagnostic here
21542160
SLANG_UNEXPECTED("non-simple operand(s)!");

0 commit comments

Comments
 (0)