srcbox.height = u_minify(tex->height0, src_level);
if (target == PIPE_TEXTURE_3D) {
- dstbox.depth = util_max_layer(tex, dst_level) + 1;
- srcbox.depth = util_max_layer(tex, src_level) + 1;
+ dstbox.depth = util_num_layers(tex, dst_level);
+ srcbox.depth = util_num_layers(tex, src_level);
} else {
dstbox.z = srcbox.z = first_layer;
dstbox.depth = srcbox.depth = last_layer - first_layer + 1;
if (pt->target == PIPE_TEXTURE_3D) {
/* generate all layers/slices at once */
blit.src.box.z = blit.dst.box.z = 0;
- blit.src.box.depth = util_max_layer(pt, blit.src.level)+1;
- blit.dst.box.depth = util_max_layer(pt, blit.dst.level)+1;
+ blit.src.box.depth = util_num_layers(pt, blit.src.level);
+ blit.dst.box.depth = util_num_layers(pt, blit.dst.level);
}
else {
blit.src.box.z = blit.dst.box.z = first_layer;
}
}
+static inline unsigned
+util_num_layers(const struct pipe_resource *r, unsigned level)
+{
+ return util_max_layer(r, level) + 1;
+}
+
static inline bool
util_texrange_covers_whole_level(const struct pipe_resource *tex,
unsigned level, unsigned x, unsigned y,
return x == 0 && y == 0 && z == 0 &&
width == u_minify(tex->width0, level) &&
height == u_minify(tex->height0, level) &&
- depth == util_max_layer(tex, level) + 1;
+ depth == util_num_layers(tex, level);
}
#ifdef __cplusplus
u_box_3d(0, 0, 0,
u_minify(templ.width0, i), u_minify(templ.height0, i),
- util_max_layer(&templ, i) + 1, &box);
+ util_num_layers(&templ, i), &box);
rctx->dma_copy(&rctx->b, &new_tex->resource.b.b, i, 0, 0, 0,
&rtex->resource.b.b, i, &box);
out->slice_tile_max = ((pitch_elements * height) / (128*128)) - 1;
out->alignment = MAX2(256, base_align);
- out->size = (util_max_layer(&rtex->resource.b.b, 0) + 1) *
+ out->size = util_num_layers(&rtex->resource.b.b, 0) *
align(slice_bytes, base_align);
}
rtex->surface.htile_alignment = base_align;
rtex->surface.htile_size =
- (util_max_layer(&rtex->resource.b.b, 0) + 1) *
+ util_num_layers(&rtex->resource.b.b, 0) *
align(slice_bytes, base_align);
}
fprintf(stderr, "VM start=0x%"PRIX64" end=0x%"PRIX64" | Texture %ix%ix%i, %i levels, %i samples, %s\n",
rtex->resource.gpu_address,
rtex->resource.gpu_address + rtex->resource.buf->size,
- base->width0, base->height0, util_max_layer(base, 0)+1, base->last_level+1,
+ base->width0, base->height0, util_num_layers(base, 0), base->last_level+1,
base->nr_samples ? base->nr_samples : 1, util_format_short_name(base->format));
}
u_box_3d(0, 0, 0,
u_minify(templ.width0, i), u_minify(templ.height0, i),
- util_max_layer(&templ, i) + 1, &box);
+ util_num_layers(&templ, i), &box);
rctx->dma_copy(&rctx->b, &new_tex->resource.b.b, i, 0, 0, 0,
&rtex->resource.b.b, i, &box);
out->slice_tile_max -= 1;
out->alignment = MAX2(256, base_align);
- out->size = (util_max_layer(&rtex->resource.b.b, 0) + 1) *
+ out->size = util_num_layers(&rtex->resource.b.b, 0) *
align(slice_bytes, base_align);
}
rtex->surface.htile_alignment = base_align;
rtex->surface.htile_size =
- (util_max_layer(&rtex->resource.b.b, 0) + 1) *
+ util_num_layers(&rtex->resource.b.b, 0) *
align(slice_bytes, base_align);
}
fprintf(stderr, "VM start=0x%"PRIX64" end=0x%"PRIX64" | Texture %ix%ix%i, %i levels, %i samples, %s\n",
rtex->resource.gpu_address,
rtex->resource.gpu_address + rtex->resource.buf->size,
- base->width0, base->height0, util_max_layer(base, 0)+1, base->last_level+1,
+ base->width0, base->height0, util_num_layers(base, 0), base->last_level+1,
base->nr_samples ? base->nr_samples : 1, util_format_short_name(base->format));
}
assert(rtex->resource.b.b.nr_samples <= 1);
clear_size = rtex->surface.dcc_size;
} else {
- unsigned num_layers = util_max_layer(&rtex->resource.b.b, level) + 1;
+ unsigned num_layers = util_num_layers(&rtex->resource.b.b, level);
/* If this is 0, fast clear isn't possible. (can occur with MSAA) */
assert(rtex->surface.u.legacy.level[level].dcc_fast_clear_size);
}
t = tr_tex->resource;
- num_layers = util_max_layer(t, 0) + 1;
+ num_layers = util_num_layers(t, 0);
rbug_send_texture_info_reply(tr_rbug->con, serial,
t->target, t->format,