Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 798a837

Browse files
null77Commit Bot
authored andcommitted
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 <[email protected]> Reviewed-by: Tim Van Patten <[email protected]> Reviewed-by: Cody Northrop <[email protected]>
1 parent 12a36dd commit 798a837

File tree

1 file changed

+38
-20
lines changed

1 file changed

+38
-20
lines changed

src/libANGLE/renderer/vulkan/ContextVk.cpp

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,46 +2305,64 @@ std::string ContextVk::getRendererDescription() const
23052305

23062306
angle::Result ContextVk::insertEventMarker(GLsizei length, const char *marker)
23072307
{
2308+
if (!mRenderer->enableDebugUtils())
2309+
return angle::Result::Continue;
2310+
23082311
if (commandGraphEnabled())
23092312
{
23102313
std::string markerStr(marker, length <= 0 ? strlen(marker) : length);
23112314
mCommandGraph.insertDebugMarker(GL_DEBUG_SOURCE_APPLICATION, std::move(marker));
23122315
}
23132316
else
23142317
{
2315-
// TODO(jmadill): http://anglebug.com/4029
2316-
UNIMPLEMENTED();
2318+
vk::PrimaryCommandBuffer *primary;
2319+
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2320+
2321+
VkDebugUtilsLabelEXT label;
2322+
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
2323+
primary->insertDebugUtilsLabelEXT(label);
23172324
}
23182325

23192326
return angle::Result::Continue;
23202327
}
23212328

23222329
angle::Result ContextVk::pushGroupMarker(GLsizei length, const char *marker)
23232330
{
2331+
if (!mRenderer->enableDebugUtils())
2332+
return angle::Result::Continue;
2333+
23242334
if (commandGraphEnabled())
23252335
{
23262336
std::string markerStr(marker, length <= 0 ? strlen(marker) : length);
23272337
mCommandGraph.pushDebugMarker(GL_DEBUG_SOURCE_APPLICATION, std::move(marker));
23282338
}
23292339
else
23302340
{
2331-
// TODO(jmadill): http://anglebug.com/4029
2332-
UNIMPLEMENTED();
2341+
vk::PrimaryCommandBuffer *primary;
2342+
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2343+
2344+
VkDebugUtilsLabelEXT label;
2345+
vk::MakeDebugUtilsLabel(GL_DEBUG_SOURCE_APPLICATION, marker, &label);
2346+
primary->beginDebugUtilsLabelEXT(label);
23332347
}
23342348

23352349
return angle::Result::Continue;
23362350
}
23372351

23382352
angle::Result ContextVk::popGroupMarker()
23392353
{
2354+
if (!mRenderer->enableDebugUtils())
2355+
return angle::Result::Continue;
2356+
23402357
if (commandGraphEnabled())
23412358
{
23422359
mCommandGraph.popDebugMarker();
23432360
}
23442361
else
23452362
{
2346-
// TODO(jmadill): http://anglebug.com/4029
2347-
UNIMPLEMENTED();
2363+
vk::PrimaryCommandBuffer *primary;
2364+
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2365+
primary->endDebugUtilsLabelEXT();
23482366
}
23492367

23502368
return angle::Result::Continue;
@@ -2355,40 +2373,40 @@ angle::Result ContextVk::pushDebugGroup(const gl::Context *context,
23552373
GLuint id,
23562374
const std::string &message)
23572375
{
2376+
if (!mRenderer->enableDebugUtils())
2377+
return angle::Result::Continue;
2378+
23582379
if (commandGraphEnabled())
23592380
{
23602381
mCommandGraph.insertDebugMarker(source, std::string(message));
23612382
}
23622383
else
23632384
{
2364-
if (mRenderer->enableDebugUtils())
2365-
{
2366-
vk::PrimaryCommandBuffer *primary;
2367-
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2385+
vk::PrimaryCommandBuffer *primary;
2386+
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
23682387

2369-
VkDebugUtilsLabelEXT label;
2370-
vk::MakeDebugUtilsLabel(source, message.c_str(), &label);
2371-
primary->insertDebugUtilsLabelEXT(label);
2372-
}
2388+
VkDebugUtilsLabelEXT label;
2389+
vk::MakeDebugUtilsLabel(source, message.c_str(), &label);
2390+
primary->insertDebugUtilsLabelEXT(label);
23732391
}
23742392

23752393
return angle::Result::Continue;
23762394
}
23772395

23782396
angle::Result ContextVk::popDebugGroup(const gl::Context *context)
23792397
{
2398+
if (!mRenderer->enableDebugUtils())
2399+
return angle::Result::Continue;
2400+
23802401
if (commandGraphEnabled())
23812402
{
23822403
mCommandGraph.popDebugMarker();
23832404
}
23842405
else
23852406
{
2386-
if (mRenderer->enableDebugUtils())
2387-
{
2388-
vk::PrimaryCommandBuffer *primary;
2389-
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2390-
primary->endDebugUtilsLabelEXT();
2391-
}
2407+
vk::PrimaryCommandBuffer *primary;
2408+
ANGLE_TRY(getPrimaryCommandBuffer(&primary));
2409+
primary->endDebugUtilsLabelEXT();
23922410
}
23932411

23942412
return angle::Result::Continue;

0 commit comments

Comments
 (0)