Commit 798a8375 by Jamie Madill Committed by Commit Bot

Vulkan: Add more debug labels handling with graph off.

Bug: angleproject:4029 Change-Id: Ia3c88af5f9fa1a7940d7f809ded599c064126be7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2055555 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 12a36dd9
...@@ -2305,6 +2305,9 @@ std::string ContextVk::getRendererDescription() const ...@@ -2305,6 +2305,9 @@ std::string ContextVk::getRendererDescription() const
angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker) angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
{ {
if (!mRenderer->enableDebugUtils())
return angle::Result::Continue;
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
std::string markerStr(marker, length <= 0 ? strlen(marker) : length); std::string markerStr(marker, length <= 0 ? strlen(marker) : length);
...@@ -2312,8 +2315,12 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker) ...@@ -2312,8 +2315,12 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
} }
else else
{ {
// TODO(jmadill): http://anglebug.com/4029 vk::PrimaryCommandBuffer *primary;
UNIMPLEMENTED(); ANGLE_TRY(getPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
primary->insertDebugUtilsLabelEXT(label);
} }
return angle::Result::Continue; return angle::Result::Continue;
...@@ -2321,6 +2328,9 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker) ...@@ -2321,6 +2328,9 @@ angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker) angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
{ {
if (!mRenderer->enableDebugUtils())
return angle::Result::Continue;
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
std::string markerStr(marker, length <= 0 ? strlen(marker) : length); std::string markerStr(marker, length <= 0 ? strlen(marker) : length);
...@@ -2328,8 +2338,12 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker) ...@@ -2328,8 +2338,12 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
} }
else else
{ {
// TODO(jmadill): http://anglebug.com/4029 vk::PrimaryCommandBuffer *primary;
UNIMPLEMENTED(); ANGLE_TRY(getPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
primary->beginDebugUtilsLabelEXT(label);
} }
return angle::Result::Continue; return angle::Result::Continue;
...@@ -2337,14 +2351,18 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker) ...@@ -2337,14 +2351,18 @@ angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
angle::Result ContextVk::popGroupMarker() angle::Result ContextVk::popGroupMarker()
{ {
if (!mRenderer->enableDebugUtils())
return angle::Result::Continue;
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
mCommandGraph.popDebugMarker(); mCommandGraph.popDebugMarker();
} }
else else
{ {
// TODO(jmadill): http://anglebug.com/4029 vk::PrimaryCommandBuffer *primary;
UNIMPLEMENTED(); ANGLE_TRY(getPrimaryCommandBuffer(&primary));
primary->endDebugUtilsLabelEXT();
} }
return angle::Result::Continue; return angle::Result::Continue;
...@@ -2355,21 +2373,21 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context, ...@@ -2355,21 +2373,21 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context,
GLuint id, GLuint id,
const std::string &message) const std::string &message)
{ {
if (!mRenderer->enableDebugUtils())
return angle::Result::Continue;
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
mCommandGraph.insertDebugMarker(source, std::string(message)); mCommandGraph.insertDebugMarker(source, std::string(message));
} }
else else
{ {
if (mRenderer->enableDebugUtils()) vk::PrimaryCommandBuffer *primary;
{ ANGLE_TRY(getPrimaryCommandBuffer(&primary));
vk::PrimaryCommandBuffer *primary;
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
VkDebugUtilsLabelEXT label; VkDebugUtilsLabelEXT label;
vk::MakeDebugUtilsLabel(source, message.c_str(), &label); vk::MakeDebugUtilsLabel(source, message.c_str(), &label);
primary->insertDebugUtilsLabelEXT(label); primary->insertDebugUtilsLabelEXT(label);
}
} }
return angle::Result::Continue; return angle::Result::Continue;
...@@ -2377,18 +2395,18 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context, ...@@ -2377,18 +2395,18 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context,
angle::Result ContextVk::popDebugGroup(const gl::Context *context) angle::Result ContextVk::popDebugGroup(const gl::Context *context)
{ {
if (!mRenderer->enableDebugUtils())
return angle::Result::Continue;
if (commandGraphEnabled()) if (commandGraphEnabled())
{ {
mCommandGraph.popDebugMarker(); mCommandGraph.popDebugMarker();
} }
else else
{ {
if (mRenderer->enableDebugUtils()) vk::PrimaryCommandBuffer *primary;
{ ANGLE_TRY(getPrimaryCommandBuffer(&primary));
vk::PrimaryCommandBuffer *primary; primary->endDebugUtilsLabelEXT();
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
primary->endDebugUtilsLabelEXT();
}
} }
return angle::Result::Continue; return angle::Result::Continue;
......
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