[Mesa-dev] [PATCH 1/2] intel: Turn a test in miptree_match_image into an assert.

Eric Anholt eric at anholt.net
Sun Dec 23 23:43:32 PST 2012


---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 3a9e0a5..6c883e7 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -603,8 +603,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)
-- 
1.7.10.4



More information about the mesa-dev mailing list