i965/fbo: Add support for isl-based miptrees in rb wrapper
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Sun, 4 Jun 2017 09:36:08 +0000 (12:36 +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/intel_fbo.c

index 87dc32673ce5ffc1045d64b1cd61953c0191ff03..bcb8d8039de6838e349f566fb84cab2d0df47a81 100644 (file)
@@ -539,6 +539,10 @@ intel_renderbuffer_update_wrapper(struct brw_context *brw,
       irb->layer_count = 1;
    } else if (mt->target != GL_TEXTURE_3D && image->TexObject->NumLayers > 0) {
       irb->layer_count = image->TexObject->NumLayers;
+   } else if (mt->surf.size > 0) {
+      irb->layer_count = mt->surf.dim == ISL_SURF_DIM_3D ?
+                            minify(mt->surf.logical_level0_px.depth, level) :
+                            mt->surf.logical_level0_px.array_len;
    } else {
       irb->layer_count = mt->level[level].depth / layer_multiplier;
    }