OpenGLRenderer: Implement debug region data
This commit is contained in:
parent
8f9f943e2c
commit
f7442982a4
|
|
@ -154,10 +154,12 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
|||
cb(glVertexAttribIPointer, PFNGLVERTEXATTRIBIPOINTERPROC) \
|
||||
cb(glViewport, PFNGLVIEWPORTPROC) \
|
||||
\
|
||||
extCb(glObjectLabel, PFNGLOBJECTLABELPROC) \
|
||||
\
|
||||
extCb(glDebugMessageCallback, PFNGLDEBUGMESSAGECALLBACKPROC) \
|
||||
\
|
||||
extCb(glObjectLabel, PFNGLOBJECTLABELPROC) \
|
||||
extCb(glPopDebugGroup, PFNGLPOPDEBUGGROUPPROC) \
|
||||
extCb(glPushDebugGroup, PFNGLPUSHDEBUGGROUPPROC) \
|
||||
\
|
||||
extCb(glSpecializeShaderARB, PFNGLSPECIALIZESHADERARBPROC) \
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@ namespace Nz
|
|||
{
|
||||
using T = std::decay_t<decltype(command)>;
|
||||
|
||||
if constexpr (std::is_same_v<T, BeginDebugRegionData> || std::is_same_v<T, EndDebugRegionData>)
|
||||
if constexpr (std::is_same_v<T, BeginDebugRegionData>)
|
||||
{
|
||||
// TODO
|
||||
if (context->glPushDebugGroup)
|
||||
context->glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, command.regionName.size(), command.regionName.data());
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, CopyBufferData>)
|
||||
{
|
||||
|
|
@ -88,6 +89,11 @@ namespace Nz
|
|||
ApplyStates(*context, command.states);
|
||||
context->glDrawElementsInstanced(ToOpenGL(command.states.pipeline->GetPipelineInfo().primitiveMode), command.indexCount, GL_UNSIGNED_SHORT, nullptr, command.instanceCount);
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, EndDebugRegionData>)
|
||||
{
|
||||
if (context->glPopDebugGroup)
|
||||
context->glPopDebugGroup();
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, SetFrameBufferData>)
|
||||
{
|
||||
command.framebuffer->Activate();
|
||||
|
|
|
|||
|
|
@ -644,8 +644,11 @@ namespace Nz::GL
|
|||
|
||||
void Context::HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message) const
|
||||
{
|
||||
if (id == 0)
|
||||
return;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "OpenGL debug message (ID: 0x" << std::to_string(id) << "):\n";
|
||||
ss << "OpenGL debug message (ID: 0x" << id << "):\n";
|
||||
ss << "Sent by context: " << this;
|
||||
ss << "\n-Source: ";
|
||||
switch (source)
|
||||
|
|
|
|||
Loading…
Reference in New Issue