Top Description Fields Constructors Methods
org.lwjgl.opengles

public Class KHRDebug

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the KHR_debug extension.

This extension allows the GL to notify applications when various events occur that may be useful during application development, debugging and profiling.

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, warnings about undefined behavior or notifications identifying that the application is within a specific section of the application code.

A message's ID for a given source and type further distinguishes messages within namespaces. 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.

Furthermore, 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, set breakpoints in the callback function, 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 only 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 sets of messages can be turned off based on combination of source and type, through the entire application code or only section of the code encapsulated in debug groups. A debug group may also be used to annotate the command stream using descriptive texts.

This extension also defines debug markers, a mechanism for the OpenGL application to annotate the command stream with markers for discrete events.

When profiling or debugging an OpenGL application with a built-in or an external debugger or profiler, it is difficult to relate the commands within the command stream to the elements of the scene or parts of the program code to which they correspond. Debug markers and debug groups help obviate this by allowing applications to specify this link. For example, a debug marker can be used to identify the beginning of a frame in the command stream and a debug group can encapsulate a specific command stream to identify a rendering pass. Debug groups also allow control of the debug outputs volume per section of an application code providing an effective way to handle the massive amount of debug outputs that drivers can generate.

Some existing implementations of ARB_debug_output only expose the ARB_debug_output extension string if the context was created with the debug flag {GLX|WGL}_CONTEXT_DEBUG_BIT_ARB as specified in {GLX|WGL}_ARB_create_context. The behavior is not obvious when the functionality is brought into the OpenGL core specification because the extension string and function entry points must always exist.

This extension modifies the existing ARB_debug_output extension to allow implementations to always have an empty message log. The specific messages written to the message log or callback routines are already implementation defined, so this specification simply makes it explicit that it's fine for there to be zero messages generated, even when a GL error occurs, which is useful if the context is non-debug.

Debug output can be enabled and disabled by changing the DEBUG_OUTPUT_KHR state.

Finally, this extension defines a mechanism for OpenGL applications to label their objects (textures, buffers, shaders, etc.) with a descriptive string.

When profiling or debugging an OpenGL application within an external or built-in (debut output API) debugger or profiler it is difficult to identify objects from their object names (integers).

Even when the object itself is viewed it can be problematic to differentiate between similar objects. Attaching a descriptive string, a label, to an object obviates this difficulty.

The intended purpose of this extension is purely to improve the user experience within OpenGL development tools and application built-in profilers and debuggers. This extension typically improves OpenGL programmers efficiency by allowing them to instantly detect issues and the reason for these issues giving him more time to focus on adding new features to an OpenGL application.

Field Summary

Modifier and TypeField and Description
public static final int
GL_BUFFER_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_CONTEXT_FLAG_DEBUG_BIT_KHR

Returned by GetIntegerv when pname is CONTEXT_FLAGS.

public static final int
GL_DEBUG_CALLBACK_FUNCTION_KHR

Tokens accepted by the pname parameter of GetPointerv.

public static final int
GL_DEBUG_CALLBACK_USER_PARAM_KHR

Tokens accepted by the pname parameter of GetPointerv.

public static final int
GL_DEBUG_GROUP_STACK_DEPTH_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_DEBUG_LOGGED_MESSAGES_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_DEBUG_OUTPUT_KHR

Tokens accepted by the target parameters of Enable, Disable, and IsEnabled.

public static final int
GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR

Tokens accepted by the target parameters of Enable, Disable, and IsEnabled.

public static final int
GL_DEBUG_SEVERITY_HIGH_KHR

Tokens accepted or provided by the severity parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the severities parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SEVERITY_LOW_KHR

Tokens accepted or provided by the severity parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the severities parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SEVERITY_MEDIUM_KHR

Tokens accepted or provided by the severity parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the severities parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SEVERITY_NOTIFICATION_KHR

Tokens accepted or provided by the severity parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the severities parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_API_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_APPLICATION_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_OTHER_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_SHADER_COMPILER_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_THIRD_PARTY_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR

Tokens accepted or provided by the source parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the sources parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_ERROR_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_MARKER_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_OTHER_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_PERFORMANCE_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_POP_GROUP_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_PORTABILITY_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_PUSH_GROUP_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR

Tokens accepted or provided by the type parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the types parameter of GetDebugMessageLog.

public static final int
GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_MAX_DEBUG_LOGGED_MESSAGES_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_MAX_DEBUG_MESSAGE_LENGTH_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_MAX_LABEL_LENGTH_KHR

Tokens accepted by the value parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v.

public static final int
GL_PROGRAM_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_PROGRAM_PIPELINE_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_QUERY_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_SAMPLER_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_SHADER_KHR

Tokens accepted or provided by the identifier parameters of ObjectLabel and GetObjectLabel.

public static final int
GL_STACK_OVERFLOW_KHR

Returned by GetError.

public static final int
GL_STACK_UNDERFLOW_KHR

Returned by GetError.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glDebugMessageCallbackKHR(GLDebugMessageKHRCallbackI
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 callback
userParam
)

Specifies a callback to receive debugging messages from the GL.

public static void
glDebugMessageControlKHR(int source, int type, int severity, IntBuffer
an array of unsigned integers containing the ids of the messages to enable or disable
ids
,
boolean
whether the selected messages should be enabled or disabled
enabled
)

Controls the volume of debug output in the active debug group, by disabling specific or groups of messages.

public static void
glDebugMessageControlKHR(int source, int type, int severity, int id, boolean
whether the selected messages should be enabled or disabled
enabled
)

Controls the volume of debug output in the active debug group, by disabling specific or groups of messages.

public static void
glDebugMessageControlKHR(int source, int type, int severity, int[] ids, boolean enabled)

Array version of: DebugMessageControlKHR

public static void
glDebugMessageInsertKHR(int source, int type, int id, int
the severity of the debug messages to insert
severity
,
ByteBuffer
a character array containing the message to insert
message
)

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
glDebugMessageInsertKHR(int source, int type, int id, int
the severity of the debug messages to insert
severity
,
CharSequence
a character array containing the message to insert
message
)

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
glGetDebugMessageLogKHR(int
the number of debug messages to retrieve from the log
count
,
IntBuffer
an array of variables to receive the sources of the retrieved messages
sources
,
IntBuffer
an array of variables to receive the types of the retrieved messages
types
,
IntBuffer
an array of unsigned integers to receive the ids of the retrieved messages
ids
,
IntBuffer
an array of variables to receive the severites of the retrieved messages
severities
,
IntBuffer
an array of variables to receive the lengths of the received messages
lengths
,
ByteBuffer
an array of characters that will receive the messages
messageLog
)

Retrieves messages from the debug message log.

public static int
glGetDebugMessageLogKHR(int count, int[] sources, int[] types, int[] ids, int[] severities, int[] lengths, ByteBuffer messageLog)

Array version of: GetDebugMessageLogKHR

public static void
glGetObjectLabelKHR(int identifier, int
the name of the object whose label to retrieve
name
,
IntBuffer
the address of a variable to receive the length of the object label
length
,
ByteBuffer
a string that will receive the object label
label
)

Retrieves the label of a named object identified within a namespace.

public static String
glGetObjectLabelKHR(int identifier, int
the name of the object whose label to retrieve
name
,
int
the length of the buffer whose address is in label
bufSize
)

Retrieves the label of a named object identified within a namespace.

public static String
glGetObjectLabelKHR(int identifier, int
the name of the object whose label to retrieve
name
)

Retrieves the label of a named object identified within a namespace.

public static void
glGetObjectLabelKHR(int identifier, int name, int[] length, ByteBuffer label)

Array version of: GetObjectLabelKHR

public static void
glGetObjectPtrLabelKHR(long
the name of the sync object whose label to retrieve
ptr
,
IntBuffer
a variable to receive the length of the object label
length
,
ByteBuffer
a string that will receive the object label
label
)

Retrieves the label of a sync object identified by a pointer.

public static String
glGetObjectPtrLabelKHR(long
the name of the sync object whose label to retrieve
ptr
,
int
the length of the buffer whose address is in label
bufSize
)

Retrieves the label of a sync object identified by a pointer.

public static String
glGetObjectPtrLabelKHR(long
the name of the sync object whose label to retrieve
ptr
)

Retrieves the label of a sync object identified by a pointer.

public static void
glGetObjectPtrLabelKHR(long ptr, int[] length, ByteBuffer label)

Array version of: GetObjectPtrLabelKHR

public static long
glGetPointerKHR(int pname)

public static void
glGetPointervKHR(int pname, PointerBuffer params)

public static void
glObjectLabelKHR(int identifier, int
the name of the object to label
name
,
ByteBuffer
a string containing the label to assign to the object
label
)

Labels a named object identified within a namespace.

public static void
glObjectLabelKHR(int identifier, int
the name of the object to label
name
,
CharSequence
a string containing the label to assign to the object
label
)

Labels a named object identified within a namespace.

public static void
glObjectPtrLabelKHR(long
a pointer identifying a sync object
ptr
,
ByteBuffer
a string containing the label to assign to the object
label
)

Labels a sync object identified by a pointer.

public static void
glObjectPtrLabelKHR(long
a pointer identifying a sync object
ptr
,
CharSequence
a string containing the label to assign to the object
label
)

Labels a sync object identified by a pointer.

public static native void
glPopDebugGroupKHR()

Pops the active debug group.

public static void
glPushDebugGroupKHR(int
the source of the debug message. One of:
DEBUG_SOURCE_APPLICATION_KHRDEBUG_SOURCE_THIRD_PARTY_KHR
source
,
int
the identifier of the message
id
,
ByteBuffer
a string containing the message to be sent to the debug output stream
message
)

Pushes a debug group described by the string message into the command stream.

public static void
glPushDebugGroupKHR(int
the source of the debug message. One of:
DEBUG_SOURCE_APPLICATION_KHRDEBUG_SOURCE_THIRD_PARTY_KHR
source
,
int
the identifier of the message
id
,
CharSequence
a string containing the message to be sent to the debug output stream
message
)

Pushes a debug group described by the string message into the command stream.

public static native void
nglDebugMessageCallbackKHR(long callback, long userParam)

Unsafe version of: DebugMessageCallbackKHR

public static native void
nglDebugMessageControlKHR(int source, int type, int severity, int
the length of the array ids
count
,
long ids, boolean enabled)

Unsafe version of: DebugMessageControlKHR

public static native void
nglDebugMessageInsertKHR(int source, int type, int id, int severity, int
the length of the string contained in the character array whose address is given by message
length
,
long message)

Unsafe version of: DebugMessageInsertKHR

public static native int
nglGetDebugMessageLogKHR(int count, int
the size of the buffer whose address is given by messageLog
bufsize
,
long sources, long types, long ids, long severities, long lengths, long messageLog)

Unsafe version of: GetDebugMessageLogKHR

public static native void
nglGetObjectLabelKHR(int identifier, int name, int
the length of the buffer whose address is in label
bufSize
,
long length, long label)

Unsafe version of: GetObjectLabelKHR

public static native void
nglGetObjectPtrLabelKHR(long ptr, int
the length of the buffer whose address is in label
bufSize
,
long length, long label)

Unsafe version of: GetObjectPtrLabelKHR

public static native void
nglGetPointervKHR(int pname, long params)

public static native void
nglObjectLabelKHR(int identifier, int name, int
the length of the label to be used for the object
length
,
long label)

Unsafe version of: ObjectLabelKHR

public static native void
nglObjectPtrLabelKHR(long ptr, int
the length of the label to be used for the object
length
,
long label)

Unsafe version of: ObjectPtrLabelKHR

public static native void
nglPushDebugGroupKHR(int source, int id, int
the length of the message to be sent to the debug output stream
length
,
long message)

Unsafe version of: PushDebugGroupKHR

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait