intel: Hook up the WARN_ONCE macro to GL_ARB_debug_output.
authorEric Anholt <eric@anholt.net>
Fri, 22 Feb 2013 21:03:51 +0000 (13:03 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 5 Mar 2013 22:25:00 +0000 (14:25 -0800)
This doesn't provide detailed error type information, but it's important
to get these relatively severe but rare error messages out to the
developer through whatever mechanism they are using.

v2: Rebase on new WARN_ONCE additions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp
src/mesa/drivers/dri/intel/intel_context.h

index 5eee364eb7265f1177b2fb037cd661e2ebaed28b..7979487a9002ae89bc40eb9e4d9987edc28258d5 100644 (file)
@@ -630,6 +630,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);
 
index 56e8994dc2499504ea587cfbf984f46cb36e8701..e6b8485c3ed711b0c0c3f1987b500ee1d0c8355e 100644 (file)
@@ -824,6 +824,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw,
                                      const brw_blorp_params *params)
 {
    struct intel_context *intel = &brw->intel;
+   struct gl_context *ctx = &intel->ctx;
    uint32_t draw_x = params->depth.x_offset;
    uint32_t draw_y = params->depth.y_offset;
    uint32_t tile_mask_x, tile_mask_y;
index 27305322b69299e0987bb90967f496241eaa577e..bfd2cbd279ec343e3181e2527371a66e30e5c80d 100644 (file)
@@ -579,6 +579,7 @@ gen7_blorp_emit_depth_stencil_config(struct brw_context *brw,
                                      const brw_blorp_params *params)
 {
    struct intel_context *intel = &brw->intel;
+   struct gl_context *ctx = &intel->ctx;
    uint32_t draw_x = params->depth.x_offset;
    uint32_t draw_y = params->depth.y_offset;
    uint32_t tile_mask_x, tile_mask_y;
index cae8ecf7a4fbf0c6ae3abbdac5663c1e9a549625..ce83bc1209b721cf8d29641e7ee0d68bccf3edd3 100644 (file)
@@ -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)