mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
freedreno/a3xx: more layer/level fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 74069e324e)
This commit is contained in:
parent
64373f072c
commit
971ae04fe6
3 changed files with 14 additions and 8 deletions
|
|
@ -282,8 +282,13 @@ void
|
|||
fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring, struct pipe_surface *psurf)
|
||||
{
|
||||
struct fd_resource *rsc = fd_resource(psurf->texture);
|
||||
unsigned lvl = psurf->u.tex.level;
|
||||
struct fd_resource_slice *slice = &rsc->slices[lvl];
|
||||
uint32_t layer_offset = slice->size0 * psurf->u.tex.first_layer;
|
||||
enum pipe_format format = fd3_gmem_restore_format(psurf->format);
|
||||
|
||||
debug_assert(psurf->u.tex.first_layer == psurf->u.tex.last_layer);
|
||||
|
||||
/* output sampler state: */
|
||||
OUT_PKT3(ring, CP_LOAD_STATE, 4);
|
||||
OUT_RING(ring, CP_LOAD_STATE_0_DST_OFF(FRAG_TEX_OFF) |
|
||||
|
|
@ -314,7 +319,7 @@ fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring, struct pipe_surface *psurf
|
|||
OUT_RING(ring, A3XX_TEX_CONST_1_FETCHSIZE(TFETCH_DISABLE) |
|
||||
A3XX_TEX_CONST_1_WIDTH(psurf->width) |
|
||||
A3XX_TEX_CONST_1_HEIGHT(psurf->height));
|
||||
OUT_RING(ring, A3XX_TEX_CONST_2_PITCH(rsc->slices[0].pitch * rsc->cpp) |
|
||||
OUT_RING(ring, A3XX_TEX_CONST_2_PITCH(slice->pitch * rsc->cpp) |
|
||||
A3XX_TEX_CONST_2_INDX(0));
|
||||
OUT_RING(ring, 0x00000000);
|
||||
|
||||
|
|
@ -326,7 +331,7 @@ fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring, struct pipe_surface *psurf
|
|||
CP_LOAD_STATE_0_NUM_UNIT(1));
|
||||
OUT_RING(ring, CP_LOAD_STATE_1_STATE_TYPE(ST_CONSTANTS) |
|
||||
CP_LOAD_STATE_1_EXT_SRC_ADDR(0));
|
||||
OUT_RELOC(ring, rsc->bo, 0, 0, 0);
|
||||
OUT_RELOC(ring, rsc->bo, layer_offset, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -609,8 +609,11 @@ fd3_emit_sysmem_prep(struct fd_context *ctx)
|
|||
struct fd_ringbuffer *ring = ctx->ring;
|
||||
uint32_t pitch = 0;
|
||||
|
||||
if (pfb->cbufs[0])
|
||||
pitch = fd_resource(pfb->cbufs[0]->texture)->slices[0].pitch;
|
||||
if (pfb->cbufs[0]) {
|
||||
struct pipe_surface *psurf = pfb->cbufs[0];
|
||||
unsigned lvl = psurf->u.tex.level;
|
||||
pitch = fd_resource(psurf->texture)->slices[lvl].pitch;
|
||||
}
|
||||
|
||||
fd3_emit_restore(ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -199,9 +199,8 @@ setup_slices(struct fd_resource *rsc)
|
|||
|
||||
for (level = 0; level <= prsc->last_level; level++) {
|
||||
struct fd_resource_slice *slice = fd_resource_slice(rsc, level);
|
||||
uint32_t aligned_width = align(width, 32);
|
||||
|
||||
slice->pitch = aligned_width;
|
||||
slice->pitch = align(width, 32);
|
||||
slice->offset = size;
|
||||
slice->size0 = slice->pitch * height * rsc->cpp;
|
||||
|
||||
|
|
@ -229,9 +228,8 @@ setup_slices_array(struct fd_resource *rsc)
|
|||
|
||||
for (level = 0; level <= prsc->last_level; level++) {
|
||||
struct fd_resource_slice *slice = fd_resource_slice(rsc, level);
|
||||
uint32_t aligned_width = align(width, 32);
|
||||
|
||||
slice->pitch = aligned_width;
|
||||
slice->pitch = align(width, 32);
|
||||
slice->offset = size;
|
||||
slice->size0 = align(slice->pitch * height * rsc->cpp, 4096);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue