wined3d: Move the "map_ptr" field from struct wined3d_bo_vk 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:
parent
2d05178b28
commit
6e7779ace9
|
@ -775,15 +775,15 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
|
|||
struct wined3d_bo_slab_vk *slab;
|
||||
VkResult vr;
|
||||
|
||||
if (bo->map_ptr)
|
||||
return bo->map_ptr;
|
||||
if (bo->b.map_ptr)
|
||||
return bo->b.map_ptr;
|
||||
|
||||
vk_info = context_vk->vk_info;
|
||||
device_vk = wined3d_device_vk(context_vk->c.device);
|
||||
|
||||
if ((slab = bo->slab))
|
||||
{
|
||||
if (!(bo->map_ptr = wined3d_bo_slab_vk_map(slab, context_vk)))
|
||||
if (!(bo->b.map_ptr = wined3d_bo_slab_vk_map(slab, context_vk)))
|
||||
{
|
||||
ERR("Failed to map slab.\n");
|
||||
return NULL;
|
||||
|
@ -793,19 +793,19 @@ static void *wined3d_bo_vk_map(struct wined3d_bo_vk *bo, struct wined3d_context_
|
|||
{
|
||||
struct wined3d_allocator_chunk_vk *chunk_vk = wined3d_allocator_chunk_vk(bo->memory->chunk);
|
||||
|
||||
if (!(bo->map_ptr = wined3d_allocator_chunk_vk_map(chunk_vk, context_vk)))
|
||||
if (!(bo->b.map_ptr = wined3d_allocator_chunk_vk_map(chunk_vk, context_vk)))
|
||||
{
|
||||
ERR("Failed to map chunk.\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if ((vr = VK_CALL(vkMapMemory(device_vk->vk_device, bo->vk_memory, 0, VK_WHOLE_SIZE, 0, &bo->map_ptr))) < 0)
|
||||
else if ((vr = VK_CALL(vkMapMemory(device_vk->vk_device, bo->vk_memory, 0, VK_WHOLE_SIZE, 0, &bo->b.map_ptr))) < 0)
|
||||
{
|
||||
ERR("Failed to map memory, vr %s.\n", wined3d_debug_vkresult(vr));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bo->map_ptr;
|
||||
return bo->b.map_ptr;
|
||||
}
|
||||
|
||||
static void wined3d_bo_vk_unmap(struct wined3d_bo_vk *bo, struct wined3d_context_vk *context_vk)
|
||||
|
@ -817,7 +817,7 @@ static void wined3d_bo_vk_unmap(struct wined3d_bo_vk *bo, struct wined3d_context
|
|||
if (wined3d_map_persistent())
|
||||
return;
|
||||
|
||||
bo->map_ptr = NULL;
|
||||
bo->b.map_ptr = NULL;
|
||||
|
||||
if ((slab = bo->slab))
|
||||
{
|
||||
|
|
|
@ -2893,6 +2893,7 @@ bool wined3d_context_gl_create_bo(struct wined3d_context_gl *context_gl, GLsizei
|
|||
list_init(&bo->b.users);
|
||||
bo->command_fence_id = 0;
|
||||
bo->b.memory_offset = 0;
|
||||
bo->b.map_ptr = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -487,7 +487,7 @@ BOOL wined3d_context_vk_create_bo(struct wined3d_context_vk *context_vk, VkDevic
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
bo->map_ptr = NULL;
|
||||
bo->b.map_ptr = NULL;
|
||||
bo->buffer_offset = 0;
|
||||
bo->size = size;
|
||||
bo->usage = usage;
|
||||
|
@ -907,7 +907,7 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
|
|||
|
||||
if ((slab_vk = bo->slab))
|
||||
{
|
||||
if (bo->map_ptr)
|
||||
if (bo->b.map_ptr)
|
||||
wined3d_bo_slab_vk_unmap(slab_vk, context_vk);
|
||||
object_size = slab_vk->bo.size / 32;
|
||||
idx = bo->buffer_offset / object_size;
|
||||
|
@ -918,13 +918,13 @@ void wined3d_context_vk_destroy_bo(struct wined3d_context_vk *context_vk, const
|
|||
wined3d_context_vk_destroy_vk_buffer(context_vk, bo->vk_buffer, bo->command_buffer_id);
|
||||
if (bo->memory)
|
||||
{
|
||||
if (bo->map_ptr)
|
||||
if (bo->b.map_ptr)
|
||||
wined3d_allocator_chunk_vk_unmap(wined3d_allocator_chunk_vk(bo->memory->chunk), context_vk);
|
||||
wined3d_context_vk_destroy_allocator_block(context_vk, bo->memory, bo->command_buffer_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bo->map_ptr)
|
||||
if (bo->b.map_ptr)
|
||||
VK_CALL(vkUnmapMemory(device_vk->vk_device, bo->vk_memory));
|
||||
wined3d_context_vk_destroy_vk_memory(context_vk, bo->vk_memory, bo->command_buffer_id);
|
||||
}
|
||||
|
|
|
@ -1591,6 +1591,7 @@ do { \
|
|||
struct wined3d_bo
|
||||
{
|
||||
struct list users;
|
||||
void *map_ptr;
|
||||
size_t memory_offset;
|
||||
bool coherent;
|
||||
};
|
||||
|
@ -1628,7 +1629,6 @@ struct wined3d_bo_vk
|
|||
struct wined3d_bo_slab_vk *slab;
|
||||
|
||||
VkDeviceMemory vk_memory;
|
||||
void *map_ptr;
|
||||
|
||||
VkDeviceSize buffer_offset;
|
||||
VkDeviceSize size;
|
||||
|
|
Loading…
Reference in New Issue