intel: Improve diagnostics for emit_linear_blit failure path.
authorEric Anholt <eric@anholt.net>
Thu, 11 Apr 2013 17:11:50 +0000 (10:11 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 12 Apr 2013 23:32:13 +0000 (16:32 -0700)
This fixes unused variable warnings in the release build, and should be
more useful if it ever triggers.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/intel/intel_blit.c

index 0946972d4fa3e42cc670ff6f366e1e05b4e6619f..1f3fad51266c83725b34e016c0fc9cb81820b109 100644 (file)
@@ -480,6 +480,7 @@ intel_emit_linear_blit(struct intel_context *intel,
                       unsigned int src_offset,
                       unsigned int size)
 {
+   struct gl_context *ctx = &intel->ctx;
    GLuint pitch, height;
    bool ok;
 
@@ -496,7 +497,8 @@ intel_emit_linear_blit(struct intel_context *intel,
                          0, 0, /* dst x/y */
                          pitch, height, /* w, h */
                          GL_COPY);
-   assert(ok);
+   if (!ok)
+      _mesa_problem(ctx, "Failed to linear blit %dx%d\n", pitch, height);
 
    src_offset += pitch * height;
    dst_offset += pitch * height;
@@ -511,7 +513,8 @@ intel_emit_linear_blit(struct intel_context *intel,
                             0, 0, /* dst x/y */
                             size, 1, /* w, h */
                             GL_COPY);
-      assert(ok);
+      if (!ok)
+         _mesa_problem(ctx, "Failed to linear blit %dx%d\n", size, 1);
    }
 }