i965/miptree: Take first_level into account when converting to ISL
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 16 May 2017 21:59:41 +0000 (14:59 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 May 2017 14:58:01 +0000 (07:58 -0700)
ISL doesn't have a concept of a partial miptree.  Instead, we need to
subtract off first_level.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 24d01aa32a9b5a399970a491a2d36c809468ed97..6acf48e850179535ba9779639603ba179f28581e 100644 (file)
@@ -3258,7 +3258,7 @@ intel_miptree_get_isl_surf(struct brw_context *brw,
       surf->phys_level0_sa.array_len = mt->physical_depth0;
    }
 
-   surf->levels = mt->last_level + 1;
+   surf->levels = mt->last_level - mt->first_level + 1;
    surf->samples = MAX2(mt->num_samples, 1);
 
    surf->size = 0; /* TODO */