summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
author16-Bit-Dog <67922228+16-Bit-Dog@users.noreply.github.com>2025-04-28 23:06:16 -0400
committerGitHub <noreply@github.com>2025-04-29 03:06:16 +0000
commitb02771f235909fb9399bd3969dbea0d4115ae016 (patch)
tree05ce0c3e7de1a7bfc6d7e8e3e75602c50a816bce /source
parentc39c29bf4c52a85d7c83cc8b66ae45e265f9e078 (diff)
Support use of `this` with Mesh Shader Outputs (`IRMeshOutputRef`) (#6920)
* Support `this` use of `IRMeshOutputRef` * Fix SPIR-V val error There was a type mismatch causing a spir-v failiure: `store(var, var)` instead of `store(var, load(var))`
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-glsl-legalize.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-ir-glsl-legalize.cpp b/source/slang/slang-ir-glsl-legalize.cpp
index 729802f4e..1223ea91c 100644
--- a/source/slang/slang-ir-glsl-legalize.cpp
+++ b/source/slang/slang-ir-glsl-legalize.cpp
@@ -2810,6 +2810,16 @@ static void legalizeMeshOutputParam(
builder->setInsertAfter(c);
assign(builder, d, ScalarizedVal::value(builder->emitLoad(tmp)));
}
+ else if (const auto load = as<IRLoad>(s))
+ {
+ // Handles the case where a `this` points to a IRMeshOutputRef.
+ auto t = as<IRPtrType>(load->getPtr()->getDataType())->getValueType();
+ auto tmp = builder->emitVar(t);
+ assign(builder, ScalarizedVal::address(tmp), d);
+
+ s->replaceUsesWith(builder->emitLoad(tmp));
+ s->removeAndDeallocate();
+ }
else if (const auto swiz = as<IRSwizzledStore>(s))
{
SLANG_UNEXPECTED("Swizzled store to a non-address ScalarizedVal");