[Mesa-dev] [PATCH 09/26] gallium/radeon: buffer valid range tracking only works with unshared buffers
Michel Dänzer
michel at daenzer.net
Tue Mar 8 03:40:22 UTC 2016
On 03.03.2016 01:36, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/drivers/radeon/r600_buffer_common.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
> index 439a3cb..fb3a80e 100644
> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
> @@ -294,6 +294,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
> * in which case it can be mapped unsynchronized. */
> if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
> usage & PIPE_TRANSFER_WRITE &&
> + !rbuffer->is_shared &&
> !util_ranges_intersect(&rbuffer->valid_buffer_range, box->x, box->x + box->width)) {
> usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
> }
>
Maybe this could be a bit more thorough, e.g. also guarding the
util_range_add calls for shared buffers and clearing/destroying the
valid range when a buffer gets shared. Can be done in a followup change
though.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the mesa-dev
mailing list