[Mesa-dev] [PATCH 09/26] gallium/radeon: buffer valid range tracking only works with unshared buffers
Marek Olšák
maraeo at gmail.com
Tue Mar 8 19:24:35 UTC 2016
On Tue, Mar 8, 2016 at 4:40 AM, Michel Dänzer <michel at daenzer.net> wrote:
> 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.
Not needed. Since this is the only use of valid_buffer_range, all
util_range_add calls are effectively no-ops and valid_buffer_range
*can* be undefined if is_shared is true.
Marek
More information about the mesa-dev
mailing list