Commit 0a6c6c00 by Mark Lobodzinski Committed by Angle LUCI CQ

Vulkan: Submit Dispatch commands outside renderpass

Compute dispatch commands must be submitted outside a renderpass, but their associated debug event markers were being submitted on the renderpass commandbuffer. The dispatch debug event markers are now handled separately from those for draw calls and are now submitted on the correct commandbuffer. Failure manifested in malformed AGI traces for Ragnarok M: Eternal Love Bug: b/181611786 Change-Id: I768eeccd76be38818fc99d6d56f5899290c8fc5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2930818Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent 052713da
...@@ -3020,15 +3020,24 @@ void ContextVk::logEvent(const char *eventString) ...@@ -3020,15 +3020,24 @@ void ContextVk::logEvent(const char *eventString)
mComputeDirtyBits.set(DIRTY_BIT_EVENT_LOG); mComputeDirtyBits.set(DIRTY_BIT_EVENT_LOG);
} }
void ContextVk::endEventLog(angle::EntryPoint entryPoint) void ContextVk::endEventLog(angle::EntryPoint entryPoint, PipelineType pipelineType)
{ {
if (!mRenderer->angleDebuggerMode()) if (!mRenderer->angleDebuggerMode())
{ {
return; return;
} }
ASSERT(mRenderPassCommands); if (pipelineType == PipelineType::Graphics)
mRenderPassCommands->getCommandBuffer().endDebugUtilsLabelEXT(); {
ASSERT(mRenderPassCommands);
mRenderPassCommands->getCommandBuffer().endDebugUtilsLabelEXT();
}
else
{
ASSERT(pipelineType == PipelineType::Compute);
ASSERT(mOutsideRenderPassCommands);
mOutsideRenderPassCommands->getCommandBuffer().endDebugUtilsLabelEXT();
}
} }
angle::Result ContextVk::handleNoopDrawEvent() angle::Result ContextVk::handleNoopDrawEvent()
......
...@@ -208,7 +208,7 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText ...@@ -208,7 +208,7 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
// Record GL API calls for debuggers // Record GL API calls for debuggers
void logEvent(const char *eventString); void logEvent(const char *eventString);
void endEventLog(angle::EntryPoint entryPoint); void endEventLog(angle::EntryPoint entryPoint, PipelineType pipelineType);
bool isViewportFlipEnabledForDrawFBO() const; bool isViewportFlipEnabledForDrawFBO() const;
bool isViewportFlipEnabledForReadFBO() const; bool isViewportFlipEnabledForReadFBO() const;
......
...@@ -37,10 +37,17 @@ void DebugAnnotatorVk::endEvent(gl::Context *context, ...@@ -37,10 +37,17 @@ void DebugAnnotatorVk::endEvent(gl::Context *context,
angle::EntryPoint entryPoint) angle::EntryPoint entryPoint)
{ {
angle::LoggingAnnotator::endEvent(context, eventName, entryPoint); angle::LoggingAnnotator::endEvent(context, eventName, entryPoint);
if (vkCmdBeginDebugUtilsLabelEXT && context && isDrawOrDispatchEntryPoint(entryPoint)) if (vkCmdBeginDebugUtilsLabelEXT && context)
{ {
ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context)); ContextVk *contextVk = vk::GetImpl(static_cast<gl::Context *>(context));
contextVk->endEventLog(entryPoint); if (isDrawEntryPoint(entryPoint))
{
contextVk->endEventLog(entryPoint, PipelineType::Graphics);
}
else if (isDispatchEntryPoint(entryPoint))
{
contextVk->endEventLog(entryPoint, PipelineType::Compute);
}
} }
} }
...@@ -49,12 +56,10 @@ bool DebugAnnotatorVk::getStatus() ...@@ -49,12 +56,10 @@ bool DebugAnnotatorVk::getStatus()
return true; return true;
} }
bool DebugAnnotatorVk::isDrawOrDispatchEntryPoint(angle::EntryPoint entryPoint) const bool DebugAnnotatorVk::isDrawEntryPoint(angle::EntryPoint entryPoint) const
{ {
switch (entryPoint) switch (entryPoint)
{ {
case angle::EntryPoint::GLDispatchCompute:
case angle::EntryPoint::GLDispatchComputeIndirect:
case angle::EntryPoint::GLDrawArrays: case angle::EntryPoint::GLDrawArrays:
case angle::EntryPoint::GLDrawArraysIndirect: case angle::EntryPoint::GLDrawArraysIndirect:
case angle::EntryPoint::GLDrawArraysInstanced: case angle::EntryPoint::GLDrawArraysInstanced:
...@@ -99,4 +104,16 @@ bool DebugAnnotatorVk::isDrawOrDispatchEntryPoint(angle::EntryPoint entryPoint) ...@@ -99,4 +104,16 @@ bool DebugAnnotatorVk::isDrawOrDispatchEntryPoint(angle::EntryPoint entryPoint)
} }
} }
bool DebugAnnotatorVk::isDispatchEntryPoint(angle::EntryPoint entryPoint) const
{
switch (entryPoint)
{
case angle::EntryPoint::GLDispatchCompute:
case angle::EntryPoint::GLDispatchComputeIndirect:
return true;
default:
return false;
}
}
} // namespace rx } // namespace rx
...@@ -29,7 +29,8 @@ class DebugAnnotatorVk : public angle::LoggingAnnotator ...@@ -29,7 +29,8 @@ class DebugAnnotatorVk : public angle::LoggingAnnotator
bool getStatus() override; bool getStatus() override;
private: private:
bool isDrawOrDispatchEntryPoint(angle::EntryPoint entryPoint) const; bool isDrawEntryPoint(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 // Note: To avoid any race conditions between threads, this class has no private data; all
// events are stored in ContextVk. // events are stored in ContextVk.
......
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