mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Expose Vulkan depth clip range in the UI
This change exposes the VkPipelineViewportDepthClipControlCreateInfoEXT::negativeOneToOne pipeline state in the UI. While not a per-viewport state, this state is output alongside viewport information. If the extension is not used, or if this flag is false, [0, 1] is shown as the depth clip range. If the flag is true, [-1, 1] is shown.
This commit is contained in:
committed by
Baldur Karlsson
parent
390e610687
commit
75c1d37a45
@@ -332,9 +332,9 @@ VulkanPipelineStateViewer::VulkanPipelineStateViewer(ICaptureContext &ctx,
|
||||
RDHeaderView *header = new RDHeaderView(Qt::Horizontal, this);
|
||||
ui->viewports->setHeader(header);
|
||||
|
||||
ui->viewports->setColumns(
|
||||
{tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"), tr("MinDepth"), tr("MaxDepth")});
|
||||
header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, 1});
|
||||
ui->viewports->setColumns({tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"),
|
||||
tr("MinDepth"), tr("MaxDepth"), tr("NDCDepthRange")});
|
||||
header->setColumnStretchHints({-1, -1, -1, -1, -1, -1, -1, 1});
|
||||
header->setMinimumSectionSize(40);
|
||||
|
||||
ui->viewports->setClearSelectionOnFocusLoss(true);
|
||||
@@ -2430,11 +2430,14 @@ void VulkanPipelineStateViewer::setState()
|
||||
}
|
||||
|
||||
{
|
||||
const QString ndcDepthRange =
|
||||
state.viewportScissor.depthNegativeOneToOne ? lit("[-1, 1]") : lit("[0, 1]");
|
||||
|
||||
int i = 0;
|
||||
for(const VKPipe::ViewportScissor &v : state.viewportScissor.viewportScissors)
|
||||
{
|
||||
RDTreeWidgetItem *node = new RDTreeWidgetItem(
|
||||
{i, v.vp.x, v.vp.y, v.vp.width, v.vp.height, v.vp.minDepth, v.vp.maxDepth});
|
||||
RDTreeWidgetItem *node = new RDTreeWidgetItem({i, v.vp.x, v.vp.y, v.vp.width, v.vp.height,
|
||||
v.vp.minDepth, v.vp.maxDepth, ndcDepthRange});
|
||||
ui->viewports->addTopLevelItem(node);
|
||||
|
||||
if(v.vp.width == 0 || v.vp.height == 0)
|
||||
@@ -3880,6 +3883,8 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
|
||||
xml.writeCharacters(tr("Viewports"));
|
||||
xml.writeEndElement();
|
||||
|
||||
const QString ndcDepthRange = vp.depthNegativeOneToOne ? lit("[-1, 1]") : lit("[0, 1]");
|
||||
|
||||
QList<QVariantList> rows;
|
||||
|
||||
int i = 0;
|
||||
@@ -3887,14 +3892,14 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
|
||||
{
|
||||
const Viewport &v = vs.vp;
|
||||
|
||||
rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth});
|
||||
rows.push_back({i, v.x, v.y, v.width, v.height, v.minDepth, v.maxDepth, ndcDepthRange});
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
m_Common.exportHTMLTable(xml, {tr("Slot"), tr("X"), tr("Y"), tr("Width"), tr("Height"),
|
||||
tr("Min Depth"), tr("Max Depth")},
|
||||
rows);
|
||||
QStringList header = {tr("Slot"), tr("X"), tr("Y"), tr("Width"),
|
||||
tr("Height"), tr("Min Depth"), tr("Max Depth"), tr("NDC Depth Range")};
|
||||
m_Common.exportHTMLTable(xml, header, rows);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -781,6 +781,9 @@ and a fragment in none of them is discarded.
|
||||
disabled, since with no rectangles no fragment can be inside one.
|
||||
)");
|
||||
bool discardRectanglesExclusive = true;
|
||||
|
||||
DOCUMENT(R"(Whether depth clip range is set to [-1, 1] through VK_EXT_depth_clip_control.)");
|
||||
bool depthNegativeOneToOne = false;
|
||||
};
|
||||
|
||||
DOCUMENT("Describes the rasterizer state in the pipeline.");
|
||||
|
||||
@@ -1362,6 +1362,10 @@ void VulkanReplay::SavePipelineState(uint32_t eventId)
|
||||
(p.discardMode == VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT);
|
||||
}
|
||||
|
||||
{
|
||||
ret.viewportScissor.depthNegativeOneToOne = p.negativeOneToOne;
|
||||
}
|
||||
|
||||
// Rasterizer
|
||||
ret.rasterizer.depthClampEnable = p.depthClampEnable;
|
||||
ret.rasterizer.depthClipEnable = p.depthClipEnable;
|
||||
@@ -1565,6 +1569,7 @@ void VulkanReplay::SavePipelineState(uint32_t eventId)
|
||||
ret.viewportScissor.viewportScissors.clear();
|
||||
ret.viewportScissor.discardRectangles.clear();
|
||||
ret.viewportScissor.discardRectanglesExclusive = true;
|
||||
ret.viewportScissor.depthNegativeOneToOne = false;
|
||||
|
||||
ret.colorBlend.blends.clear();
|
||||
}
|
||||
|
||||
@@ -2130,6 +2130,7 @@ void DoSerialise(SerialiserType &ser, VKPipe::ViewState &el)
|
||||
SERIALISE_MEMBER(viewportScissors);
|
||||
SERIALISE_MEMBER(discardRectangles);
|
||||
SERIALISE_MEMBER(discardRectanglesExclusive);
|
||||
SERIALISE_MEMBER(depthNegativeOneToOne);
|
||||
|
||||
SIZE_CHECK(56);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user