Prevent debugging graphics stages if no drawcall is selected

This commit is contained in:
baldurk
2020-06-29 18:34:07 +01:00
parent e68719b5f6
commit dfc82b3bd2
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -2290,6 +2290,10 @@ void BufferViewer::stageRowMenu(MeshDataStage stage, QMenu *menu, const QPoint &
{
m_DebugVert->setToolTip(tr("This API does not support shader debugging"));
}
else if(!m_Ctx.CurDrawcall() || !(m_Ctx.CurDrawcall()->flags & DrawFlags::Drawcall))
{
m_DebugVert->setToolTip(tr("No draw call selected"));
}
else if(!shaderDetails)
{
m_DebugVert->setToolTip(tr("No vertex shader bound"));
+6 -1
View File
@@ -507,7 +507,12 @@ void TextureViewer::UI_UpdateCachedTexture()
const ShaderReflection *shaderDetails =
m_Ctx.CurPipelineState().GetShaderReflection(ShaderStage::Pixel);
if(!shaderDetails)
if(!m_Ctx.CurDrawcall() || !(m_Ctx.CurDrawcall()->flags & DrawFlags::Drawcall))
{
ui->debugPixelContext->setEnabled(false);
ui->debugPixelContext->setToolTip(tr("No draw call selected"));
}
else if(!shaderDetails)
{
ui->debugPixelContext->setEnabled(false);
ui->debugPixelContext->setToolTip(tr("No pixel shader bound"));