[Mesa-dev] [PATCH 07/11] mesa: add message-toggle booleans for GL_ARB_debug_output
Brian Paul
brianp at vmware.com
Tue May 3 16:34:32 PDT 2011
On 05/02/2011 05:00 PM, nobled wrote:
> ---
> src/mesa/main/errors.c | 2 +-
> src/mesa/main/mtypes.h | 32 +++++++++++++++++++++++++++++++-
> 2 files changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c
> index c953fbf..9d74a05 100644
> --- a/src/mesa/main/errors.c
> +++ b/src/mesa/main/errors.c
> @@ -86,7 +86,7 @@ _mesa_log_msg(struct gl_context *ctx, GLenum source,
> GLenum type,
> emptySlot->length = strlen(out_of_memory)+1;
> emptySlot->source = GL_DEBUG_SOURCE_OTHER_ARB;
> emptySlot->type = GL_DEBUG_TYPE_ERROR_ARB;
> - emptySlot->id = 1; /* TODO: proper id namespace */
> + emptySlot->id = OTHER_ERROR_OUT_OF_MEMORY;
> emptySlot->severity = GL_DEBUG_SEVERITY_HIGH_ARB;
> }
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 647c1b7..41f6470 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3169,12 +3169,42 @@ struct gl_debug_msg
> #define _MESA_MAX_DEBUG_LOGGED_MESSAGES 3
> #define _MESA_MAX_DEBUG_MESSAGE_LENGTH 4096
>
> -/* GL_ARB_debug_output */
> +typedef enum {
> +API_ERROR_UNKNOWN,
> +
> +API_ERROR_COUNT
> +} ApiError;
> +
> +typedef enum {
> +WINSYS_ERROR_UNKNOWN,
> +
> +WINSYS_ERROR_COUNT
> +} WinsysError;
> +
> +typedef enum {
> +SHADER_ERROR_UNKNOWN,
> +
> +SHADER_ERROR_COUNT
> +} ShaderError;
> +
> +typedef enum {
> +OTHER_ERROR_UNKNOWN,
> +OTHER_ERROR_OUT_OF_MEMORY,
> +
> +OTHER_ERROR_COUNT
> +} OtherError;
> +
The whitespace there seems off (not sure if it's just Thunderbird).
And the enum names don't follow the pattern of other enums in
mtypes.h. I think these should look like:
typedef enum {
OTHER_ERROR_UNKNOWN,
OTHER_ERROR_OUT_OF_MEMORY,
OTHER_ERROR_COUNT
} gl_other_error;
> struct gl_debug_state
> {
> GLDEBUGPROCARB Callback;
> GLvoid *CallbackData;
> GLboolean SyncOutput;
> + GLboolean ApiErrors[API_ERROR_COUNT];
> + GLboolean WinsysErrors[WINSYS_ERROR_COUNT];
> + GLboolean ShaderErrors[SHADER_ERROR_COUNT];
> + GLboolean OtherErrors[OTHER_ERROR_COUNT];
> + /* TODO: Add an object here that tracks the state of client-provided IDs
> + in the APPLICATION and THIRD_PARTY namespaces. */
> struct gl_debug_msg Log[_MESA_MAX_DEBUG_LOGGED_MESSAGES];
> GLint NumMessages;
> GLint NextMsg;
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list