Renderer/CommandBuffer: Add support for InsertDebugLabel
This commit is contained in:
@@ -64,6 +64,8 @@ namespace Nz
|
||||
|
||||
void Execute();
|
||||
|
||||
inline void InsertDebugLabel(std::string_view label, const Color& color);
|
||||
|
||||
inline std::size_t GetBindingIndex() const;
|
||||
inline std::size_t GetPoolIndex() const;
|
||||
inline const OpenGLCommandPool& GetOwner() const;
|
||||
@@ -94,6 +96,7 @@ namespace Nz
|
||||
cb(DrawCommand) \
|
||||
cb(DrawIndexedCommand) \
|
||||
cb(EndDebugRegionCommand) \
|
||||
cb(InsertDebugLabelCommand) \
|
||||
cb(MemoryBarrier) \
|
||||
lastCb(SetFrameBufferCommand) \
|
||||
|
||||
@@ -124,6 +127,7 @@ namespace Nz
|
||||
inline void Execute(const GL::Context* context, const DrawCommand& command);
|
||||
inline void Execute(const GL::Context* context, const DrawIndexedCommand& command);
|
||||
inline void Execute(const GL::Context* context, const EndDebugRegionCommand& command);
|
||||
inline void Execute(const GL::Context* context, const InsertDebugLabelCommand& command);
|
||||
inline void Execute(const GL::Context* context, const MemoryBarrier& command);
|
||||
inline void Execute(const GL::Context*& context, const SetFrameBufferCommand& command);
|
||||
|
||||
@@ -237,6 +241,12 @@ namespace Nz
|
||||
{
|
||||
};
|
||||
|
||||
struct InsertDebugLabelCommand
|
||||
{
|
||||
std::string label;
|
||||
Color color;
|
||||
};
|
||||
|
||||
struct MemoryBarrier
|
||||
{
|
||||
GLbitfield barriers;
|
||||
|
||||
@@ -188,6 +188,15 @@ namespace Nz
|
||||
m_commands.emplace_back(EndDebugRegionCommand{});
|
||||
}
|
||||
|
||||
inline void OpenGLCommandBuffer::InsertDebugLabel(std::string_view label, const Color& color)
|
||||
{
|
||||
InsertDebugLabelCommand debugLabelCommand;
|
||||
debugLabelCommand.color = color;
|
||||
debugLabelCommand.label = label;
|
||||
|
||||
m_commands.emplace_back(std::move(debugLabelCommand));
|
||||
}
|
||||
|
||||
inline std::size_t OpenGLCommandBuffer::GetBindingIndex() const
|
||||
{
|
||||
return m_bindingIndex;
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Nz
|
||||
void EndDebugRegion() override;
|
||||
void EndRenderPass() override;
|
||||
|
||||
void InsertDebugLabel(std::string_view label, const Color& color) override;
|
||||
|
||||
void NextSubpass() override;
|
||||
|
||||
void PreTransferBarrier() override;
|
||||
|
||||
@@ -78,6 +78,7 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLch
|
||||
cb(glCreateProgram, PFNGLCREATEPROGRAMPROC) \
|
||||
cb(glCreateShader, PFNGLCREATESHADERPROC) \
|
||||
cb(glCullFace, PFNGLCULLFACEPROC) \
|
||||
cb(glDebugMessageInsert, PFNGLDEBUGMESSAGEINSERTPROC) \
|
||||
cb(glDeleteBuffers, PFNGLDELETEBUFFERSPROC) \
|
||||
cb(glDeleteFramebuffers, PFNGLDELETEFRAMEBUFFERSPROC) \
|
||||
cb(glDeleteProgram, PFNGLDELETEPROGRAMPROC) \
|
||||
|
||||
@@ -70,6 +70,8 @@ namespace Nz
|
||||
virtual void EndDebugRegion() = 0;
|
||||
virtual void EndRenderPass() = 0;
|
||||
|
||||
virtual void InsertDebugLabel(std::string_view label, const Color& color) = 0;
|
||||
|
||||
virtual void NextSubpass() = 0;
|
||||
|
||||
virtual void PreTransferBarrier() = 0;
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Nz
|
||||
void EndDebugRegion() override;
|
||||
void EndRenderPass() override;
|
||||
|
||||
void InsertDebugLabel(std::string_view label, const Color& color) override;
|
||||
|
||||
inline Vk::CommandBuffer& GetCommandBuffer();
|
||||
|
||||
void NextSubpass() override;
|
||||
|
||||
Reference in New Issue
Block a user