summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-spirv.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-11 03:18:20 -0800
committerGitHub <noreply@github.com>2024-12-11 11:18:20 +0000
commitf573c15868234ab6013faf0fc2b93a72fa89f21d (patch)
tree500d91ceb22c61af2b4231c5f435c6722c346977 /source/slang/slang-emit-spirv.cpp
parentf68768887b02df5080d35f0f32b035ef67764cd0 (diff)
Fix anyvalue marshalling for matrix and 64 bit types. (#5827)
* Fix anyvalue marshalling for matrix types. * Add support for 64bit types marshalling. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
-rw-r--r--source/slang/slang-emit-spirv.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index f4aa900db..8759ea9d4 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -3285,6 +3285,19 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
return nullptr;
}
+ SpvInst* emitMakeUInt64(SpvInstParent* parent, IRInst* inst)
+ {
+ IRBuilder builder(inst);
+ builder.setInsertBefore(inst);
+ auto vec = emitOpCompositeConstruct(
+ parent,
+ nullptr,
+ builder.getVectorType(builder.getUIntType(), 2),
+ inst->getOperand(0),
+ inst->getOperand(1));
+ return emitOpBitcast(parent, inst, inst->getDataType(), vec);
+ }
+
// The instructions that appear inside the basic blocks of
// functions are what we will call "local" instructions.
//
@@ -3391,6 +3404,9 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
case kIROp_BitCast:
result = emitOpBitcast(parent, inst, inst->getDataType(), inst->getOperand(0));
break;
+ case kIROp_MakeUInt64:
+ result = emitMakeUInt64(parent, inst);
+ break;
case kIROp_Add:
case kIROp_Sub:
case kIROp_Mul: