Home | History | Annotate | Download | only in main

Lines Matching refs:ctx

177 get_message_state(struct gl_context *ctx, int source, int type,
181 &ctx->Debug.ClientIDs.Namespaces[source][type];
197 if (ctx->Debug.ClientIDs.Defaults[severity][source][type])
228 set_message_state(struct gl_context *ctx, int source, int type,
232 &ctx->Debug.ClientIDs.Namespaces[source][type];
265 should_log(struct gl_context *ctx, GLenum source, GLenum type,
275 return get_message_state(ctx, s, t, sev, id);
280 return ctx->Debug.ApiErrors[id];
282 return ctx->Debug.WinsysErrors[id];
284 return ctx->Debug.ShaderErrors[id];
286 return ctx->Debug.OtherErrors[id];
299 _mesa_log_msg(struct gl_context *ctx, GLenum source, GLenum type,
307 if (!should_log(ctx, source, type, id, severity))
310 if (ctx->Debug.Callback) {
311 ctx->Debug.Callback(source, type, id, severity,
312 len, buf, ctx->Debug.CallbackData);
316 if (ctx->Debug.NumMessages == MAX_DEBUG_LOGGED_MESSAGES)
319 nextEmpty = (ctx->Debug.NextMsg + ctx->Debug.NumMessages)
321 emptySlot = &ctx->Debug.Log[nextEmpty];
345 if (ctx->Debug.NumMessages == 0)
346 ctx->Debug.NextMsgLength = ctx->Debug.Log[ctx->Debug.NextMsg].length;
348 ctx->Debug.NumMessages++;
362 _mesa_get_msg(struct gl_context *ctx, GLenum *source, GLenum *type,
368 if (ctx->Debug.NumMessages == 0)
371 msg = &ctx->Debug.Log[ctx->Debug.NextMsg];
374 assert(length > 0 && length == ctx->Debug.NextMsgLength);
398 ctx->Debug.NumMessages--;
399 ctx->Debug.NextMsg++;
400 ctx->Debug.NextMsg %= MAX_DEBUG_LOGGED_MESSAGES;
401 ctx->Debug.NextMsgLength = ctx->Debug.Log[ctx->Debug.NextMsg].length;
413 validate_params(struct gl_context *ctx, unsigned caller,
473 _mesa_error( ctx, GL_INVALID_ENUM, "bad values passed to %s"
485 GET_CURRENT_CONTEXT(ctx);
487 if (!validate_params(ctx, INSERT, source, type, severity))
494 _mesa_error(ctx, GL_INVALID_VALUE, "glDebugMessageInsertARB"
501 _mesa_log_msg(ctx, source, type, id, severity, length, buf);
509 GET_CURRENT_CONTEXT(ctx);
516 _mesa_error(ctx, GL_INVALID_VALUE, "glGetDebugMessageLogARB"
522 GLsizei written = _mesa_get_msg(ctx, sources, types, ids, severities,
594 control_app_messages_by_group(struct gl_context *ctx, int source, int type,
597 struct gl_client_debug *ClientIDs = &ctx->Debug.ClientIDs;
633 set_message_state(ctx, s, t, entry->ID, enabled);
651 control_app_messages(struct gl_context *ctx, GLenum esource, GLenum etype,
667 set_message_state(ctx, source, type, ids[i], enabled);
672 control_app_messages_by_group(ctx, source, type, severity, enabled);
680 GET_CURRENT_CONTEXT(ctx);
683 _mesa_error(ctx, GL_INVALID_VALUE, "glDebugMessageControlARB"
688 if (!validate_params(ctx, CONTROL, source, type, severity))
693 _mesa_error(ctx, GL_INVALID_OPERATION, "glDebugMessageControlARB"
700 control_app_messages(ctx, source, type, severity, count, ids, enabled);
705 control_messages(ctx->Debug.ApiErrors, API_ERROR_COUNT,
708 control_messages(ctx->Debug.WinsysErrors, WINSYS_ERROR_COUNT,
711 control_messages(ctx->Debug.ShaderErrors, SHADER_ERROR_COUNT,
714 control_messages(ctx->Debug.OtherErrors, OTHER_ERROR_COUNT,
723 GET_CURRENT_CONTEXT(ctx);
724 ctx->Debug.Callback = callback;
725 ctx->Debug.CallbackData = (void *) userParam;
738 _mesa_init_errors(struct gl_context *ctx)
741 struct gl_client_debug *ClientIDs = &ctx->Debug.ClientIDs;
743 ctx->Debug.Callback = NULL;
744 ctx->Debug.SyncOutput = GL_FALSE;
745 ctx->Debug.Log[0].length = 0;
746 ctx->Debug.NumMessages = 0;
747 ctx->Debug.NextMsg = 0;
748 ctx->Debug.NextMsgLength = 0;
751 memset(ctx->Debug.ApiErrors, GL_TRUE, sizeof ctx->Debug.ApiErrors);
752 memset(ctx->Debug.WinsysErrors, GL_TRUE, sizeof ctx->Debug.WinsysErrors);
753 memset(ctx->Debug.ShaderErrors, GL_TRUE, sizeof ctx->Debug.ShaderErrors);
754 memset(ctx->Debug.OtherErrors, GL_TRUE, sizeof ctx->Debug.OtherErrors);
774 _mesa_free_errors_data(struct gl_context *ctx)
777 struct gl_client_debug *ClientIDs = &ctx->Debug.ClientIDs;
887 flush_delayed_errors( struct gl_context *ctx )
891 if (ctx->ErrorDebugCount) {
893 ctx->ErrorDebugCount,
894 error_string(ctx->ErrorValue));
898 ctx->ErrorDebugCount = 0;
907 * \param ctx GL context.
911 _mesa_warning( struct gl_context *ctx, const char *fmtString, ... )
919 if (ctx)
920 flush_delayed_errors( ctx );
930 * \param ctx GL context.
934 _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... )
940 (void) ctx;
955 should_output(struct gl_context *ctx, GLenum error, const char *fmtString)
978 if (ctx->ErrorValue != error ||
979 ctx->ErrorDebugFmtString != fmtString) {
980 flush_delayed_errors( ctx );
981 ctx->ErrorDebugFmtString = fmtString;
982 ctx->ErrorDebugCount = 0;
985 ctx->ErrorDebugCount++;
999 * \param ctx the GL context.
1004 _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
1008 do_output = should_output(ctx, error, fmtString);
1009 do_log = should_log(ctx, GL_DEBUG_SOURCE_API_ARB, GL_DEBUG_TYPE_ERROR_ARB,
1042 _mesa_log_msg(ctx, GL_DEBUG_SOURCE_API_ARB, GL_DEBUG_TYPE_ERROR_ARB,
1048 _mesa_record_error(ctx, error);
1056 * \param ctx GL context.
1060 _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... )
1070 (void) ctx;
1078 * \param ctx GL context.
1085 _mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint id,
1103 _mesa_problem(ctx, "bad enum in _mesa_shader_debug()");
1114 _mesa_log_msg(ctx, source, type, id, severity, len, msg);