summaryrefslogtreecommitdiff
path: root/tools/gfx/slang-context.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-28 22:57:07 -0800
committerGitHub <noreply@github.com>2024-02-28 22:57:07 -0800
commit73a61edda8893901acad05bb4e7d3110db5041a8 (patch)
treebb6331b28715a4e95fcd7724ad338149ce56e562 /tools/gfx/slang-context.h
parentd2644e2f8f0abb73bbd6afd70816f6bf245340da (diff)
[SPIRV] Add NonSemanticDebugInfo for step-through debugging. (#3644)
* [SPIRV] Add NonSemanticDebugInfo for step-through debugging. * Fix. * Fix.
Diffstat (limited to 'tools/gfx/slang-context.h')
-rw-r--r--tools/gfx/slang-context.h17
1 files changed, 16 insertions, 1 deletions
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<slang::IGlobalSession> globalSession;
Slang::ComPtr<slang::ISession> 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<slang::PreprocessorMacroDesc> 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;
}