Renderer/CommandBuffer: Add support for InsertDebugLabel
This commit is contained in:
@@ -209,6 +209,12 @@ namespace Nz
|
||||
context->glPopDebugGroup();
|
||||
}
|
||||
|
||||
inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const InsertDebugLabelCommand& command)
|
||||
{
|
||||
if (context->glDebugMessageInsert)
|
||||
context->glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 0, GL_DEBUG_SEVERITY_NOTIFICATION, command.label.size(), command.label.data());
|
||||
}
|
||||
|
||||
inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const MemoryBarrier& command)
|
||||
{
|
||||
if (context->glMemoryBarrier)
|
||||
|
||||
@@ -148,6 +148,11 @@ namespace Nz
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
void OpenGLCommandBufferBuilder::InsertDebugLabel(std::string_view label, const Color& color)
|
||||
{
|
||||
m_commandBuffer.InsertDebugLabel(label, color);
|
||||
}
|
||||
|
||||
void OpenGLCommandBufferBuilder::NextSubpass()
|
||||
{
|
||||
/* nothing to do */
|
||||
|
||||
@@ -603,13 +603,16 @@ namespace Nz::GL
|
||||
|
||||
if (glDebugMessageControl)
|
||||
{
|
||||
// Disable push/pop debug groups notifications
|
||||
// Disable push/pop debug groups and markers notifications
|
||||
if (glPushDebugGroup)
|
||||
glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_PUSH_GROUP, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE);
|
||||
|
||||
if (glPopDebugGroup)
|
||||
glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_POP_GROUP, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE);
|
||||
|
||||
if (glDebugMessageInsert)
|
||||
glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_MARKER, GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE);
|
||||
|
||||
// Handle verbosity level
|
||||
if (m_params.validationLevel < RenderAPIValidationLevel::Debug)
|
||||
// Disable driver notifications except in debug (NVidia driver is very verbose)
|
||||
|
||||
@@ -315,6 +315,16 @@ namespace Nz
|
||||
m_currentRenderPass = nullptr;
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::InsertDebugLabel(std::string_view label, const Color& color)
|
||||
{
|
||||
// Ensure \0 at the end of string
|
||||
StackArray<char> labelEOS = NazaraStackArrayNoInit(char, label.size() + 1);
|
||||
std::memcpy(labelEOS.data(), label.data(), label.size());
|
||||
labelEOS[label.size()] = '\0';
|
||||
|
||||
m_commandBuffer.InsertDebugLabel(labelEOS.data(), color);
|
||||
}
|
||||
|
||||
void VulkanCommandBufferBuilder::NextSubpass()
|
||||
{
|
||||
m_commandBuffer.NextSubpass();
|
||||
|
||||
Reference in New Issue
Block a user