i965/miptree: Remove redundant check for null texture
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 22 Dec 2016 08:36:03 +0000 (10:36 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 27 Jan 2017 06:57:26 +0000 (08:57 +0200)
There exact same check earlier in brw_miptree_layout() which
intel_miptree_create_layout() in turn calls unconditionally.

Reviewed-by: Samuel Iglesias Gons\341lvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index f2debae444a546a240a4c65ee3c80380f338e35e..19f4f883d7e925ee7a16df806bb30b4b6df5043c 100644 (file)
@@ -631,13 +631,8 @@ miptree_create(struct brw_context *brw,
                                     first_level, last_level, width0,
                                     height0, depth0, num_samples,
                                     layout_flags);
-   /*
-    * pitch == 0 || height == 0  indicates the null texture
-    */
-   if (!mt || !mt->total_width || !mt->total_height) {
-      intel_miptree_release(&mt);
+   if (!mt)
       return NULL;
-   }
 
    if (mt->tiling == (I915_TILING_Y | I915_TILING_X))
       mt->tiling = I915_TILING_Y;