uint32_t *tile_x, uint32_t *tile_y,
uint32_t *offset, struct isl_surf *surf)
{
- intel_miptree_get_isl_surf(brw, mt, surf);
+ if (mt->surf.size > 0) {
+ *surf = mt->surf;
+ } else {
+ intel_miptree_get_isl_surf(brw, mt, surf);
- surf->dim = get_isl_surf_dim(target);
+ surf->dim = get_isl_surf_dim(target);
+ }
const enum isl_dim_layout dim_layout =
get_isl_dim_layout(&brw->screen->devinfo, mt->surf.tiling, target,
/* If this is a view with restricted NumLayers, then our effective depth
* is not just the miptree depth.
*/
- const unsigned view_num_layers =
- (obj->Immutable && obj->Target != GL_TEXTURE_3D) ? obj->NumLayers :
- mt->logical_depth0;
+ unsigned view_num_layers;
+ if (obj->Immutable && obj->Target != GL_TEXTURE_3D) {
+ view_num_layers = obj->NumLayers;
+ } else if (mt->surf.size > 0) {
+ view_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
+ mt->surf.logical_level0_px.depth :
+ mt->surf.logical_level0_px.array_len;
+ } else {
+ view_num_layers = mt->logical_depth0;
+ }
/* Handling GL_ALPHA as a surface format override breaks 1.30+ style
* texturing functions that return a float, as our code generation always