v3dv: fix incorrect index buffer size

When programming the size, we should take into account the
offset from the start of the index buffer address.

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29425>
This commit is contained in:
Iago Toral Quiroga
2024-05-28 08:36:01 +02:00
parent 6d2edd2585
commit 70aa470bdb
+5 -4
View File
@@ -2740,11 +2740,12 @@ v3dX(cmd_buffer_emit_index_buffer)(struct v3dv_cmd_buffer *cmd_buffer)
&job->bcl, cl_packet_length(INDEX_BUFFER_SETUP));
v3dv_return_if_oom(cmd_buffer, NULL);
const uint32_t offset = cmd_buffer->state.index_buffer.offset;
const uint32_t offset = ibuffer->mem_offset +
cmd_buffer->state.index_buffer.offset;
assert(ibuffer->mem->bo->size >= offset);
cl_emit(&job->bcl, INDEX_BUFFER_SETUP, ib) {
ib.address = v3dv_cl_address(ibuffer->mem->bo,
ibuffer->mem_offset + offset);
ib.size = ibuffer->mem->bo->size;
ib.address = v3dv_cl_address(ibuffer->mem->bo, offset);
ib.size = ibuffer->mem->bo->size - offset;
}
}