Difference between revisions of "GLAPI/glGetDebugMessageLog"
m (Bot: Adding better formatting.) |
(Filling out information.) |
||
Line 16: | Line 16: | ||
: The size of the buffer whose address is given by {{param|messageLog}}. | : The size of the buffer whose address is given by {{param|messageLog}}. | ||
; sources | ; sources | ||
− | : The address of an array of variables to receive the sources of the retrieved messages. | + | : The address of an array of variables to receive the sources of the retrieved messages. Each value may be {{enum|GL_DEBUG_SOURCE_API}} (for messages generated by the GL), {{enum|GL_DEBUG_SOURCE_SHADER_COMPILER}} (for messages generated by the GLSL shader compiler of compilers for other extension-provided languages), {{enum|GL_DEBUG_SOURCE_WINDOW_SYSTEM}} (for messages generated by the window system, such as WGL or GLX), {{enum|GL_DEBUG_SOURCE_THIRD_PARTY}} (for messages generated by external debuggers or third-party middle-ware libraries), {{enum|GL_DEBUG_SOURCE_APPLICATION}} (for messages generated by the application, such as through {{apifunc|glDebugMessageInsert}}), or {{enum|GL_DEBUG_SOURCE_OTHER}} (for messages that do not fit to any of the other sources). |
; types | ; types | ||
− | : The address of an array of variables to receive the types of the retrieved messages. | + | : The address of an array of variables to receive the types of the retrieved messages. Each value may be {{enum|GL_DEBUG_TYPE_ERROR}} (for events that generated an error), {{enum|GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR}} (for behaviour that has been marked for deprecation), {{enum|GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR}} (for behaviour that is undefined according to the specification), {{enum|GL_DEBUG_TYPE_PERFORMANCE}} (for implementation-dependent performance warnings), {{enum|GL_DEBUG_TYPE_PORTABILITY}} (for the use of extensions or shaders in a way that is highly vendor-specific), {{enum|GL_DEBUG_TYPE_MARKER}} (for annotation of the command stream), {{enum|GL_DEBUG_TYPE_PUSH_GROUP}} (for entering a debug group with {{apifunc|glPushDebugGroup}}), {{enum|GL_DEBUG_TYPE_POP_GROUP}} (for leaving a debug group with {{apifunc|glPopDebugGroup}}), or {{enum|GL_DEBUG_TYPE_OTHER}} (for events that don't fit any of the ones listed above). |
; ids | ; ids | ||
− | : The address of an array of unsigned integers to receive the | + | : The address of an array of unsigned integers to receive the IDs of the retrieved messages. The assignment of IDs to messages within a namespace is implementation-dependent. Messages can only be uniquely distinguished from each other by the full combination of source, type, and ID. |
; severities | ; severities | ||
− | : The address of an array of variables to receive the | + | : The address of an array of variables to receive the severities of the retrieved messages. Each value may be {{enum|GL_DEBUG_SEVERITY_HIGH}} (for any GL error, dangerous undefined behaviour, or any shader compiler and linker errors), {{enum|GL_DEBUG_SEVERITY_MEDIUM}} (for severe performance warnings, GLSL or other shader compiler and linker warnings, and use of currently deprecated behaviour), {{enum|GL_DEBUG_SEVERITY_LOW}} (for performance warnings from redundant state changes and trivial undefined behaviour), {{enum|GL_DEBUG_SEVERITY_NOTIFICATION}} (for any message which is not an error or performance concern). |
; lengths | ; lengths | ||
: The address of an array of variables to receive the lengths of the received messages. | : The address of an array of variables to receive the lengths of the received messages. | ||
Line 46: | Line 46: | ||
== Associated Gets == | == Associated Gets == | ||
− | {{ | + | {{enumapifunc|glGet|GL_DEBUG_LOGGED_MESSAGES}} |
− | {{ | + | {{enumapifunc|glGet|GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH}} |
− | {{ | + | {{enumapifunc|glGet|GL_MAX_DEBUG_MESSAGE_LENGTH}} |
− | {{ | + | {{enumapifunc|glGet|GL_MAX_DEBUG_LOGGED_MESSAGES}} |
== See Also == | == See Also == |
Latest revision as of 08:19, 5 February 2015
Core in version | 4.6 | |
---|---|---|
Core since version | 4.3 | |
Core ARB extension | KHR_debug |
glGetDebugMessageLog: retrieve messages from the debug message log
Function Definition
GLuint glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum *sources, Glenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
- count
- The number of debug messages to retrieve from the log.
- bufSize
- The size of the buffer whose address is given by messageLog.
- sources
- The address of an array of variables to receive the sources of the retrieved messages. Each value may be GL_DEBUG_SOURCE_API (for messages generated by the GL), GL_DEBUG_SOURCE_SHADER_COMPILER (for messages generated by the GLSL shader compiler of compilers for other extension-provided languages), GL_DEBUG_SOURCE_WINDOW_SYSTEM (for messages generated by the window system, such as WGL or GLX), GL_DEBUG_SOURCE_THIRD_PARTY (for messages generated by external debuggers or third-party middle-ware libraries), GL_DEBUG_SOURCE_APPLICATION (for messages generated by the application, such as through glDebugMessageInsert), or GL_DEBUG_SOURCE_OTHER (for messages that do not fit to any of the other sources).
- types
- The address of an array of variables to receive the types of the retrieved messages. Each value may be GL_DEBUG_TYPE_ERROR (for events that generated an error), GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR (for behaviour that has been marked for deprecation), GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR (for behaviour that is undefined according to the specification), GL_DEBUG_TYPE_PERFORMANCE (for implementation-dependent performance warnings), GL_DEBUG_TYPE_PORTABILITY (for the use of extensions or shaders in a way that is highly vendor-specific), GL_DEBUG_TYPE_MARKER (for annotation of the command stream), GL_DEBUG_TYPE_PUSH_GROUP (for entering a debug group with glPushDebugGroup), GL_DEBUG_TYPE_POP_GROUP (for leaving a debug group with glPopDebugGroup), or GL_DEBUG_TYPE_OTHER (for events that don't fit any of the ones listed above).
- ids
- The address of an array of unsigned integers to receive the IDs of the retrieved messages. The assignment of IDs to messages within a namespace is implementation-dependent. Messages can only be uniquely distinguished from each other by the full combination of source, type, and ID.
- severities
- The address of an array of variables to receive the severities of the retrieved messages. Each value may be GL_DEBUG_SEVERITY_HIGH (for any GL error, dangerous undefined behaviour, or any shader compiler and linker errors), GL_DEBUG_SEVERITY_MEDIUM (for severe performance warnings, GLSL or other shader compiler and linker warnings, and use of currently deprecated behaviour), GL_DEBUG_SEVERITY_LOW (for performance warnings from redundant state changes and trivial undefined behaviour), GL_DEBUG_SEVERITY_NOTIFICATION (for any message which is not an error or performance concern).
- lengths
- The address of an array of variables to receive the lengths of the received messages.
- messageLog
- The address of an array of characters that will receive the messages.
Description
glGetDebugMessageLog retrieves messages from the debug message log. A maximum of count messages are retrieved from the log. If sources is not NULL then the source of each message is written into up to count elements of the array. If types is not NULL then the type of each message is written into up to count elements of the array. If id is not NULL then the identifier of each message is written into up to count elements of the array. If severities is not NULL then the severity of each message is written into up to count elements of the array. If lengths is not NULL then the length of each message is written into up to count elements of the array.
messageLog specifies the address of a character array into which the debug messages will be written. Each message will be concatenated onto the array starting at the first element of messageLog. bufSize specifies the size of the array messageLog. If a message will not fit into the remaining space in messageLog then the function terminates and returns the number of messages written so far, which may be zero.
If glGetDebugMessageLog returns zero then no messages are present in the debug log, or there was not enough space in messageLog to retrieve the first message in the queue. If messageLog is NULL then no messages are written and the value of bufSize is ignored.
Notes
Although debug messages may be enabled in a non-debug context, the quantity and detail of such messages may be substantially inferior to those in a debug context. In particular, a valid implementation of the debug message queue in a non-debug context may produce no messages at all.
Errors
GL_INVALID_VALUE is generated if count or bufSize is negative.
Associated Gets
glGet with argument GL_DEBUG_LOGGED_MESSAGES
glGet with argument GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH
glGet with argument GL_MAX_DEBUG_MESSAGE_LENGTH
glGet with argument GL_MAX_DEBUG_LOGGED_MESSAGES
See Also
glDebugMessageInsert, glDebugMessageCallback, glDebugMessageControl, glPushDebugGroup, glPopDebugGroup
Copyright
Copyright © 2012 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.