Require explicit debug information to support source debugging

* SPIR-V files currently can have source files, but not source debugging
  information, which is a distinction that didn't exist otherwise.
This commit is contained in:
baldurk
2021-11-02 12:27:42 +00:00
parent 33db9be271
commit de38cf7b9c
3 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -542,10 +542,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
ui->floatView->hide();
}
if(m_ShaderDetails->debugInfo.files.isEmpty())
if(!m_ShaderDetails->debugInfo.sourceDebugInformation)
{
ui->debugToggle->setEnabled(false);
ui->debugToggle->setText(tr("Source Unavailable"));
ui->debugToggle->setText(tr("Source debugging Unavailable"));
}
ui->debugVars->setColumns({tr("Name"), tr("Value")});
+4
View File
@@ -1298,6 +1298,10 @@ functionality
)");
bool debuggable = true;
DOCUMENT(R"(Indicates whether this shader has debug information to allow source-level debugging.
)");
bool sourceDebugInformation = false;
DOCUMENT(R"(If :data:`debuggable` is false then this contains a simple explanation of why the
shader is not supported for debugging
)");
@@ -247,6 +247,8 @@ void MakeShaderReflection(DXBC::DXBCContainer *dxbc, ShaderReflection *refl,
refl->debugInfo.encoding = ShaderEncoding::HLSL;
refl->debugInfo.sourceDebugInformation = true;
refl->debugInfo.compileFlags = dxbc->GetDebugInfo()->GetShaderCompileFlags();
refl->debugInfo.files.resize(dxbc->GetDebugInfo()->Files.size());