[PATCH v2 5/7] wined3d: Move the "coherent" field from struct wined3d_bo_gl to struct wined3d_bo.

Zebediah Figura zfigura at codeweavers.com
Wed Oct 13 16:27:09 CDT 2021


On 10/13/21 4:03 PM, Henri Verbeet wrote:
> On Tue, 12 Oct 2021 at 23:31, Zebediah Figura <zfigura at codeweavers.com> wrote:
>> @@ -413,6 +413,7 @@ static bool wined3d_context_vk_create_slab_bo(struct wined3d_context_vk *context
>>       bo->buffer_offset = idx * object_size;
>>       bo->b.memory_offset = slab->bo.b.memory_offset + bo->buffer_offset;
>>       bo->size = size;
>> +    bo->b.coherent = !!(bo->memory_type & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
> 
> Is that necessary? I think the "*bo = slab->bo;" line above should
> already set the "coherent" field correctly.

Indeed, this line can be removed.

> 
> Note that for GL, the "coherent" field is currently only meaningful
> for the APPLE_flush_buffer_range path. In particular, we never set
> MAP_COHERENT_BIT for the ARB_buffer_storage path, and we use
> MAP_FLUSH_EXPLICIT_BIT for the ARB_map_buffer_range path. That's not
> necessarily an issue in this patch, but would become an issue in patch
> 7/7 if we started doing persistent maps with GL.
> 

Indeed, I assumed that "coherent" already had the semantics we wanted, 
but clearly it does not...

I'm inclined to think we want "coherent" to behave that way for GL, 
though, so I'll add a couple of patches to v3.



More information about the wine-devel mailing list