mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-15 02:56:50 +00:00
Display conditional rendering state for compute shader
If conditional rendering is enabled its state is always displayed in both 'Rasterizer' and 'CS' states. Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
This commit is contained in:
committed by
Baldur Karlsson
parent
c16371d779
commit
11fa2294d7
@@ -120,6 +120,10 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx,
|
||||
ui->gsShaderSaveButton, ui->fsShaderSaveButton, ui->csShaderSaveButton,
|
||||
};
|
||||
|
||||
QToolButton *viewPredicateBufferButtons[] = {
|
||||
ui->predicateBufferViewButton, ui->csPredicateBufferViewButton,
|
||||
};
|
||||
|
||||
RDTreeWidget *resources[] = {
|
||||
ui->vsResources, ui->tcsResources, ui->tesResources,
|
||||
ui->gsResources, ui->fsResources, ui->csResources,
|
||||
@@ -146,6 +150,10 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx,
|
||||
for(QToolButton *b : saveButtons)
|
||||
QObject::connect(b, &QToolButton::clicked, this, &VulkanPipelineStateViewer::shaderSave_clicked);
|
||||
|
||||
for(QToolButton *b : viewPredicateBufferButtons)
|
||||
QObject::connect(b, &QToolButton::clicked, this,
|
||||
&VulkanPipelineStateViewer::predicateBufferView_clicked);
|
||||
|
||||
QObject::connect(ui->viAttrs, &RDTreeWidget::leave, this, &VulkanPipelineStateViewer::vertex_leave);
|
||||
QObject::connect(ui->viBuffers, &RDTreeWidget::leave, this,
|
||||
&VulkanPipelineStateViewer::vertex_leave);
|
||||
@@ -276,7 +284,7 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx,
|
||||
ui->scissors->setInstantTooltips(true);
|
||||
}
|
||||
|
||||
for(RDLabel *rp : {ui->renderpass, ui->framebuffer, ui->predicateBuffer})
|
||||
for(RDLabel *rp : {ui->renderpass, ui->framebuffer, ui->predicateBuffer, ui->csPredicateBuffer})
|
||||
{
|
||||
rp->setAutoFillBackground(true);
|
||||
rp->setBackgroundRole(QPalette::ToolTipBase);
|
||||
@@ -654,6 +662,7 @@ void VulkanPipelineStateViewer::clearState()
|
||||
ui->stencils->clear();
|
||||
|
||||
ui->conditionalRenderingGroup->setVisible(false);
|
||||
ui->csConditionalRenderingGroup->setVisible(false);
|
||||
}
|
||||
|
||||
QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, const QString &slotname,
|
||||
@@ -2038,6 +2047,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
if(state.conditionalRendering.bufferId == ResourceId())
|
||||
{
|
||||
ui->conditionalRenderingGroup->setVisible(false);
|
||||
ui->csConditionalRenderingGroup->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2047,6 +2057,13 @@ void VulkanPipelineStateViewer::setState()
|
||||
.arg(state.conditionalRendering.byteOffset));
|
||||
ui->predicatePassing->setPixmap(state.conditionalRendering.isPassing ? tick : cross);
|
||||
ui->predicateInverted->setPixmap(state.conditionalRendering.isInverted ? tick : cross);
|
||||
|
||||
ui->csConditionalRenderingGroup->setVisible(true);
|
||||
ui->csPredicateBuffer->setText(QFormatStr("%1 (Byte Offset %2)")
|
||||
.arg(ToQStr(state.conditionalRendering.bufferId))
|
||||
.arg(state.conditionalRendering.byteOffset));
|
||||
ui->csPredicatePassing->setPixmap(state.conditionalRendering.isPassing ? tick : cross);
|
||||
ui->csPredicateInverted->setPixmap(state.conditionalRendering.isInverted ? tick : cross);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
@@ -2642,6 +2659,15 @@ void VulkanPipelineStateViewer::shaderSave_clicked()
|
||||
m_Common.SaveShaderFile(shaderDetails);
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::predicateBufferView_clicked()
|
||||
{
|
||||
const VKPipe::ConditionalRendering &cr = m_Ctx.CurVulkanPipelineState()->conditionalRendering;
|
||||
|
||||
IBufferViewer *viewer = m_Ctx.ViewBuffer(cr.byteOffset, sizeof(uint32_t), cr.bufferId, "uint");
|
||||
|
||||
m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::VertexInput &vi)
|
||||
{
|
||||
{
|
||||
@@ -3501,7 +3527,10 @@ void VulkanPipelineStateViewer::on_exportHTML_clicked()
|
||||
xml.writeEndElement();
|
||||
exportHTML(xml, m_Ctx.CurVulkanPipelineState()->currentPass);
|
||||
break;
|
||||
case 8: exportHTML(xml, m_Ctx.CurVulkanPipelineState()->computeShader); break;
|
||||
case 8:
|
||||
exportHTML(xml, m_Ctx.CurVulkanPipelineState()->computeShader);
|
||||
exportHTML(xml, m_Ctx.CurVulkanPipelineState()->conditionalRendering);
|
||||
break;
|
||||
}
|
||||
|
||||
xml.writeEndElement();
|
||||
@@ -3518,13 +3547,4 @@ void VulkanPipelineStateViewer::on_meshView_clicked()
|
||||
if(!m_Ctx.HasMeshPreview())
|
||||
m_Ctx.ShowMeshPreview();
|
||||
ToolWindowManager::raiseToolWindow(m_Ctx.GetMeshPreview()->Widget());
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::on_predicateBufferView_clicked()
|
||||
{
|
||||
const VKPipe::ConditionalRendering &cr = m_Ctx.CurVulkanPipelineState()->conditionalRendering;
|
||||
|
||||
IBufferViewer *viewer = m_Ctx.ViewBuffer(cr.byteOffset, sizeof(uint32_t), cr.bufferId, "uint");
|
||||
|
||||
m_Ctx.AddDockWindow(viewer->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
@@ -66,7 +66,6 @@ private slots:
|
||||
void on_showEmpty_toggled(bool checked);
|
||||
void on_exportHTML_clicked();
|
||||
void on_meshView_clicked();
|
||||
void on_predicateBufferView_clicked();
|
||||
void on_viAttrs_itemActivated(RDTreeWidgetItem *item, int column);
|
||||
void on_viBuffers_itemActivated(RDTreeWidgetItem *item, int column);
|
||||
void on_viAttrs_mouseMove(QMouseEvent *event);
|
||||
@@ -77,6 +76,7 @@ private slots:
|
||||
void shaderView_clicked();
|
||||
|
||||
void shaderSave_clicked();
|
||||
void predicateBufferView_clicked();
|
||||
void resource_itemActivated(RDTreeWidgetItem *item, int column);
|
||||
void ubo_itemActivated(RDTreeWidgetItem *item, int column);
|
||||
void vertex_leave(QEvent *e);
|
||||
|
||||
@@ -1843,7 +1843,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="predicateBufferView">
|
||||
<widget class="QToolButton" name="predicateBufferViewButton">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
@@ -3463,6 +3463,81 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="csConditionalRenderingGroup">
|
||||
<property name="title">
|
||||
<string>Conditional Rendering</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_43">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Passing:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="csPredicatePassing"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Inverted:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="csPredicateInverted"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="RDLabel" name="csPredicateBuffer">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="csPredicateBufferViewButton">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Predicate Buffer</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../Resources/resources.qrc">
|
||||
<normaloff>:/action.png</normaloff>:/action.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="csScroll">
|
||||
<property name="frameShape">
|
||||
|
||||
Reference in New Issue
Block a user