mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
allow graphics debug output when OpenGL ES 3.2 is used.
This commit is contained in:
@@ -724,11 +724,11 @@ void Graphics::setDebug(bool enable)
|
|||||||
{
|
{
|
||||||
// Make sure debug output is supported. The AMD ext. is a bit different
|
// Make sure debug output is supported. The AMD ext. is a bit different
|
||||||
// so we don't make use of it, since AMD drivers now support KHR_debug.
|
// so we don't make use of it, since AMD drivers now support KHR_debug.
|
||||||
if (!(GLAD_VERSION_4_3 || GLAD_KHR_debug || GLAD_ARB_debug_output))
|
if (!(GLAD_VERSION_4_3 || GLAD_ES_VERSION_3_2 || GLAD_KHR_debug || GLAD_ARB_debug_output))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: We don't support GL_KHR_debug in GLES yet.
|
// TODO: We don't support GL_KHR_debug in GLES yet.
|
||||||
if (GLAD_ES_VERSION_2_0)
|
if (GLAD_ES_VERSION_2_0 && !GLAD_ES_VERSION_3_2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Ugly hack to reduce code duplication.
|
// Ugly hack to reduce code duplication.
|
||||||
@@ -744,7 +744,7 @@ void Graphics::setDebug(bool enable)
|
|||||||
glDebugMessageCallback(nullptr, nullptr);
|
glDebugMessageCallback(nullptr, nullptr);
|
||||||
|
|
||||||
// We can disable debug output entirely with KHR_debug.
|
// We can disable debug output entirely with KHR_debug.
|
||||||
if (GLAD_VERSION_4_3 || GLAD_KHR_debug)
|
if (GLAD_VERSION_4_3 || GLAD_ES_VERSION_3_2 || GLAD_KHR_debug)
|
||||||
glDisable(GL_DEBUG_OUTPUT);
|
glDisable(GL_DEBUG_OUTPUT);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -762,7 +762,7 @@ void Graphics::setDebug(bool enable)
|
|||||||
glDebugMessageControl(GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DONT_CARE, 0, 0, GL_FALSE);
|
glDebugMessageControl(GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DONT_CARE, 0, 0, GL_FALSE);
|
||||||
glDebugMessageControl(GL_DEBUG_SOURCE_SHADER_COMPILER, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DONT_CARE, 0, 0, GL_FALSE);
|
glDebugMessageControl(GL_DEBUG_SOURCE_SHADER_COMPILER, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DONT_CARE, 0, 0, GL_FALSE);
|
||||||
|
|
||||||
if (GLAD_VERSION_4_3 || GLAD_KHR_debug)
|
if (GLAD_VERSION_4_3 || GLAD_ES_VERSION_3_2 || GLAD_KHR_debug)
|
||||||
glEnable(GL_DEBUG_OUTPUT);
|
glEnable(GL_DEBUG_OUTPUT);
|
||||||
|
|
||||||
::printf("OpenGL debug output enabled (LOVE_GRAPHICS_DEBUG=1)\n");
|
::printf("OpenGL debug output enabled (LOVE_GRAPHICS_DEBUG=1)\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user