|
|
|
@ -54,14 +54,14 @@ stream in various graphics debuggers, such as ApiTrace or gDEBugger. |
|
|
|
|
|
|
|
|
|
|
|
@section Magnum-DebugOutput-usage Basic usage |
|
|
|
@section Magnum-DebugOutput-usage Basic usage |
|
|
|
|
|
|
|
|
|
|
|
Support for debug output is provided by OpenGL 4.3 or @extension{KHR,debug} |
|
|
|
Support for debug output is provided by OpenGL 4.3 / OpenGL ES 3.2 or |
|
|
|
(desktop/ES extension, covered also by @extension{ANDROID,extension_pack_es31a}). |
|
|
|
@extension{KHR,debug} (desktop/ES extension, covered also by |
|
|
|
Subset of the functionality is provided also by @extension{EXT,debug_marker} |
|
|
|
@extension{ANDROID,extension_pack_es31a}). Subset of the functionality is |
|
|
|
(desktop/ES extensions) or @extension{GREMEDY,string_marker} (desktop only |
|
|
|
provided also by @extension{EXT,debug_marker} (desktop/ES extensions) or |
|
|
|
extension). |
|
|
|
@extension{GREMEDY,string_marker} (desktop only extension). |
|
|
|
|
|
|
|
|
|
|
|
With OpenGL 4.3 or @extension{KHR,debug} desktop/ES extension, the debug output |
|
|
|
With OpenGL 4.3 / OpenGL ES 3.2 or @extension{KHR,debug} desktop/ES extension, |
|
|
|
needs to be enabled first. It can be enabled globally using |
|
|
|
the debug output needs to be enabled first. It can be enabled globally using |
|
|
|
@ref Platform::Sdl2Application::Configuration::Flag::Debug "Platform::*Application::Configuration::Flag::Debug" |
|
|
|
@ref Platform::Sdl2Application::Configuration::Flag::Debug "Platform::*Application::Configuration::Flag::Debug" |
|
|
|
when creating context or only for some portions of the code using |
|
|
|
when creating context or only for some portions of the code using |
|
|
|
@ref Renderer::Feature::DebugOutput. If enabled globally, some OpenGL drivers |
|
|
|
@ref Renderer::Feature::DebugOutput. If enabled globally, some OpenGL drivers |
|
|
|
@ -135,42 +135,42 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
enum class Source: GLenum { |
|
|
|
enum class Source: GLenum { |
|
|
|
/** OpenGL */ |
|
|
|
/** OpenGL */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Api = GL_DEBUG_SOURCE_API, |
|
|
|
Api = GL_DEBUG_SOURCE_API, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Api = GL_DEBUG_SOURCE_API_KHR, |
|
|
|
Api = GL_DEBUG_SOURCE_API_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Window system (GLX, WGL) */ |
|
|
|
/** Window system (GLX, WGL) */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
WindowSystem = GL_DEBUG_SOURCE_WINDOW_SYSTEM, |
|
|
|
WindowSystem = GL_DEBUG_SOURCE_WINDOW_SYSTEM, |
|
|
|
#else |
|
|
|
#else |
|
|
|
WindowSystem = GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR, |
|
|
|
WindowSystem = GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Shader compiler */ |
|
|
|
/** Shader compiler */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
ShaderCompiler = GL_DEBUG_SOURCE_SHADER_COMPILER, |
|
|
|
ShaderCompiler = GL_DEBUG_SOURCE_SHADER_COMPILER, |
|
|
|
#else |
|
|
|
#else |
|
|
|
ShaderCompiler = GL_DEBUG_SOURCE_SHADER_COMPILER_KHR, |
|
|
|
ShaderCompiler = GL_DEBUG_SOURCE_SHADER_COMPILER_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** External debugger or third-party middleware */ |
|
|
|
/** External debugger or third-party middleware */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
#else |
|
|
|
#else |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** The application */ |
|
|
|
/** The application */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION, |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR, |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Any other source */ |
|
|
|
/** Any other source */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Other = GL_DEBUG_SOURCE_OTHER |
|
|
|
Other = GL_DEBUG_SOURCE_OTHER |
|
|
|
#else |
|
|
|
#else |
|
|
|
Other = GL_DEBUG_SOURCE_OTHER_KHR |
|
|
|
Other = GL_DEBUG_SOURCE_OTHER_KHR |
|
|
|
@ -185,63 +185,63 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
enum class Type: GLenum { |
|
|
|
enum class Type: GLenum { |
|
|
|
/** OpenGL error */ |
|
|
|
/** OpenGL error */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Error = GL_DEBUG_TYPE_ERROR, |
|
|
|
Error = GL_DEBUG_TYPE_ERROR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Error = GL_DEBUG_TYPE_ERROR_KHR, |
|
|
|
Error = GL_DEBUG_TYPE_ERROR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Behavior that has been marked for deprecation */ |
|
|
|
/** Behavior that has been marked for deprecation */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR, |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Behavior that is undefined according to the specification */ |
|
|
|
/** Behavior that is undefined according to the specification */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR, |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Non-portable usage of extensions or shaders */ |
|
|
|
/** Non-portable usage of extensions or shaders */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY, |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY_KHR, |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Implementation-dependent performance warning */ |
|
|
|
/** Implementation-dependent performance warning */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE, |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE_KHR, |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Annotation of the command stream */ |
|
|
|
/** Annotation of the command stream */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER, |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER_KHR, |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Entering a debug group */ |
|
|
|
/** Entering a debug group */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
PushGroup = GL_DEBUG_TYPE_PUSH_GROUP, |
|
|
|
PushGroup = GL_DEBUG_TYPE_PUSH_GROUP, |
|
|
|
#else |
|
|
|
#else |
|
|
|
PushGroup = GL_DEBUG_TYPE_PUSH_GROUP_KHR, |
|
|
|
PushGroup = GL_DEBUG_TYPE_PUSH_GROUP_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Leaving a debug group */ |
|
|
|
/** Leaving a debug group */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
PopGroup = GL_DEBUG_TYPE_POP_GROUP, |
|
|
|
PopGroup = GL_DEBUG_TYPE_POP_GROUP, |
|
|
|
#else |
|
|
|
#else |
|
|
|
PopGroup = GL_DEBUG_TYPE_POP_GROUP_KHR, |
|
|
|
PopGroup = GL_DEBUG_TYPE_POP_GROUP_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Any other type */ |
|
|
|
/** Any other type */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Other = GL_DEBUG_TYPE_OTHER, |
|
|
|
Other = GL_DEBUG_TYPE_OTHER, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Other = GL_DEBUG_TYPE_OTHER_KHR, |
|
|
|
Other = GL_DEBUG_TYPE_OTHER_KHR, |
|
|
|
@ -259,7 +259,7 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* Any OpenGL error, dangerous undefined behavior, shader |
|
|
|
* Any OpenGL error, dangerous undefined behavior, shader |
|
|
|
* compilation errors. |
|
|
|
* compilation errors. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
High = GL_DEBUG_SEVERITY_HIGH, |
|
|
|
High = GL_DEBUG_SEVERITY_HIGH, |
|
|
|
#else |
|
|
|
#else |
|
|
|
High = GL_DEBUG_SEVERITY_HIGH_KHR, |
|
|
|
High = GL_DEBUG_SEVERITY_HIGH_KHR, |
|
|
|
@ -269,21 +269,21 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* Severe performance warnings, shader compilation warnings, use of |
|
|
|
* Severe performance warnings, shader compilation warnings, use of |
|
|
|
* deprecated behavior. |
|
|
|
* deprecated behavior. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Medium = GL_DEBUG_SEVERITY_MEDIUM, |
|
|
|
Medium = GL_DEBUG_SEVERITY_MEDIUM, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Medium = GL_DEBUG_SEVERITY_MEDIUM_KHR, |
|
|
|
Medium = GL_DEBUG_SEVERITY_MEDIUM_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Minor performance warnings, trivial undefined behavior. */ |
|
|
|
/** Minor performance warnings, trivial undefined behavior. */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Low = GL_DEBUG_SEVERITY_LOW, |
|
|
|
Low = GL_DEBUG_SEVERITY_LOW, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Low = GL_DEBUG_SEVERITY_LOW_KHR, |
|
|
|
Low = GL_DEBUG_SEVERITY_LOW_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Any message other than error or performance warning. */ |
|
|
|
/** Any message other than error or performance warning. */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Notification = GL_DEBUG_SEVERITY_NOTIFICATION |
|
|
|
Notification = GL_DEBUG_SEVERITY_NOTIFICATION |
|
|
|
#else |
|
|
|
#else |
|
|
|
Notification = GL_DEBUG_SEVERITY_NOTIFICATION_KHR |
|
|
|
Notification = GL_DEBUG_SEVERITY_NOTIFICATION_KHR |
|
|
|
@ -301,9 +301,10 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* @brief Max count of debug messages in log |
|
|
|
* @brief Max count of debug messages in log |
|
|
|
* |
|
|
|
* |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug} |
|
|
|
* OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and |
|
|
|
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{KHR,debug} desktop or ES extension (covered also by |
|
|
|
* is not available, returns @cpp 0 @ce. |
|
|
|
* @extension{ANDROID,extension_pack_es31a}) is not available, returns |
|
|
|
|
|
|
|
* @cpp 0 @ce. |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_LOGGED_MESSAGES} |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_LOGGED_MESSAGES} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static Int maxLoggedMessages(); |
|
|
|
static Int maxLoggedMessages(); |
|
|
|
@ -312,9 +313,10 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* @brief Max debug message length |
|
|
|
* @brief Max debug message length |
|
|
|
* |
|
|
|
* |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug} |
|
|
|
* OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and |
|
|
|
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{KHR,debug} desktop or ES extension (covered also by |
|
|
|
* is not available, returns @cpp 0 @ce. |
|
|
|
* @extension{ANDROID,extension_pack_es31a}) is not available, returns |
|
|
|
|
|
|
|
* @cpp 0 @ce. |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_MESSAGE_LENGTH} |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_MESSAGE_LENGTH} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static Int maxMessageLength(); |
|
|
|
static Int maxMessageLength(); |
|
|
|
@ -328,9 +330,10 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* set in parent debug group. See @ref DebugGroup documentation |
|
|
|
* set in parent debug group. See @ref DebugGroup documentation |
|
|
|
* for more information. |
|
|
|
* for more information. |
|
|
|
* |
|
|
|
* |
|
|
|
* If OpenGL 4.3 is not supported and @extension{KHR,debug} desktop or |
|
|
|
* If OpenGL 4.3 / OpenGL ES 3.2 is not supported and @extension{KHR,debug} |
|
|
|
* ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* desktop or ES extension (covered also by |
|
|
|
* is not available, this function does nothing. |
|
|
|
* @extension{ANDROID,extension_pack_es31a}) is not available, this |
|
|
|
|
|
|
|
* function does nothing. |
|
|
|
* @see @ref Renderer::Feature::DebugOutput, |
|
|
|
* @see @ref Renderer::Feature::DebugOutput, |
|
|
|
* @fn_gl_keyword{DebugMessageControl} |
|
|
|
* @fn_gl_keyword{DebugMessageControl} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -382,10 +385,10 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
* @brief Set debug message callback |
|
|
|
* @brief Set debug message callback |
|
|
|
* |
|
|
|
* |
|
|
|
* The messages are sent to the callback only if |
|
|
|
* The messages are sent to the callback only if |
|
|
|
* @ref Renderer::Feature::DebugOutput is enabled. If OpenGL 4.3 is not |
|
|
|
* @ref Renderer::Feature::DebugOutput is enabled. If OpenGL 4.3 / |
|
|
|
* supported and @extension{KHR,debug} desktop or ES extension (covered |
|
|
|
* OpenGL ES 3.2 is not supported and @extension{KHR,debug} desktop or |
|
|
|
* also by @extension{ANDROID,extension_pack_es31a}) is not |
|
|
|
* ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* available, this function does nothing. |
|
|
|
* is not available, this function does nothing. |
|
|
|
* @see @ref setDefaultCallback(), |
|
|
|
* @see @ref setDefaultCallback(), |
|
|
|
* @ref Renderer::Feature::DebugOutputSynchronous, |
|
|
|
* @ref Renderer::Feature::DebugOutputSynchronous, |
|
|
|
* @fn_gl_keyword{DebugMessageCallback} |
|
|
|
* @fn_gl_keyword{DebugMessageCallback} |
|
|
|
@ -416,10 +419,20 @@ class MAGNUM_EXPORT DebugOutput { |
|
|
|
private: |
|
|
|
private: |
|
|
|
static void setEnabledInternal(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled); |
|
|
|
static void setEnabledInternal(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled); |
|
|
|
static MAGNUM_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool); |
|
|
|
static MAGNUM_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool); |
|
|
|
static MAGNUM_LOCAL void controlImplementationKhr(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled); |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void controlImplementationKhrDesktopES32(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void controlImplementationKhrES(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static MAGNUM_LOCAL void callbackImplementationNoOp(Callback, const void*); |
|
|
|
static MAGNUM_LOCAL void callbackImplementationNoOp(Callback, const void*); |
|
|
|
static MAGNUM_LOCAL void callbackImplementationKhr(Callback callback, const void* userParam); |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void callbackImplementationKhrDesktopES32(Callback callback, const void* userParam); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void callbackImplementationKhrES(Callback callback, const void* userParam); |
|
|
|
|
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Source} */ |
|
|
|
/** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Source} */ |
|
|
|
@ -442,10 +455,11 @@ gDEBugger. |
|
|
|
|
|
|
|
|
|
|
|
See @ref DebugOutput for introduction. |
|
|
|
See @ref DebugOutput for introduction. |
|
|
|
|
|
|
|
|
|
|
|
If OpenGL 4.3 is supported or @extension{KHR,debug} desktop or ES extension |
|
|
|
If OpenGL 4.3 / OpenGL ES 3.2 is supported or @extension{KHR,debug} desktop or |
|
|
|
(covered also by @extension{ANDROID,extension_pack_es31a}) is available and |
|
|
|
ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) is |
|
|
|
default debug output callback is enabled for given kind of messages, the |
|
|
|
available and default debug output callback is enabled for given kind of |
|
|
|
inserted message will be printed on standard output in the following form: |
|
|
|
messages, the inserted message will be printed on standard output in the |
|
|
|
|
|
|
|
following form: |
|
|
|
|
|
|
|
|
|
|
|
@code{.cpp} |
|
|
|
@code{.cpp} |
|
|
|
DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, |
|
|
|
DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, |
|
|
|
@ -488,7 +502,7 @@ class MAGNUM_EXPORT DebugMessage { |
|
|
|
* External debugger or third-party middleware |
|
|
|
* External debugger or third-party middleware |
|
|
|
* @m_keywords{GL_DEBUG_SOURCE_THIRD_PARTY} |
|
|
|
* @m_keywords{GL_DEBUG_SOURCE_THIRD_PARTY} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
#else |
|
|
|
#else |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
@ -498,10 +512,10 @@ class MAGNUM_EXPORT DebugMessage { |
|
|
|
* The application |
|
|
|
* The application |
|
|
|
* @m_keywords{GL_DEBUG_SOURCE_APPLICATION} |
|
|
|
* @m_keywords{GL_DEBUG_SOURCE_APPLICATION} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION, |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION |
|
|
|
#else |
|
|
|
#else |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR, |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
@ -513,49 +527,49 @@ class MAGNUM_EXPORT DebugMessage { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
enum class Type: GLenum { |
|
|
|
enum class Type: GLenum { |
|
|
|
/** OpenGL error */ |
|
|
|
/** OpenGL error */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Error = GL_DEBUG_TYPE_ERROR, |
|
|
|
Error = GL_DEBUG_TYPE_ERROR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Error = GL_DEBUG_TYPE_ERROR_KHR, |
|
|
|
Error = GL_DEBUG_TYPE_ERROR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Behavior that has been marked for deprecation */ |
|
|
|
/** Behavior that has been marked for deprecation */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR, |
|
|
|
DeprecatedBehavior = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Behavior that is undefined according to the specification */ |
|
|
|
/** Behavior that is undefined according to the specification */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, |
|
|
|
#else |
|
|
|
#else |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR, |
|
|
|
UndefinedBehavior = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Non-portable usage of extensions or shaders */ |
|
|
|
/** Non-portable usage of extensions or shaders */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY, |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY_KHR, |
|
|
|
Portability = GL_DEBUG_TYPE_PORTABILITY_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Implementation-dependent performance warning */ |
|
|
|
/** Implementation-dependent performance warning */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE, |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE_KHR, |
|
|
|
Performance = GL_DEBUG_TYPE_PERFORMANCE_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Annotation of the command stream */ |
|
|
|
/** Annotation of the command stream */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER, |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER, |
|
|
|
#else |
|
|
|
#else |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER_KHR, |
|
|
|
Marker = GL_DEBUG_TYPE_MARKER_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Any other type */ |
|
|
|
/** Any other type */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Other = GL_DEBUG_TYPE_OTHER |
|
|
|
Other = GL_DEBUG_TYPE_OTHER |
|
|
|
#else |
|
|
|
#else |
|
|
|
Other = GL_DEBUG_TYPE_OTHER_KHR |
|
|
|
Other = GL_DEBUG_TYPE_OTHER_KHR |
|
|
|
@ -570,9 +584,9 @@ class MAGNUM_EXPORT DebugMessage { |
|
|
|
* @param severity Message severity |
|
|
|
* @param severity Message severity |
|
|
|
* @param string The actual message |
|
|
|
* @param string The actual message |
|
|
|
* |
|
|
|
* |
|
|
|
* If OpenGL 4.3 is not supported and neither @extension{KHR,debug} |
|
|
|
* If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither |
|
|
|
* (covered also by @extension{ANDROID,extension_pack_es31a}) nor |
|
|
|
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{EXT,debug_marker} (desktop or ES extensions) nor |
|
|
|
* nor @extension{EXT,debug_marker} (desktop or ES extensions) nor |
|
|
|
* @extension{GREMEDY,string_marker} (desktop only extension) are |
|
|
|
* @extension{GREMEDY,string_marker} (desktop only extension) are |
|
|
|
* available, this function does nothing. |
|
|
|
* available, this function does nothing. |
|
|
|
* |
|
|
|
* |
|
|
|
@ -599,7 +613,12 @@ class MAGNUM_EXPORT DebugMessage { |
|
|
|
private: |
|
|
|
private: |
|
|
|
static void insertInternal(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string); |
|
|
|
static void insertInternal(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string); |
|
|
|
static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>); |
|
|
|
static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>); |
|
|
|
static MAGNUM_LOCAL void insertImplementationKhr(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string); |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void insertImplementationKhrDesktopES32(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void insertImplementationKhrES(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string); |
|
|
|
|
|
|
|
#endif |
|
|
|
static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string); |
|
|
|
static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string); |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string); |
|
|
|
static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string); |
|
|
|
@ -653,11 +672,11 @@ Renderer::disable(Renderer::Feature::Blending); |
|
|
|
group.pop(); |
|
|
|
group.pop(); |
|
|
|
@endcode |
|
|
|
@endcode |
|
|
|
|
|
|
|
|
|
|
|
If OpenGL 4.3 is supported or @extension{KHR,debug} desktop or ES extension |
|
|
|
If OpenGL 4.3 / OpenGL ES 3.2 is supported or @extension{KHR,debug} desktop or |
|
|
|
(covered also by @extension{ANDROID,extension_pack_es31a}) is available and |
|
|
|
ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) is |
|
|
|
the default debug output callback is enabled for these kinds of messages, the |
|
|
|
available and the default debug output callback is enabled for these kinds of |
|
|
|
group entering and leaving will be printed on standard output in the following |
|
|
|
messages, the group entering and leaving will be printed on standard output in |
|
|
|
form: |
|
|
|
the following form: |
|
|
|
|
|
|
|
|
|
|
|
@code{.shell-session} |
|
|
|
@code{.shell-session} |
|
|
|
Debug output: application debug group enter (42): Scene rendering |
|
|
|
Debug output: application debug group enter (42): Scene rendering |
|
|
|
@ -667,8 +686,8 @@ Debug output: application debug group leave (42): Scene rendering |
|
|
|
If only @extension{EXT,debug_marker} is available, the group can be seen only |
|
|
|
If only @extension{EXT,debug_marker} is available, the group can be seen only |
|
|
|
through graphics debugger. |
|
|
|
through graphics debugger. |
|
|
|
|
|
|
|
|
|
|
|
If OpenGL 4.3 is not supported and neither @extension{KHR,debug} nor |
|
|
|
If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither @extension{KHR,debug} |
|
|
|
@extension{EXT,debug_marker} are available, the functions are essentially a |
|
|
|
nor @extension{EXT,debug_marker} are available, the functions are essentially a |
|
|
|
no-op. |
|
|
|
no-op. |
|
|
|
|
|
|
|
|
|
|
|
@attention To avoid accidental debug group stack overflow/underflow, you cannot |
|
|
|
@attention To avoid accidental debug group stack overflow/underflow, you cannot |
|
|
|
@ -708,14 +727,14 @@ class MAGNUM_EXPORT DebugGroup { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
enum class Source: GLenum { |
|
|
|
enum class Source: GLenum { |
|
|
|
/** External debugger or third-party middleware */ |
|
|
|
/** External debugger or third-party middleware */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY, |
|
|
|
#else |
|
|
|
#else |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** The application */ |
|
|
|
/** The application */ |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION |
|
|
|
#else |
|
|
|
#else |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR |
|
|
|
Application = GL_DEBUG_SOURCE_APPLICATION_KHR |
|
|
|
@ -726,9 +745,10 @@ class MAGNUM_EXPORT DebugGroup { |
|
|
|
* @brief Max debug group stack depth |
|
|
|
* @brief Max debug group stack depth |
|
|
|
* |
|
|
|
* |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* The result is cached, repeated queries don't result in repeated |
|
|
|
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug} |
|
|
|
* OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and |
|
|
|
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{KHR,debug} desktop or ES extension (covered also by |
|
|
|
* is not available, returns @cpp 0 @ce. |
|
|
|
* @extension{ANDROID,extension_pack_es31a}) is not available, returns |
|
|
|
|
|
|
|
* `0`. |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_GROUP_STACK_DEPTH} |
|
|
|
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_GROUP_STACK_DEPTH} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static Int maxStackDepth(); |
|
|
|
static Int maxStackDepth(); |
|
|
|
@ -770,9 +790,9 @@ class MAGNUM_EXPORT DebugGroup { |
|
|
|
* @ref DebugOutput::Type::PushGroup and |
|
|
|
* @ref DebugOutput::Type::PushGroup and |
|
|
|
* @ref DebugOutput::Severity::Notification. |
|
|
|
* @ref DebugOutput::Severity::Notification. |
|
|
|
* |
|
|
|
* |
|
|
|
* If OpenGL 4.3 is not supported and neither @extension{KHR,debug} |
|
|
|
* If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither |
|
|
|
* (covered also by @extension{ANDROID,extension_pack_es31a}) nor |
|
|
|
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{EXT,debug_marker} is available, this function does |
|
|
|
* nor @extension{EXT,debug_marker} is available, this function does |
|
|
|
* nothing. If @extension{KHR,debug} is not available and only |
|
|
|
* nothing. If @extension{KHR,debug} is not available and only |
|
|
|
* @extension{EXT,debug_marker} is available, only @p message is used |
|
|
|
* @extension{EXT,debug_marker} is available, only @p message is used |
|
|
|
* and all other parameters are ignored. |
|
|
|
* and all other parameters are ignored. |
|
|
|
@ -799,9 +819,9 @@ class MAGNUM_EXPORT DebugGroup { |
|
|
|
* @ref DebugOutput::Type::PopGroup and |
|
|
|
* @ref DebugOutput::Type::PopGroup and |
|
|
|
* @ref DebugOutput::Severity::Notification. |
|
|
|
* @ref DebugOutput::Severity::Notification. |
|
|
|
* |
|
|
|
* |
|
|
|
* If OpenGL 4.3 is not supported and neither @extension{KHR,debug} |
|
|
|
* If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither |
|
|
|
* (covered also by @extension{ANDROID,extension_pack_es31a}) nor |
|
|
|
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a}) |
|
|
|
* @extension{EXT,debug_marker} is available, this function does |
|
|
|
* nor @extension{EXT,debug_marker} is available, this function does |
|
|
|
* nothing. |
|
|
|
* nothing. |
|
|
|
* @see @ref push(), @ref Renderer::Error::StackUnderflow, |
|
|
|
* @see @ref push(), @ref Renderer::Error::StackUnderflow, |
|
|
|
* @fn_gl_keyword{PopDebugGroup} or |
|
|
|
* @fn_gl_keyword{PopDebugGroup} or |
|
|
|
@ -813,11 +833,21 @@ class MAGNUM_EXPORT DebugGroup { |
|
|
|
void pushInternal(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
void pushInternal(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
|
|
|
|
|
|
|
|
static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
static MAGNUM_LOCAL void pushImplementationKhr(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void pushImplementationKhrDesktopES32(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void pushImplementationKhrES(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
|
|
|
|
#endif |
|
|
|
static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView<const char> message); |
|
|
|
|
|
|
|
|
|
|
|
static MAGNUM_LOCAL void popImplementationNoOp(); |
|
|
|
static MAGNUM_LOCAL void popImplementationNoOp(); |
|
|
|
static MAGNUM_LOCAL void popImplementationKhr(); |
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void popImplementationKhrDesktopES32(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
|
|
|
static MAGNUM_LOCAL void popImplementationKhrES(); |
|
|
|
|
|
|
|
#endif |
|
|
|
static MAGNUM_LOCAL void popImplementationExt(); |
|
|
|
static MAGNUM_LOCAL void popImplementationExt(); |
|
|
|
|
|
|
|
|
|
|
|
bool _active; |
|
|
|
bool _active; |
|
|
|
|