From f573c15868234ab6013faf0fc2b93a72fa89f21d Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 11 Dec 2024 03:18:20 -0800 Subject: 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 --- source/slang/slang-emit-spirv.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/slang/slang-emit-spirv.cpp') 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: -- cgit v1.2.3