This extension allows the GL to notify applications when various events occur that may be useful during application development and debugging.
These events are represented in the form of enumerable messages with a human-readable string representation. Examples of debug events include incorrect use of the GL, warnings of undefined behavior, and performance warnings.
A message is uniquely identified by a source, a type and an implementation-dependent ID within the source and type pair.
A message's source identifies the origin of the message and can either describe components of the GL, the window system, third-party external sources such as external debuggers, or even the application itself.
The type of the message roughly identifies the nature of the event that caused the message. Examples include errors, performance warnings, or warnings about undefined behavior.
A message's ID for a given source and type further distinguishes messages within those groups. For example, an error caused by a negative parameter value or an invalid internal texture format are both errors generated by the API, but would likely have different message IDs.
Each message is also assigned to a severity level that denotes roughly how "important" that message is in comparison to other messages across all sources and types. For example, notification of a GL error would likely have a higher severity than a performance warning due to redundant state changes.
Finally, every message contains an implementation-dependent string representation that provides a useful description of the event.
Messages are communicated to the application through an application-defined callback function that is called by the GL implementation on each debug message. The motivation for the callback routine is to free application developers from actively having to query whether a GL error, or any other debuggable event has happened after each call to a GL function. With a callback, developers can keep their code free of debug checks, and only have to react to messages as they occur. In situations where using a callback is not possible, a message log is also provided that stores copies of recent messages until they are actively queried.
To control the volume of debug output, messages can be disabled either individually by ID, or entire groups of messages can be turned off based on combination of source and type.
The only requirement on the minimum quantity and type of messages that implementations of this extension must support is that some sort of message must be sent notifying the application whenever any GL error occurs. Any further messages are left to the implementation. Implementations do not have to output messages from all sources nor do they have to use all types of messages listed by this extension, and both new sources and types can be added by other extensions.
For performance reasons it is recommended, but not required, that implementations restrict supporting this extension only to contexts created using the
debug flag as provided by WGL_ARB_create_context or GLX_ARB_create_context. This extension places no limits on any other functionality
provided by debug contexts through other extensions.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_DEBUG_CALLBACK_FUNCTION_ARB
Tokens accepted by the |
| public static final int | GL_DEBUG_CALLBACK_USER_PARAM_ARB
Tokens accepted by the |
| public static final int | GL_DEBUG_LOGGED_MESSAGES_ARB
Tokens accepted by the |
| public static final int | GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB
Tokens accepted by the |
| public static final int | GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB
Tokens accepted by the |
| public static final int | GL_DEBUG_SEVERITY_HIGH_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SEVERITY_LOW_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SEVERITY_MEDIUM_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_API_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_APPLICATION_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_OTHER_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_SHADER_COMPILER_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_THIRD_PARTY_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_ERROR_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_OTHER_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_PERFORMANCE_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_PORTABILITY_ARB
Tokens accepted or provided by the |
| public static final int | GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB
Tokens accepted or provided by the |
| public static final int | GL_MAX_DEBUG_LOGGED_MESSAGES_ARB
Tokens accepted by the |
| public static final int | GL_MAX_DEBUG_MESSAGE_LENGTH_ARB
Tokens accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | |||||
|---|---|---|---|---|---|---|
| public static void | glDebugMessageCallbackARB(GLDebugMessageARBCallbackI
a callback function that will be called when a debug message is generated callback, long a user supplied pointer that will be passed on each invocation of userParam)callbackSpecifies a callback function for receiving debug messages. | |||||
| public static void | glDebugMessageControlARB(int source, int type, int
the message severity level. One of: severity, IntBuffer
the message IDs to enable or disable ids, boolean whether to enable or disable the references subset of messages enabled)Controls the volume of debug output by disabling specific or groups of messages. | |||||
| public static void | glDebugMessageControlARB(int source, int type, int
the message severity level. One of: severity, int id, boolean
whether to enable or disable the references subset of messages enabled)Controls the volume of debug output by disabling specific or groups of messages. | |||||
| public static void | glDebugMessageControlARB(int source, int type, int severity, int[] ids, boolean enabled)
Array version of: | |||||
| public static void | glDebugMessageInsertARB(int
the message source. One of: source, int type, int
the message ID id, int the message severity level. One of: severity, ByteBuffer
the string representation of the message buf)This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or signals about specific render system events. | |||||
| public static void | glDebugMessageInsertARB(int
the message source. One of: source, int type, int
the message ID id, int the message severity level. One of: severity, CharSequence
the string representation of the message buf)This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or signals about specific render system events. | |||||
| public static int | glGetDebugMessageLogARB(int
the number of debug messages to retrieve from the log count, IntBuffer a buffer in which to place the returned message sources sources, IntBuffer a buffer in which to place the returned message typesd types, IntBuffer a buffer in which to place the returned message IDs ids, IntBuffer a buffer in which to place the returned message severity levels severities, IntBuffer a buffer in which to place the returned message lengths lengths, ByteBuffer a buffer in which to place the returned messages messageLog)When no debug callback is set, debug messages are stored in a debug message log. | |||||
| public static int | glGetDebugMessageLogARB(int count, int[] sources, int[] types, int[] ids, int[] severities, int[] lengths, ByteBuffer messageLog)
Array version of: | |||||
| public static native void | ||||||
| public static native void | nglDebugMessageControlARB(int source, int type, int severity, int
the number of message IDs in count, long ids, boolean enabled)idsUnsafe version of: | |||||
| public static native void | nglDebugMessageInsertARB(int source, int type, int id, int severity, int
the number of characters in length, long buf)buf. If negative, it is implied that buf contains a null terminated string.Unsafe version of: | |||||
| public static native int | nglGetDebugMessageLogARB(int count, int
the maximum number of characters that can be written in the bufSize, long sources, long types, long ids, long severities, long lengths, long messageLog)messageLog arrayUnsafe version of: |
| GL_DEBUG_CALLBACK_FUNCTION_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_CALLBACK_FUNCTION_ARB Tokens accepted by the | |
| GL_DEBUG_CALLBACK_USER_PARAM_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_CALLBACK_USER_PARAM_ARB Tokens accepted by the | |
| GL_DEBUG_LOGGED_MESSAGES_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_LOGGED_MESSAGES_ARB Tokens accepted by the | |
| GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB Tokens accepted by the | |
| GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB Tokens accepted by the The behavior of how and when the GL driver is allowed to generate debug messages, and subsequently either call back to the application or place the
message in the debug message log, is affected by the state DEBUG_OUTPUT_SYNCHRONOUS_ARB. This state can be modified by the When DEBUG_OUTPUT_SYNCHRONOUS_ARB is disabled, the driver is optionally allowed to concurrently call the debug callback routine from potentially
multiple threads, including threads that the context that generated the message is not currently bound to. The implementation may also call the callback
routine asynchronously after the GL command that generated the message has already returned. The application is fully responsible for ensuring thread
safety due to debug callbacks under these circumstances. In this situation the When DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled, the driver guarantees synchronous calls to the callback routine by the context. When synchronous callbacks are enabled, all calls to the callback routine will be made by the thread that owns the current context; all such calls will be made serially by the current context; and each call will be made before the GL command that generated the debug message is allowed to return. When no callback is specified and DEBUG_OUTPUT_SYNCHRONOUS_ARB is disabled, the driver can still asynchronously place messages in the debug message log, even after the context thread has returned from the GL function that generated those messages. When DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled, the driver guarantees that all messages are added to the log before the GL function returns. Enabling synchronous debug output greatly simplifies the responsibilities of the application for making its callback functions thread-safe, but may potentially result in drastically reduced driver performance. The DEBUG_OUTPUT_SYNCHRONOUS_ARB only guarantees intra-context synchronization for the callbacks of messages generated by that context, and does not guarantee synchronization across multiple contexts. If multiple contexts are concurrently used by the application, it is allowed for those contexts to also concurrently call their designated callbacks, and the application is responsible for handling thread safety in that situation even if DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled in all contexts. | |
| GL_DEBUG_SEVERITY_HIGH_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SEVERITY_HIGH_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SEVERITY_LOW_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SEVERITY_LOW_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SEVERITY_MEDIUM_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SEVERITY_MEDIUM_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_API_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_API_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_APPLICATION_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_APPLICATION_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_OTHER_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_OTHER_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_SHADER_COMPILER_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_SHADER_COMPILER_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_THIRD_PARTY_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_THIRD_PARTY_ARB Tokens accepted or provided by the | |
| GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_ERROR_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_ERROR_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_OTHER_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_OTHER_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_PERFORMANCE_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_PERFORMANCE_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_PORTABILITY_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_PORTABILITY_ARB Tokens accepted or provided by the | |
| GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB | back to summary |
|---|---|
| public static final int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB Tokens accepted or provided by the | |
| GL_MAX_DEBUG_LOGGED_MESSAGES_ARB | back to summary |
|---|---|
| public static final int GL_MAX_DEBUG_LOGGED_MESSAGES_ARB Tokens accepted by the | |
| GL_MAX_DEBUG_MESSAGE_LENGTH_ARB | back to summary |
|---|---|
| public static final int GL_MAX_DEBUG_MESSAGE_LENGTH_ARB Tokens accepted by the | |
| ARBDebugOutput | back to summary |
|---|---|
| protected ARBDebugOutput() | |
| glDebugMessageCallbackARB | back to summary |
|---|---|
| public static void glDebugMessageCallbackARB(GLDebugMessageARBCallbackI callback, long userParam) Specifies a callback function for receiving debug messages. This function's prototype must follow the type definition of DEBUGPROCARB including its platform-dependent calling convention. Anything else will result
in undefined behavior. Only one debug callback can be specified for the current context, and further calls overwrite the previous callback. Specifying
If the application has specified a callback function for receiving debug output, the implementation will call that function whenever any enabled message
is generated. The source, type, ID, and severity of the message are specified by the DEBUGPROCARB parameters Applications can query the current callback function and the current user-specified parameter by obtaining the values of Applications that specify a callback function must be aware of certain special conditions when executing code inside a callback when it is called by the GL, regardless of the debug source. The memory for The behavior of calling any GL or window system function from within the callback function is undefined and may lead to program termination. Care must also be taken in securing debug callbacks for use with asynchronous debug output by multi-threaded GL implementations. If Each context stores its own message log and will only store messages generated by commands operating in that context. If the message log fills up, then any subsequently generated messages will not be placed in the log until the message log is cleared, and will instead be discarded. Applications can query the number of messages currently in the log by obtaining the value of
| |
| glDebugMessageControlARB | back to summary | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void glDebugMessageControlARB(int source, int type, int severity, IntBuffer ids, boolean enabled) Controls the volume of debug output by disabling specific or groups of messages. If This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following ways:
Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a single call, and individually disabling all messages from that source using their types and IDs.
| ||||||||||||||||
| glDebugMessageControlARB | back to summary | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void glDebugMessageControlARB(int source, int type, int severity, int id, boolean enabled) Controls the volume of debug output by disabling specific or groups of messages. If This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following ways:
Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a single call, and individually disabling all messages from that source using their types and IDs.
| ||||||||||||||||
| glDebugMessageControlARB | back to summary |
|---|---|
| public static void glDebugMessageControlARB(int source, int type, int severity, int[] ids, boolean enabled) Array version of: | |
| glDebugMessageInsertARB | back to summary | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void glDebugMessageInsertARB(int source, int type, int id, int severity, ByteBuffer buf) This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or signals about specific render system events. The error
| ||||||||||||
| glDebugMessageInsertARB | back to summary | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void glDebugMessageInsertARB(int source, int type, int id, int severity, CharSequence buf) This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or signals about specific render system events. The error
| ||||||||||||
| glGetDebugMessageLogARB | back to summary |
|---|---|
| public static int glGetDebugMessageLogARB(int count, IntBuffer sources, IntBuffer types, IntBuffer ids, IntBuffer severities, IntBuffer lengths, ByteBuffer messageLog) When no debug callback is set, debug messages are stored in a debug message log. Messages can be queried from the log by calling this function. This function fetches a maximum of Messages will be fetched from the log in order of oldest to newest. Those messages that were fetched will be removed from the log. The sources, types, severities, IDs, and string lengths of fetched messages will be stored in the application-provided arrays Any or all of the arrays
| |
| glGetDebugMessageLogARB | back to summary |
|---|---|
| public static int glGetDebugMessageLogARB(int count, int[] sources, int[] types, int[] ids, int[] severities, int[] lengths, ByteBuffer messageLog) Array version of:
| |
| nglDebugMessageCallbackARB | back to summary |
|---|---|
| public static native void nglDebugMessageCallbackARB(long callback, long userParam) Unsafe version of: | |
| nglDebugMessageControlARB | back to summary |
|---|---|
| public static native void nglDebugMessageControlARB(int source, int type, int severity, int count, long ids, boolean enabled) Unsafe version of:
| |
| nglDebugMessageInsertARB | back to summary |
|---|---|
| public static native void nglDebugMessageInsertARB(int source, int type, int id, int severity, int length, long buf) Unsafe version of:
| |
| nglGetDebugMessageLogARB | back to summary |
|---|---|
| public static native int nglGetDebugMessageLogARB(int count, int bufSize, long sources, long types, long ids, long severities, long lengths, long messageLog) Unsafe version of:
| |