From 6cee1eeda28c1ce1e5d326a0c43427b4776a1d09 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 8 Jun 2021 07:44:05 -0700 Subject: Various fixes to CUDA backend. (#1877) - Fix emitting `StructuredBuffer::Load`, which triggers emitting for `IROp_WrapExistential` that is previously unhandled. - Fix cuda layout around vectors, they should be aligned to 1,2,4,8,16 bytes instead of just using element type's alignment. That means `float4` has alignment of 16 instead of 4. - Fix `SLANG_CUDA_HANDLE_ERROR` macro definition. - Fix navis sometimes fail to find `Slang::kIROp_*` enum values when debugging external projects. Co-authored-by: Yong He Co-authored-by: jsmall-nvidia --- source/slang/slang-emit-c-like.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index 1b0fe7c44..47c584251 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -1794,6 +1794,17 @@ void CLikeSourceEmitter::defaultEmitInstExpr(IRInst* inst, const EmitOpInfo& inO } break; + case kIROp_WrapExistential: + { + // Normally `WrapExistential` shouldn't exist in user code at this point. + // The only exception is when the user is calling a stdlib generic + // function that has an existential type argument, for example + // `StructuredBuffer.Load()`. + // We can safely ignore the `wrapExistential` operation in this case. + emitOperand(inst->getOperand(0), outerPrec); + } + break; + case kIROp_Select: { -- cgit v1.2.3