mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
etnaviv: drop precomputed offset from etna_surface
As another step in the direction of getting rid of etna_surface, plug the offset calculation into all places that need it and drop the precomputed offset from the surface struct. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35406>
This commit is contained in:
parent
cd58efd055
commit
6111d07048
4 changed files with 3 additions and 7 deletions
|
|
@ -236,7 +236,7 @@ etna_blit_clear_color_blt(struct pipe_context *pctx, unsigned idx,
|
|||
struct etna_resource *res = etna_resource(surf->base.texture);
|
||||
struct blt_clear_op clr = {};
|
||||
clr.dest.addr.bo = res->bo;
|
||||
clr.dest.addr.offset = surf->offset;
|
||||
clr.dest.addr.offset = surf->level->offset + surf->base.first_layer * surf->level->layer_stride;
|
||||
clr.dest.addr.flags = ETNA_RELOC_WRITE;
|
||||
clr.dest.bpp = util_format_get_blocksize(surf->base.format);
|
||||
clr.dest.stride = surf->level->stride;
|
||||
|
|
@ -331,7 +331,7 @@ etna_blit_clear_zs_blt(struct pipe_context *pctx, struct pipe_surface *dst,
|
|||
struct etna_resource *res = etna_resource(surf->base.texture);
|
||||
struct blt_clear_op clr = {};
|
||||
clr.dest.addr.bo = res->bo;
|
||||
clr.dest.addr.offset = surf->offset;
|
||||
clr.dest.addr.offset = surf->level->offset + surf->base.first_layer * surf->level->layer_stride;
|
||||
clr.dest.addr.flags = ETNA_RELOC_WRITE;
|
||||
clr.dest.bpp = util_format_get_blocksize(surf->base.format);
|
||||
clr.dest.stride = surf->level->stride;
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ etna_rs_gen_clear_surface(struct etna_context *ctx, struct etna_surface *surf,
|
|||
.source_format = format,
|
||||
.dest_format = format,
|
||||
.dest = dst->bo,
|
||||
.dest_offset = surf->offset,
|
||||
.dest_offset = surf->level->offset + surf->base.first_layer * surf->level->layer_stride,
|
||||
.dest_stride = surf->level->stride,
|
||||
.dest_padded_height = surf->level->padded_height,
|
||||
.dest_tiling = tiled_clear ? dst->layout : ETNA_LAYOUT_LINEAR,
|
||||
|
|
|
|||
|
|
@ -98,9 +98,6 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
|
|||
surf->base.last_layer = templat->last_layer;
|
||||
surf->level = lev;
|
||||
|
||||
/* XXX we don't really need a copy but it's convenient */
|
||||
surf->offset = lev->offset + layer * lev->layer_stride;
|
||||
|
||||
if (surf->level->ts_size) {
|
||||
assert(layer == 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ struct etna_surface {
|
|||
struct compiled_rs_state ts_clear_command;
|
||||
/* Keep pointer to resource level, for fast clear */
|
||||
struct etna_resource_level *level;
|
||||
uint32_t offset; /* pre-calculated level + layer offset */
|
||||
/* keep pointer to original resource (for when a render compatible resource is used) */
|
||||
struct pipe_resource *prsc;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue