From 73a61edda8893901acad05bb4e7d3110db5041a8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 28 Feb 2024 22:57:07 -0800 Subject: [SPIRV] Add NonSemanticDebugInfo for step-through debugging. (#3644) * [SPIRV] Add NonSemanticDebugInfo for step-through debugging. * Fix. * Fix. --- tools/gfx/slang-context.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tools/gfx/slang-context.h') diff --git a/tools/gfx/slang-context.h b/tools/gfx/slang-context.h index 8ae14d4aa..79f39c3e6 100644 --- a/tools/gfx/slang-context.h +++ b/tools/gfx/slang-context.h @@ -10,7 +10,11 @@ namespace gfx public: Slang::ComPtr globalSession; Slang::ComPtr session; - Result initialize(const gfx::IDevice::SlangDesc& desc, SlangCompileTarget compileTarget, const char* defaultProfileName, + Result initialize(const gfx::IDevice::SlangDesc& desc, + uint32_t extendedDescCount, + void** extendedDescs, + SlangCompileTarget compileTarget, + const char* defaultProfileName, Slang::ConstArrayView additionalMacros) { if (desc.slangGlobalSession) @@ -45,6 +49,17 @@ namespace gfx slangSessionDesc.targets = &targetDesc; slangSessionDesc.targetCount = 1; + for (uint32_t i = 0; i < extendedDescCount; i++) + { + if ((*(StructType*)extendedDescs[i]) == StructType::SlangSessionExtendedDesc) + { + auto extDesc = (SlangSessionExtendedDesc*)extendedDescs[i]; + slangSessionDesc.compilerOptionEntryCount = extDesc->compilerOptionEntryCount; + slangSessionDesc.compilerOptionEntries = extDesc->compilerOptionEntries; + break; + } + } + SLANG_RETURN_ON_FAIL(globalSession->createSession(slangSessionDesc, session.writeRef())); return SLANG_OK; } -- cgit v1.2.3