From 313677160a186efebf83fab4df7d08dd119a5cd2 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Thu, 5 Sep 2024 14:59:28 -0400 Subject: Initial -embed-spirv support (#4974) * Initial -embed-spirv support Add support for SPIR-V precompilation using the framework established for DXIL. Work on #4883 * SLANG_UNUSED * Add linkage attributes to exported spirv functions * Combine DXIL and SPIRV paths * Whitespace fix * Merge remaining precompiled spirv/dxil paths * Change inst accessors to return codegentarget * Add unit test for precompiled spirv --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index d02c01105..9305d1783 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3863,11 +3863,11 @@ namespace Slang return nullptr; } - IRInst* IRBuilder::emitEmbeddedDXIL(ISlangBlob *blob) + IRInst* IRBuilder::emitEmbeddedDownstreamIR(CodeGenTarget target, ISlangBlob *blob) { - IRInst* args[] = { getBlobValue(blob) }; + IRInst* args[] = { getIntValue(getIntType(), (int)target), getBlobValue(blob) }; - return emitIntrinsicInst(getVoidType(), kIROp_EmbeddedDXIL, 1, args); + return emitIntrinsicInst(getVoidType(), kIROp_EmbeddedDownstreamIR, 2, args); } enum class TypeCastStyle -- cgit v1.2.3