mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 08:40:11 +01:00
asahi: Clamp index buffer extent to what's read
This makes for cleaner agxdecodes, I think this matches what I've seen on the macOS side but I might be misremembering. Certainly shouldn't hurt. This only applies for direct draws. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
2be9b66cdd
commit
cb14cddfa5
1 changed files with 3 additions and 2 deletions
|
|
@ -2961,14 +2961,15 @@ agx_index_buffer_direct_ptr(struct agx_batch *batch,
|
|||
const struct pipe_draw_info *info, size_t *extent)
|
||||
{
|
||||
off_t offset = draw->start * info->index_size;
|
||||
uint32_t max_extent = draw->count * info->index_size;
|
||||
|
||||
if (!info->has_user_indices) {
|
||||
uint64_t base = agx_index_buffer_rsrc_ptr(batch, info, extent);
|
||||
|
||||
*extent = ALIGN_POT(*extent - offset, 4);
|
||||
*extent = ALIGN_POT(MIN2(*extent - offset, max_extent), 4);
|
||||
return base + offset;
|
||||
} else {
|
||||
*extent = ALIGN_POT(draw->count * info->index_size, 4);
|
||||
*extent = ALIGN_POT(max_extent, 4);
|
||||
|
||||
return agx_pool_upload_aligned(&batch->pool,
|
||||
((uint8_t *)info->index.user) + offset,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue