mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Build shaders with debug info when self-capturing
This commit is contained in:
@@ -118,7 +118,11 @@ rdcstr rdcspv::Compile(const rdcspv::CompilationSettings &settings, const rdcarr
|
||||
|
||||
glslang::SpvOptions opts;
|
||||
if(settings.debugInfo)
|
||||
{
|
||||
opts.generateDebugInfo = true;
|
||||
opts.emitNonSemanticShaderDebugInfo = true;
|
||||
opts.emitNonSemanticShaderDebugSource = true;
|
||||
}
|
||||
|
||||
std::vector<uint32_t> spirvVec;
|
||||
glslang::GlslangToSpv(*intermediate, spirvVec, &opts);
|
||||
|
||||
@@ -274,6 +274,26 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
|
||||
rdcspv::CompilationSettings compileSettings;
|
||||
compileSettings.lang = rdcspv::InputLanguage::VulkanGLSL;
|
||||
|
||||
uint32_t toolCount = 0;
|
||||
if(ObjDisp(driver->GetPhysDev())->GetPhysicalDeviceToolProperties != NULL)
|
||||
{
|
||||
ObjDisp(driver->GetPhysDev())
|
||||
->GetPhysicalDeviceToolProperties(Unwrap(driver->GetPhysDev()), &toolCount, NULL);
|
||||
rdcarray<VkPhysicalDeviceToolProperties> tools;
|
||||
tools.resize(toolCount);
|
||||
ObjDisp(driver->GetPhysDev())
|
||||
->GetPhysicalDeviceToolProperties(Unwrap(driver->GetPhysDev()), &toolCount, tools.data());
|
||||
|
||||
for(const VkPhysicalDeviceToolProperties &t : tools)
|
||||
{
|
||||
if(rdcstr(t.name) == "RenderDoc")
|
||||
{
|
||||
RDCLOG("Enabling debug info for self-captured shaders");
|
||||
compileSettings.debugInfo = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_Buffer2MSSupported = PassesChecks(builtinShaders[(size_t)BuiltinShader::Buffer2MSCS], driver,
|
||||
driverVersion, availFeatures);
|
||||
|
||||
@@ -325,6 +345,9 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
|
||||
// source & defines.
|
||||
inputHash = strhash("inputHashVersion1", inputHash);
|
||||
|
||||
if(compileSettings.debugInfo)
|
||||
inputHash = strhash("debug", inputHash);
|
||||
|
||||
rdcstr err;
|
||||
|
||||
if(m_ShaderCache.find(inputHash) != m_ShaderCache.end())
|
||||
|
||||
Reference in New Issue
Block a user