freedreno: Use the resource size rather than BO size for VFD_FETCH[].SIZE.

We should be using the API size to clamp, rather than what we allocated
the BO into.

Fixes: #13
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15198>
This commit is contained in:
Emma Anholt
2022-02-28 14:39:59 -08:00
committed by Marge Bot
parent b21e7e1ef7
commit 35ddb65ea6
3 changed files with 3 additions and 3 deletions
@@ -428,7 +428,7 @@ fd4_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd4_emit *emit)
bool isint = util_format_is_pure_integer(pfmt);
uint32_t fs = util_format_get_blocksize(pfmt);
uint32_t off = vb->buffer_offset + elem->src_offset;
uint32_t size = fd_bo_size(rsc->bo) - off;
uint32_t size = vb->buffer.resource->width0 - off;
debug_assert(fmt != VFMT4_NONE);
#ifdef DEBUG
@@ -487,7 +487,7 @@ fd5_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd5_emit *emit)
enum a5xx_vtx_fmt fmt = fd5_pipe2vtx(pfmt);
bool isint = util_format_is_pure_integer(pfmt);
uint32_t off = vb->buffer_offset + elem->src_offset;
uint32_t size = fd_bo_size(rsc->bo) - off;
uint32_t size = vb->buffer.resource->width0 - off;
debug_assert(fmt != VFMT5_NONE);
#ifdef DEBUG
@@ -567,7 +567,7 @@ build_vbo_state(struct fd6_emit *emit) assert_dt
OUT_RING(ring, 0);
} else {
uint32_t off = vb->buffer_offset;
uint32_t size = fd_bo_size(rsc->bo) - off;
uint32_t size = vb->buffer.resource->width0 - off;
OUT_RELOC(ring, rsc->bo, off, 0, 0);
OUT_RING(ring, size); /* VFD_FETCH[j].SIZE */