diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-28 22:57:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-28 22:57:07 -0800 |
| commit | 73a61edda8893901acad05bb4e7d3110db5041a8 (patch) | |
| tree | bb6331b28715a4e95fcd7724ad338149ce56e562 /tools/gfx-unit-test/gfx-test-util.cpp | |
| parent | d2644e2f8f0abb73bbd6afd70816f6bf245340da (diff) | |
[SPIRV] Add NonSemanticDebugInfo for step-through debugging. (#3644)
* [SPIRV] Add NonSemanticDebugInfo for step-through debugging.
* Fix.
* Fix.
Diffstat (limited to 'tools/gfx-unit-test/gfx-test-util.cpp')
| -rw-r--r-- | tools/gfx-unit-test/gfx-test-util.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index 748ced5eb..fe06a1745 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -4,7 +4,7 @@ #include <slang-com-ptr.h> #define GFX_ENABLE_RENDERDOC_INTEGRATION 0 - +#define GFX_ENABLE_SPIRV_DEBUG 0 #if GFX_ENABLE_RENDERDOC_INTEGRATION # include "external/renderdoc_app.h" # include <windows.h> @@ -278,10 +278,25 @@ namespace gfx_test gfx::D3D12DeviceExtendedDesc extDesc = {}; extDesc.rootParameterShaderAttributeName = "root"; + + gfx::SlangSessionExtendedDesc slangExtDesc = {}; + Slang::List<slang::CompilerOptionEntry> entries; + slang::CompilerOptionEntry emitSpirvDirectlyEntry; + emitSpirvDirectlyEntry.name = slang::CompilerOptionName::EmitSpirvDirectly; + emitSpirvDirectlyEntry.value.intValue0 = 1; + entries.add(emitSpirvDirectlyEntry); +#if GFX_ENABLE_SPIRV_DEBUG + slang::CompilerOptionEntry debugLevelCompilerOptionEntry; + debugLevelCompilerOptionEntry.name = slang::CompilerOptionName::DebugInformation; + debugLevelCompilerOptionEntry.value.intValue0 = SLANG_DEBUG_INFO_LEVEL_STANDARD; + entries.add(debugLevelCompilerOptionEntry); +#endif + slangExtDesc.compilerOptionEntries = entries.getBuffer(); + slangExtDesc.compilerOptionEntryCount = (uint32_t)entries.getCount(); - deviceDesc.extendedDescCount = 1; - void* extDescPtr = &extDesc; - deviceDesc.extendedDescs = &extDescPtr; + deviceDesc.extendedDescCount = 2; + void* extDescPtrs[2] = { &extDesc, &slangExtDesc }; + deviceDesc.extendedDescs = extDescPtrs; // TODO: We should also set the debug callback // (And in general reduce the differences (and duplication) between |
