mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 02:31:12 +00:00
Try to preserve selected pipeline stage as much as possible
* When switching between mesh/normal pipeline keep the same stage selected if it's a common stage even if the index has changed.
This commit is contained in:
@@ -38,6 +38,15 @@ PipelineFlowChart::~PipelineFlowChart()
|
||||
|
||||
void PipelineFlowChart::setStages(const QStringList &abbrevs, const QStringList &names)
|
||||
{
|
||||
int prev = -1;
|
||||
QString prevAbbrev;
|
||||
|
||||
if(!m_StageNames.empty() && names.count() != m_StageNames.count())
|
||||
{
|
||||
prev = m_SelectedStage;
|
||||
prevAbbrev = m_StageAbbrevs[prev];
|
||||
}
|
||||
|
||||
m_StageNames = names;
|
||||
m_StageAbbrevs = abbrevs;
|
||||
m_StageFlows.reserve(m_StageNames.count());
|
||||
@@ -51,7 +60,41 @@ void PipelineFlowChart::setStages(const QStringList &abbrevs, const QStringList
|
||||
}
|
||||
|
||||
update();
|
||||
setSelectedStage(selectedStage());
|
||||
|
||||
if(prev >= 0)
|
||||
{
|
||||
int exact = m_StageAbbrevs.indexOf(prevAbbrev);
|
||||
|
||||
if(exact >= 0)
|
||||
{
|
||||
setSelectedStage(exact);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is most likely a change between mesh/vertex pipeline, default to either the mesh
|
||||
// shader or vertex shader if we can find it. Fortunately those names are identical
|
||||
int vert = m_StageNames.indexOf(tr("Vertex Shader"));
|
||||
int mesh = m_StageNames.indexOf(tr("Mesh Shader"));
|
||||
|
||||
if(vert >= 0)
|
||||
{
|
||||
setSelectedStage(vert);
|
||||
}
|
||||
else if(mesh >= 0)
|
||||
{
|
||||
setSelectedStage(mesh);
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "Couldn't find default stage when names changed";
|
||||
setSelectedStage(selectedStage());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setSelectedStage(selectedStage());
|
||||
}
|
||||
}
|
||||
|
||||
void PipelineFlowChart::setStageName(int index, const QString &abbrev, const QString &name)
|
||||
|
||||
@@ -1794,6 +1794,8 @@ void VulkanPipelineStateViewer::setState()
|
||||
raster = false;
|
||||
}
|
||||
|
||||
setOldMeshPipeFlow();
|
||||
|
||||
if(state.geometryShader.resourceId == ResourceId() && xfbActive)
|
||||
{
|
||||
ui->pipeFlow->setStageName(4, lit("XFB"), tr("Transform Feedback"));
|
||||
@@ -1803,7 +1805,6 @@ void VulkanPipelineStateViewer::setState()
|
||||
ui->pipeFlow->setStageName(4, lit("GS"), tr("Geometry Shader"));
|
||||
}
|
||||
|
||||
setOldMeshPipeFlow();
|
||||
ui->pipeFlow->setStagesEnabled(
|
||||
{true, true, state.tessControlShader.resourceId != ResourceId(),
|
||||
state.tessEvalShader.resourceId != ResourceId(),
|
||||
|
||||
Reference in New Issue
Block a user