wined3d: Move the "coherent" field from struct wined3d_bo_gl to struct wined3d_bo.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-14 23:44:17 -05:00 committed by Alexandre Julliard
parent 86e4d3aa8c
commit 2d05178b28
5 changed files with 8 additions and 7 deletions

View File

@ -983,7 +983,7 @@ static void *adapter_vk_map_bo_address(struct wined3d_context *context,
wined3d_context_vk_reference_bo(context_vk, bo);
}
if (!(bo->memory_type & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT))
if (!bo->b.coherent)
{
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
range.pNext = NULL;
@ -1024,7 +1024,7 @@ static void adapter_vk_unmap_bo_address(struct wined3d_context *context,
vk_info = context_vk->vk_info;
device_vk = wined3d_device_vk(context->device);
if (!(bo->memory_type & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT))
if (!bo->b.coherent)
{
range.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
range.pNext = NULL;

View File

@ -2684,7 +2684,7 @@ static void *wined3d_bo_gl_map(struct wined3d_bo_gl *bo,
if ((flags & WINED3D_MAP_DISCARD) && bo->command_fence_id > device_gl->completed_fence_id)
{
if (wined3d_context_gl_create_bo(context_gl, bo->size,
bo->binding, bo->usage, bo->coherent, bo->flags, &tmp))
bo->binding, bo->usage, bo->b.coherent, bo->flags, &tmp))
{
list_move_head(&tmp.b.users, &bo->b.users);
wined3d_context_gl_destroy_bo(context_gl, bo);
@ -2754,7 +2754,7 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl,
gl_info = context_gl->gl_info;
wined3d_context_gl_bind_bo(context_gl, bo->binding, bo->id);
if (!bo->coherent)
if (!bo->b.coherent)
{
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
{
@ -2889,7 +2889,7 @@ bool wined3d_context_gl_create_bo(struct wined3d_context_gl *context_gl, GLsizei
bo->binding = binding;
bo->usage = usage;
bo->flags = flags;
bo->coherent = coherent;
bo->b.coherent = coherent;
list_init(&bo->b.users);
bo->command_fence_id = 0;
bo->b.memory_offset = 0;

View File

@ -492,6 +492,7 @@ BOOL wined3d_context_vk_create_bo(struct wined3d_context_vk *context_vk, VkDevic
bo->size = size;
bo->usage = usage;
bo->memory_type = adapter_vk->memory_properties.memoryTypes[memory_type_idx].propertyFlags;
bo->b.coherent = !!(bo->memory_type & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
list_init(&bo->b.users);
bo->command_buffer_id = 0;
bo->slab = NULL;

View File

@ -395,7 +395,7 @@ GLbitfield wined3d_resource_gl_map_flags(const struct wined3d_bo_gl *bo, DWORD d
if (d3d_flags & WINED3D_MAP_WRITE)
{
ret |= GL_MAP_WRITE_BIT;
if (!bo->coherent)
if (!bo->b.coherent)
ret |= GL_MAP_FLUSH_EXPLICIT_BIT;
}
if (d3d_flags & WINED3D_MAP_READ)

View File

@ -1592,6 +1592,7 @@ struct wined3d_bo
{
struct list users;
size_t memory_offset;
bool coherent;
};
struct wined3d_bo_gl
@ -1604,7 +1605,6 @@ struct wined3d_bo_gl
GLenum usage;
GLbitfield flags;
bool coherent;
uint64_t command_fence_id;
};