i965/wm: Prepare image surfaces for isl based
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 22 Jun 2017 18:20:51 +0000 (21:20 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 20 Jul 2017 08:32:21 +0000 (11:32 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index bc06949..a8c40d5 100644 (file)
@@ -1639,6 +1639,12 @@ get_image_num_layers(const struct intel_mipmap_tree *mt, GLenum target,
    if (target == GL_TEXTURE_CUBE_MAP)
       return 6;
 
+   if (mt->surf.size > 0) {
+      return target == GL_TEXTURE_3D ?
+         minify(mt->surf.logical_level0_px.depth, level) :
+         mt->surf.logical_level0_px.array_len;
+   }
+
    return target == GL_TEXTURE_3D ?
       minify(mt->logical_depth0, level) : mt->logical_depth0;
 }