Skip to content

Commit

Permalink
Display push descriptor sets in vulkan pipeline state viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Apr 10, 2024
1 parent 0284d55 commit 12a17b1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
48 changes: 42 additions & 6 deletions qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,10 @@ void VulkanPipelineStateViewer::addResourceRow(const ShaderResource *shaderRes,
}
else if(shaderRes)
{
slotname =
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname +=
QFormatStr("Set %1, %2").arg(shaderRes->fixedBindSetOrSpace).arg(shaderRes->fixedBindNumber);

if(!shaderRes->name.empty())
Expand All @@ -1193,7 +1196,10 @@ void VulkanPipelineStateViewer::addResourceRow(const ShaderResource *shaderRes,
}
else if(shaderSamp)
{
slotname =
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname +=
QFormatStr("Set %1, %2").arg(shaderSamp->fixedBindSetOrSpace).arg(shaderSamp->fixedBindNumber);

if(!shaderSamp->name.empty())
Expand Down Expand Up @@ -1507,7 +1513,10 @@ void VulkanPipelineStateViewer::addConstantBlockRow(const ConstantBlock *cblock,
}
else if(cblock)
{
slotname =
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname +=
QFormatStr("Set %1, %2").arg(cblock->fixedBindSetOrSpace).arg(cblock->fixedBindNumber);

if(!cblock->name.empty())
Expand Down Expand Up @@ -3076,6 +3085,24 @@ void VulkanPipelineStateViewer::highlightIABind(int slot)
ui->viBuffers->endUpdate();
}

bool VulkanPipelineStateViewer::IsPushSet(ShaderStage stage, ResourceId id)
{
if(stage == ShaderStage::Compute)
{
for(const VKPipe::DescriptorSet &set : m_Ctx.CurVulkanPipelineState()->compute.descriptorSets)
if(set.descriptorSetResourceId == id)
return set.pushDescriptor;
}
else
{
for(const VKPipe::DescriptorSet &set : m_Ctx.CurVulkanPipelineState()->graphics.descriptorSets)
if(set.descriptorSetResourceId == id)
return set.pushDescriptor;
}

return false;
}

void VulkanPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e)
{
if(!m_Ctx.IsCaptureLoaded())
Expand Down Expand Up @@ -3441,7 +3468,10 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
continue;
}

slotname = QFormatStr("Set %1, %2").arg(b.fixedBindSetOrSpace).arg(b.fixedBindNumber);
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname += QFormatStr("Set %1, %2").arg(b.fixedBindSetOrSpace).arg(b.fixedBindNumber);

if(!b.name.empty())
slotname += lit(": ") + b.name;
Expand Down Expand Up @@ -3601,7 +3631,10 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
}
else if(shaderSamp)
{
slotname =
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname +=
QFormatStr("Set %1, %2").arg(shaderSamp->fixedBindSetOrSpace).arg(shaderSamp->fixedBindNumber);

if(!shaderSamp->name.empty())
Expand Down Expand Up @@ -4157,7 +4190,10 @@ const ShaderResource *VulkanPipelineStateViewer::exportDescriptorHTML(const Used
}
else if(shaderRes)
{
slotname =
if(IsPushSet(used.access.stage, used.access.descriptorStore))
slotname = tr("Push ");

slotname +=
QFormatStr("Set %1, %2").arg(shaderRes->fixedBindSetOrSpace).arg(shaderRes->fixedBindNumber);

if(!shaderRes->name.empty())
Expand Down
3 changes: 3 additions & 0 deletions qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ private slots:
void setEmptyRow(RDTreeWidgetItem *node);
void highlightIABind(int slot);

bool IsPushSet(ShaderStage stage, ResourceId id);

uint32_t getMinOffset(const rdcarray<ShaderConstant> &variables);

QString formatByteRange(const BufferDescription *buf, const Descriptor &descriptor,
uint32_t dynamicOffset);
QString formatMembers(int indent, const QString &nameprefix, const rdcarray<ShaderConstant> &vars);
Expand Down

0 comments on commit 12a17b1

Please sign in to comment.