i965/blorp: Properly handle mt->first_level
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 16 May 2017 21:58:00 +0000 (14:58 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 May 2017 14:58:01 +0000 (07:58 -0700)
The guts of blorp and ISL don't understand i965's partial miptrees.
Instead, we need to subtract off first_level before we hand anything off
to blorp.

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

index ebc46126846614f7c0c5fe97e289dd640fffa8f0..64aa4c90883b72dfb3cc600a6ed01377ced0053b 100644 (file)
@@ -271,6 +271,9 @@ blorp_surf_for_miptree(struct brw_context *brw,
    }
    assert((surf->aux_usage == ISL_AUX_USAGE_NONE) ==
           (surf->aux_addr.buffer == NULL));
+
+   /* ISL wants real levels, not offset ones. */
+   *level -= mt->first_level;
 }
 
 static enum isl_format