mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 10:20:09 +01:00
r600g,radeonsi: if discarding whole buffer range, discard whole resource instead
Also set the unsynchronized flag if the whole resource was discarded to avoid doing buffer-busy checks again. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
ee0dc659c8
commit
5dfb10b2f5
1 changed files with 8 additions and 0 deletions
|
|
@ -205,6 +205,12 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
|
|||
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
|
||||
}
|
||||
|
||||
/* If discarding the entire range, discard the whole resource instead. */
|
||||
if (usage & PIPE_TRANSFER_DISCARD_RANGE &&
|
||||
box->x == 0 && box->width == resource->width0) {
|
||||
usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
|
||||
}
|
||||
|
||||
if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE &&
|
||||
!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
|
||||
assert(usage & PIPE_TRANSFER_WRITE);
|
||||
|
|
@ -214,6 +220,8 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
|
|||
rctx->ws->buffer_is_busy(rbuffer->buf, RADEON_USAGE_READWRITE)) {
|
||||
rctx->invalidate_buffer(&rctx->b, &rbuffer->b.b);
|
||||
}
|
||||
/* At this point, the buffer is always idle. */
|
||||
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
|
||||
}
|
||||
else if ((usage & PIPE_TRANSFER_DISCARD_RANGE) &&
|
||||
!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue