[Mesa-dev] [PATCH 07/14] intel: Hook up the WARN_ONCE macro to GL_ARB_debug_output.

Eric Anholt eric at anholt.net
Fri Feb 22 19:52:16 PST 2013


---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    1 +
 src/mesa/drivers/dri/intel/intel_context.h       |    5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 587ad05..623b99a 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -628,6 +628,7 @@ translate_tex_format(struct intel_context *intel,
 		     GLenum depth_mode,
 		     GLenum srgb_decode)
 {
+   struct gl_context *ctx = &intel->ctx;
    if (srgb_decode == GL_SKIP_DECODE_EXT)
       mesa_format = _mesa_get_srgb_format_linear(mesa_format);
 
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index cae8ecf..ce83bc1 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -474,10 +474,15 @@ extern int INTEL_DEBUG;
 #define WARN_ONCE(cond, fmt...) do {                            \
    if (unlikely(cond)) {                                        \
       static bool _warned = false;                              \
+      static GLuint msg_id = 0;                                 \
       if (!_warned) {                                           \
          fprintf(stderr, "WARNING: ");                          \
          fprintf(stderr, fmt);                                  \
          _warned = true;                                        \
+                                                                \
+         _mesa_gl_debug(ctx, &msg_id,                           \
+                        MESA_DEBUG_TYPE_OTHER,                  \
+                        MESA_DEBUG_SEVERITY_HIGH, fmt);         \
       }                                                         \
    }                                                            \
 } while (0)
-- 
1.7.10.4



More information about the mesa-dev mailing list