Commit 4316e064 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Output render pass loadOp in graph dump

Bug: angleproject:3205 Change-Id: I7ad99bd2f8ddeb899c5fa86fd39296e5fc96d2c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1657708 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 88596bea
......@@ -118,6 +118,19 @@ const char *GetResourceTypeName(CommandGraphResourceType resourceType,
}
}
const char *GetLoadOpShorthand(uint32_t loadOp)
{
switch (loadOp)
{
case VK_ATTACHMENT_LOAD_OP_CLEAR:
return "C";
case VK_ATTACHMENT_LOAD_OP_LOAD:
return "L";
default:
return "D";
}
}
void MakeDebugUtilsLabel(GLenum source, const char *marker, VkDebugUtilsLabelEXT *label)
{
static constexpr angle::ColorF kLabelColors[6] = {
......@@ -648,6 +661,32 @@ std::string CommandGraphNode::dumpCommandsForDiagnostics(const char *separator)
{
result += separator;
result += "Inside RP:";
size_t attachmentCount = mRenderPassDesc.attachmentCount();
size_t depthStencilAttachmentCount = mRenderPassDesc.hasDepthStencilAttachment();
size_t colorAttachmentCount = attachmentCount - depthStencilAttachmentCount;
if (colorAttachmentCount > 0)
{
result += " Color: ";
for (size_t i = 0; i < colorAttachmentCount; ++i)
{
result += GetLoadOpShorthand(mRenderPassAttachmentOps[i].loadOp);
}
}
if (depthStencilAttachmentCount > 0)
{
ASSERT(depthStencilAttachmentCount == 1);
result += " Depth/Stencil: ";
size_t dsIndex = colorAttachmentCount;
result += GetLoadOpShorthand(mRenderPassAttachmentOps[dsIndex].loadOp);
result += GetLoadOpShorthand(mRenderPassAttachmentOps[dsIndex].stencilLoadOp);
}
result += DumpCommands(mInsideRenderPassCommands, separator);
}
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment