intel: Turn a test in miptree_match_image into an assert.
authorEric Anholt <eric@anholt.net>
Thu, 20 Dec 2012 21:52:30 +0000 (13:52 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 28 Dec 2012 19:05:20 +0000 (11:05 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index 9ae7bcccb1907acb7b8b876f1adfd89127f89ad2..181130bd2ac8a2c1b885d9a8097bf0dbf8aa9fc5 100644 (file)
@@ -601,8 +601,11 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
    GLuint level = intelImage->base.Base.Level;
    int width, height, depth;
 
-   if (target_to_target(image->TexObject->Target) != mt->target)
-      return false;
+   /* glTexImage* choose the texture object based on the target passed in, and
+    * objects can't change targets over their lifetimes, so this should be
+    * true.
+    */
+   assert(target_to_target(image->TexObject->Target) == mt->target);
 
    gl_format mt_format = mt->format;
    if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)