Commit 4bafc503 by Mark Lobodzinski Committed by Angle LUCI CQ

Vulkan: Fix AGI hierarchy for clear commands

Treat mid-render-pass glClear* commands the same as glDraw* commands, generating a hierarchy. This results in vkCmdClearAttachment commands being nested under glClear, instead of being a peer of glDraw* commands. Bug: b/183547523 Change-Id: Ibc6900b0485fd174d79c8fe6c94ea17dbefa520b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2941364Reviewed-by: 's avatarMark Lobodzinski <mark@lunarg.com> Reviewed-by: 's avatarMike Schuchardt <mikes@lunarg.com> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent 7c253fca
......@@ -3046,6 +3046,11 @@ angle::Result ContextVk::handleNoopDrawEvent()
return handleDirtyEventLogImpl(mRenderPassCommandBuffer);
}
angle::Result ContextVk::handleMidRenderPassClearEvent()
{
return handleDirtyEventLogImpl(mRenderPassCommandBuffer);
}
bool ContextVk::isViewportFlipEnabledForDrawFBO() const
{
return mFlipViewportForDrawFramebuffer && mFlipYForCurrentSurface;
......
......@@ -616,6 +616,8 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
void onProgramExecutableReset(ProgramExecutableVk *executableVk);
angle::Result handleMidRenderPassClearEvent();
private:
// Dirty bits.
enum DirtyBitType : size_t
......
......@@ -40,7 +40,7 @@ void DebugAnnotatorVk::endEvent(gl::Context *context,
if (vkCmdBeginDebugUtilsLabelEXT && context)
{
ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context));
if (isDrawEntryPoint(entryPoint))
if (isDrawOrClearEntryPoint(entryPoint))
{
contextVk->endEventLog(entryPoint, PipelineType::Graphics);
}
......@@ -56,10 +56,15 @@ bool DebugAnnotatorVk::getStatus()
return true;
}
bool DebugAnnotatorVk::isDrawEntryPoint(angle::EntryPoint entryPoint) const
bool DebugAnnotatorVk::isDrawOrClearEntryPoint(angle::EntryPoint entryPoint) const
{
switch (entryPoint)
{
case angle::EntryPoint::GLClear:
case angle::EntryPoint::GLClearBufferfi:
case angle::EntryPoint::GLClearBufferfv:
case angle::EntryPoint::GLClearBufferiv:
case angle::EntryPoint::GLClearBufferuiv:
case angle::EntryPoint::GLDrawArrays:
case angle::EntryPoint::GLDrawArraysIndirect:
case angle::EntryPoint::GLDrawArraysInstanced:
......
......@@ -29,7 +29,7 @@ class DebugAnnotatorVk : public angle::LoggingAnnotator
bool getStatus() override;
private:
bool isDrawEntryPoint(angle::EntryPoint entryPoint) const;
bool isDrawOrClearEntryPoint(angle::EntryPoint entryPoint) const;
bool isDispatchEntryPoint(angle::EntryPoint entryPoint) const;
// Note: To avoid any race conditions between threads, this class has no private data; all
......
......@@ -2344,6 +2344,9 @@ angle::Result FramebufferVk::clearWithCommand(ContextVk *contextVk,
updateRenderPassReadOnlyDepthMode(contextVk, renderpassCommands);
}
// Emit debug-util markers for this mid-render-pass clear
ANGLE_TRY(contextVk->handleMidRenderPassClearEvent());
VkClearRect rect = {};
rect.rect.extent.width = scissoredRenderArea.width;
rect.rect.extent.height = scissoredRenderArea.height;
......
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