mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Store renderpass load/store ops and display in drawcall names
This commit is contained in:
@@ -1723,14 +1723,14 @@ void WrappedVulkan::ReplayLog(uint32_t frameID, uint32_t startEventID, uint32_t
|
||||
|
||||
VkClearValue empty[16] = {0};
|
||||
|
||||
RDCASSERT(ARRAY_COUNT(empty) >= m_CreationInfo.m_RenderPass[s.renderPass].attachCount);
|
||||
RDCASSERT(ARRAY_COUNT(empty) >= m_CreationInfo.m_RenderPass[s.renderPass].attachments.size());
|
||||
|
||||
VkRenderPassBeginInfo rpbegin = {
|
||||
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, NULL,
|
||||
Unwrap(m_CreationInfo.m_RenderPass[s.renderPass].loadRP),
|
||||
Unwrap(GetResourceManager()->GetCurrentHandle<VkFramebuffer>(s.framebuffer)),
|
||||
s.renderArea,
|
||||
m_CreationInfo.m_RenderPass[s.renderPass].attachCount, empty,
|
||||
(uint32_t)m_CreationInfo.m_RenderPass[s.renderPass].attachments.size(), empty,
|
||||
};
|
||||
ObjDisp(cmd)->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_RENDER_PASS_CONTENTS_INLINE);
|
||||
|
||||
|
||||
@@ -233,7 +233,16 @@ void VulkanCreationInfo::PipelineLayout::Init(VulkanResourceManager *resourceMan
|
||||
|
||||
void VulkanCreationInfo::RenderPass::Init(VulkanResourceManager *resourceMan, const VkRenderPassCreateInfo* pCreateInfo)
|
||||
{
|
||||
attachCount = pCreateInfo->attachmentCount;
|
||||
attachments.reserve(pCreateInfo->attachmentCount);
|
||||
for(uint32_t i=0; i < pCreateInfo->attachmentCount; i++)
|
||||
{
|
||||
Attachment a;
|
||||
a.loadOp = pCreateInfo->pAttachments[i].loadOp;
|
||||
a.storeOp = pCreateInfo->pAttachments[i].storeOp;
|
||||
a.stencilLoadOp = pCreateInfo->pAttachments[i].stencilLoadOp;
|
||||
a.stencilStoreOp = pCreateInfo->pAttachments[i].stencilStoreOp;
|
||||
attachments.push_back(a);
|
||||
}
|
||||
|
||||
// VKTODOMED figure out how subpasses work
|
||||
RDCASSERT(pCreateInfo->subpassCount > 0);
|
||||
|
||||
@@ -164,12 +164,19 @@ struct VulkanCreationInfo
|
||||
{
|
||||
void Init(VulkanResourceManager *resourceMan, const VkRenderPassCreateInfo* pCreateInfo);
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
VkAttachmentLoadOp loadOp;
|
||||
VkAttachmentStoreOp storeOp;
|
||||
VkAttachmentLoadOp stencilLoadOp;
|
||||
VkAttachmentStoreOp stencilStoreOp;
|
||||
};
|
||||
vector<Attachment> attachments;
|
||||
|
||||
vector<uint32_t> inputAttachments;
|
||||
vector<uint32_t> colorAttachments;
|
||||
int32_t depthstencilAttachment;
|
||||
|
||||
uint32_t attachCount;
|
||||
|
||||
VkRenderPass loadRP;
|
||||
};
|
||||
map<ResourceId, RenderPass> m_RenderPass;
|
||||
|
||||
@@ -556,13 +556,74 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(
|
||||
cmdBuffer = GetResourceManager()->GetLiveHandle<VkCmdBuffer>(cmdid);
|
||||
|
||||
ObjDisp(cmdBuffer)->CmdBeginRenderPass(Unwrap(cmdBuffer), &beginInfo, cont);
|
||||
|
||||
// track during reading
|
||||
m_PartialReplayData.state.renderPass = GetResourceManager()->GetNonDispWrapper(beginInfo.renderPass)->id;
|
||||
|
||||
const string desc = localSerialiser->GetDebugStr();
|
||||
|
||||
// VKTODOMED change the name to show render pass load-op
|
||||
string loadDesc = "";
|
||||
|
||||
const VulkanCreationInfo::RenderPass &info = m_CreationInfo.m_RenderPass[m_PartialReplayData.state.renderPass];
|
||||
|
||||
const vector<VulkanCreationInfo::RenderPass::Attachment> &atts = info.attachments;
|
||||
|
||||
if(atts.empty())
|
||||
{
|
||||
loadDesc = "-";
|
||||
}
|
||||
else
|
||||
{
|
||||
bool allsame = true;
|
||||
bool allsameexceptstencil = true;
|
||||
|
||||
for(size_t i=1; i < atts.size(); i++)
|
||||
{
|
||||
if(atts[i].loadOp != atts[0].loadOp || atts[i].stencilLoadOp != atts[0].stencilLoadOp)
|
||||
allsame = false;
|
||||
|
||||
if(atts[i].loadOp != atts[0].loadOp)
|
||||
allsameexceptstencil = false;
|
||||
}
|
||||
|
||||
if(allsame)
|
||||
{
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
loadDesc = "Clear";
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD)
|
||||
loadDesc = "Load";
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
|
||||
loadDesc = "Don't Care";
|
||||
}
|
||||
else if(allsameexceptstencil)
|
||||
{
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
loadDesc = "Clear";
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD)
|
||||
loadDesc = "Load";
|
||||
if(atts[0].loadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
|
||||
loadDesc = "Don't Care";
|
||||
|
||||
if(info.depthstencilAttachment >= 0 && info.depthstencilAttachment < atts.size())
|
||||
{
|
||||
if(atts[info.depthstencilAttachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||
loadDesc = ", Stencil=Clear";
|
||||
if(atts[info.depthstencilAttachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD)
|
||||
loadDesc = ", Stencil=Load";
|
||||
if(atts[info.depthstencilAttachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
|
||||
loadDesc = ", Stencil=Don't Care";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// VKTODOLOW improve text for this path
|
||||
loadDesc = "Different load ops";
|
||||
}
|
||||
}
|
||||
|
||||
AddEvent(BEGIN_RENDERPASS, desc);
|
||||
FetchDrawcall draw;
|
||||
draw.name = "Render Pass Start";
|
||||
draw.name = StringFormat::Fmt("vkCmdBeginRenderPass(%s)", loadDesc.c_str());
|
||||
draw.flags |= eDraw_Clear;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
@@ -744,11 +805,63 @@ bool WrappedVulkan::Serialise_vkCmdEndRenderPass(
|
||||
ObjDisp(cmdBuffer)->CmdEndRenderPass(Unwrap(cmdBuffer));
|
||||
|
||||
const string desc = localSerialiser->GetDebugStr();
|
||||
|
||||
string storeDesc = "";
|
||||
|
||||
const VulkanCreationInfo::RenderPass &info = m_CreationInfo.m_RenderPass[m_PartialReplayData.state.renderPass];
|
||||
|
||||
const vector<VulkanCreationInfo::RenderPass::Attachment> &atts = info.attachments;
|
||||
|
||||
if(atts.empty())
|
||||
{
|
||||
storeDesc = "-";
|
||||
}
|
||||
else
|
||||
{
|
||||
bool allsame = true;
|
||||
bool allsameexceptstencil = true;
|
||||
|
||||
for(size_t i=1; i < atts.size(); i++)
|
||||
{
|
||||
if(atts[i].storeOp != atts[0].storeOp || atts[i].stencilStoreOp != atts[0].stencilStoreOp)
|
||||
allsame = false;
|
||||
|
||||
if(atts[i].storeOp != atts[0].storeOp)
|
||||
allsameexceptstencil = false;
|
||||
}
|
||||
|
||||
if(allsame)
|
||||
{
|
||||
if(atts[0].storeOp == VK_ATTACHMENT_STORE_OP_STORE)
|
||||
storeDesc = "Store";
|
||||
if(atts[0].storeOp == VK_ATTACHMENT_STORE_OP_DONT_CARE)
|
||||
storeDesc = "Don't Care";
|
||||
}
|
||||
else if(allsameexceptstencil)
|
||||
{
|
||||
if(atts[0].storeOp == VK_ATTACHMENT_STORE_OP_STORE)
|
||||
storeDesc = "Store";
|
||||
if(atts[0].storeOp == VK_ATTACHMENT_STORE_OP_DONT_CARE)
|
||||
storeDesc = "Don't Care";
|
||||
|
||||
if(info.depthstencilAttachment >= 0 && info.depthstencilAttachment < atts.size())
|
||||
{
|
||||
if(atts[info.depthstencilAttachment].stencilStoreOp == VK_ATTACHMENT_STORE_OP_STORE)
|
||||
storeDesc = ", Stencil=Store";
|
||||
if(atts[info.depthstencilAttachment].stencilStoreOp == VK_ATTACHMENT_STORE_OP_DONT_CARE)
|
||||
storeDesc = ", Stencil=Don't Care";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// VKTODOLOW improve text for this path
|
||||
storeDesc = "Different store ops";
|
||||
}
|
||||
}
|
||||
|
||||
// VKTODOMED change the name to show render pass store-op
|
||||
AddEvent(END_RENDERPASS, desc);
|
||||
FetchDrawcall draw;
|
||||
draw.name = "Render Pass End";
|
||||
draw.name = StringFormat::Fmt("vkCmdEndRenderPass(%s)", storeDesc.c_str());
|
||||
draw.flags |= eDraw_Clear;
|
||||
|
||||
AddDrawcall(draw, true);
|
||||
|
||||
Reference in New Issue
Block a user