diff options
author | Emma Anholt <emma@anholt.net> | 2021-11-03 13:15:45 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2021-11-04 22:49:29 +0000 |
commit | b0f2b0e980b66e9ef6d5e01ff371a08d404b6976 (patch) | |
tree | 294e005b3396db9e1dd966cf882dbd4051a62d31 | |
parent | b26e0cdf44089e3ccb06e287739e62a07287faf3 (diff) |
freedreno/a5xx: Clean up a little bit of blitter array pitch setup.
We have a nice helper function for determining an array pitch.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13668>
-rw-r--r-- | src/gallium/drivers/freedreno/a5xx/fd5_blitter.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_blitter.c b/src/gallium/drivers/freedreno/a5xx/fd5_blitter.c index 7cf61de809f..6076e13d096 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_blitter.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_blitter.c @@ -308,20 +308,16 @@ emit_blit(struct fd_ringbuffer *ring, const struct pipe_blit_info *info) const struct pipe_box *sbox = &info->src.box; const struct pipe_box *dbox = &info->dst.box; struct fd_resource *src, *dst; - struct fdl_slice *sslice, *dslice; enum a5xx_color_fmt sfmt, dfmt; enum a5xx_tile_mode stile, dtile; enum a3xx_color_swap sswap, dswap; - unsigned ssize, dsize, spitch, dpitch; + unsigned spitch, dpitch; unsigned sx1, sy1, sx2, sy2; unsigned dx1, dy1, dx2, dy2; src = fd_resource(info->src.resource); dst = fd_resource(info->dst.resource); - sslice = fd_resource_slice(src, info->src.level); - dslice = fd_resource_slice(dst, info->dst.level); - sfmt = fd5_pipe2color(info->src.format); dfmt = fd5_pipe2color(info->dst.format); @@ -354,15 +350,8 @@ emit_blit(struct fd_ringbuffer *ring, const struct pipe_blit_info *info) dx2 = dbox->x + dbox->width - 1; dy2 = dbox->y + dbox->height - 1; - if (info->src.resource->target == PIPE_TEXTURE_3D) - ssize = sslice->size0; - else - ssize = src->layout.layer_size; - - if (info->dst.resource->target == PIPE_TEXTURE_3D) - dsize = dslice->size0; - else - dsize = dst->layout.layer_size; + uint32_t sarray_pitch = fd_resource_layer_stride(src, info->src.level); + uint32_t darray_pitch = fd_resource_layer_stride(dst, info->dst.level); for (unsigned i = 0; i < info->dst.box.depth; i++) { unsigned soff = fd_resource_offset(src, info->src.level, sbox->z + i); @@ -383,7 +372,7 @@ emit_blit(struct fd_ringbuffer *ring, const struct pipe_blit_info *info) A5XX_RB_2D_SRC_INFO_COLOR_SWAP(sswap)); OUT_RELOC(ring, src->bo, soff, 0, 0); /* RB_2D_SRC_LO/HI */ OUT_RING(ring, A5XX_RB_2D_SRC_SIZE_PITCH(spitch) | - A5XX_RB_2D_SRC_SIZE_ARRAY_PITCH(ssize)); + A5XX_RB_2D_SRC_SIZE_ARRAY_PITCH(sarray_pitch)); OUT_RING(ring, 0x00000000); OUT_RING(ring, 0x00000000); OUT_RING(ring, 0x00000000); @@ -404,7 +393,7 @@ emit_blit(struct fd_ringbuffer *ring, const struct pipe_blit_info *info) A5XX_RB_2D_DST_INFO_COLOR_SWAP(dswap)); OUT_RELOC(ring, dst->bo, doff, 0, 0); /* RB_2D_DST_LO/HI */ OUT_RING(ring, A5XX_RB_2D_DST_SIZE_PITCH(dpitch) | - A5XX_RB_2D_DST_SIZE_ARRAY_PITCH(dsize)); + A5XX_RB_2D_DST_SIZE_ARRAY_PITCH(darray_pitch)); OUT_RING(ring, 0x00000000); OUT_RING(ring, 0x00000000); OUT_RING(ring, 0x00000000); |