From 9043bc5522cc86560ac5d57ddfc6cfa7612c9222 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 1 May 2024 17:30:55 -0700 Subject: Fix compile failures when using debug symbol. (#4069) * Fix compile failures when using debug symbol. * Various fixes. * Fix intrinsic. * Fix test. --- tools/render-test/slang-support.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/render-test/slang-support.cpp') diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index dd0394fdf..f76e83937 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -120,6 +120,8 @@ void ShaderCompilerUtil::Output::reset() spSetTargetProfile(slangRequest, 0, spFindProfile(out.session, input.profile.getBuffer())); if (options.generateSPIRVDirectly) spSetTargetFlags(slangRequest, 0, SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY); + else + spSetTargetFlags(slangRequest, 0, 0); slangRequest->setAllowGLSLInput(options.allowGLSL); @@ -212,6 +214,14 @@ void ShaderCompilerUtil::Output::reset() spSetLineDirectiveMode(slangRequest, SLANG_LINE_DIRECTIVE_MODE_NONE); } + if (options.generateSPIRVDirectly) + { + if (options.disableDebugInfo) + spSetDebugInfoLevel(slangRequest, SLANG_DEBUG_INFO_LEVEL_NONE); + else + spSetDebugInfoLevel(slangRequest, SLANG_DEBUG_INFO_LEVEL_STANDARD); + } + const SlangResult res = spCompile(slangRequest); if (auto diagnostics = spGetDiagnosticOutput(slangRequest)) -- cgit v1.2.3