Commit d1bc6843 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Drop the bind flag parameters to wined3d_adapter_ops.adapter_copy_bo_address().

parent 0884111f
......@@ -4639,8 +4639,7 @@ static void adapter_gl_unmap_bo_address(struct wined3d_context *context,
}
static void adapter_gl_copy_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *dst, uint32_t dst_bind_flags,
const struct wined3d_bo_address *src, uint32_t src_bind_flags, size_t size)
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size)
{
wined3d_context_gl_copy_bo_address(wined3d_context_gl(context), dst, src, size);
}
......
......@@ -735,12 +735,12 @@ static void adapter_vk_unmap_bo_address(struct wined3d_context *context,
}
static void adapter_vk_copy_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *dst, uint32_t dst_bind_flags,
const struct wined3d_bo_address *src, uint32_t src_bind_flags, size_t size)
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size)
{
struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
const struct wined3d_vk_info *vk_info = context_vk->vk_info;
struct wined3d_bo_vk staging_bo, *src_bo, *dst_bo;
VkAccessFlags src_access_mask, dst_access_mask;
VkBufferMemoryBarrier vk_barrier[2];
struct wined3d_bo_address staging;
VkCommandBuffer vk_command_buffer;
......@@ -759,13 +759,16 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
return;
}
src_access_mask = vk_access_mask_from_buffer_usage(src_bo->usage);
dst_access_mask = vk_access_mask_from_buffer_usage(dst_bo->usage);
region.srcOffset = src_bo->buffer_offset + (uintptr_t)src->addr;
region.dstOffset = dst_bo->buffer_offset + (uintptr_t)dst->addr;
region.size = size;
vk_barrier[0].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
vk_barrier[0].pNext = NULL;
vk_barrier[0].srcAccessMask = vk_access_mask_from_bind_flags(src_bind_flags);
vk_barrier[0].srcAccessMask = src_access_mask;
vk_barrier[0].dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
vk_barrier[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
vk_barrier[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
......@@ -775,7 +778,7 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
vk_barrier[1].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
vk_barrier[1].pNext = NULL;
vk_barrier[1].srcAccessMask = vk_access_mask_from_bind_flags(dst_bind_flags);
vk_barrier[1].srcAccessMask = dst_access_mask;
vk_barrier[1].dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
vk_barrier[1].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
vk_barrier[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
......@@ -789,10 +792,10 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
VK_CALL(vkCmdCopyBuffer(vk_command_buffer, src_bo->vk_buffer, dst_bo->vk_buffer, 1, &region));
vk_barrier[0].srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
vk_barrier[0].dstAccessMask = vk_access_mask_from_bind_flags(src_bind_flags);
vk_barrier[0].dstAccessMask = src_access_mask;
vk_barrier[1].srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
vk_barrier[1].dstAccessMask = vk_access_mask_from_bind_flags(dst_bind_flags);
vk_barrier[1].dstAccessMask = dst_access_mask;
VK_CALL(vkCmdPipelineBarrier(vk_command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, NULL, 2, vk_barrier, 0, NULL));
......@@ -814,8 +817,8 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
staging.buffer_object = (uintptr_t)&staging_bo;
staging.addr = NULL;
adapter_vk_copy_bo_address(context, &staging, 0, src, src_bind_flags, size);
adapter_vk_copy_bo_address(context, dst, dst_bind_flags, &staging, 0, size);
adapter_vk_copy_bo_address(context, &staging, src, size);
adapter_vk_copy_bo_address(context, dst, &staging, size);
wined3d_context_vk_destroy_bo(context_vk, &staging_bo);
......@@ -834,8 +837,8 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
staging.buffer_object = (uintptr_t)&staging_bo;
staging.addr = NULL;
adapter_vk_copy_bo_address(context, &staging, 0, src, src_bind_flags, size);
adapter_vk_copy_bo_address(context, dst, dst_bind_flags, &staging, 0, size);
adapter_vk_copy_bo_address(context, &staging, src, size);
adapter_vk_copy_bo_address(context, dst, &staging, size);
wined3d_context_vk_destroy_bo(context_vk, &staging_bo);
......
......@@ -1209,8 +1209,7 @@ void wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_off
src.addr += src_offset;
context = context_acquire(dst_buffer->resource.device, NULL, 0);
wined3d_context_copy_bo_address(context, &dst, dst_buffer->resource.bind_flags,
&src, src_buffer->resource.bind_flags, size);
wined3d_context_copy_bo_address(context, &dst, &src, size);
context_release(context);
wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size);
......
......@@ -2426,8 +2426,7 @@ static void adapter_no3d_unmap_bo_address(struct wined3d_context *context,
}
static void adapter_no3d_copy_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *dst, uint32_t dst_bind_flags,
const struct wined3d_bo_address *src, uint32_t src_bind_flags, size_t size)
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size)
{
if (dst->buffer_object)
ERR("Unsupported dst buffer object %#lx.\n", dst->buffer_object);
......
......@@ -1055,7 +1055,7 @@ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_v
dst.buffer_object = view->counter_bo;
dst.addr = NULL;
wined3d_context_copy_bo_address(context, &dst, WINED3D_BIND_UNORDERED_ACCESS, &src, 0, sizeof(uint32_t));
wined3d_context_copy_bo_address(context, &dst, &src, sizeof(uint32_t));
context_release(context);
}
......@@ -1075,8 +1075,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
src.buffer_object = view->counter_bo;
src.addr = NULL;
wined3d_context_copy_bo_address(context, &dst, buffer->resource.bind_flags,
&src, WINED3D_BIND_UNORDERED_ACCESS, sizeof(uint32_t));
wined3d_context_copy_bo_address(context, &dst, &src, sizeof(uint32_t));
wined3d_buffer_invalidate_location(buffer, ~dst_location);
}
......
......@@ -2968,8 +2968,7 @@ struct wined3d_adapter_ops
void (*adapter_unmap_bo_address)(struct wined3d_context *context, const struct wined3d_bo_address *data,
unsigned int range_count, const struct wined3d_range *ranges);
void (*adapter_copy_bo_address)(struct wined3d_context *context,
const struct wined3d_bo_address *dst, uint32_t dst_bind_flags,
const struct wined3d_bo_address *src, uint32_t src_bind_flags, size_t size);
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size);
HRESULT (*adapter_create_swapchain)(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
void (*adapter_destroy_swapchain)(struct wined3d_swapchain *swapchain);
......@@ -5487,11 +5486,9 @@ static inline void wined3d_context_unmap_bo_address(struct wined3d_context *cont
}
static inline void wined3d_context_copy_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *dst, uint32_t dst_bind_flags,
const struct wined3d_bo_address *src, uint32_t src_bind_flags, size_t size)
const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size)
{
context->device->adapter->adapter_ops->adapter_copy_bo_address(context,
dst, dst_bind_flags, src, src_bind_flags, size);
context->device->adapter->adapter_ops->adapter_copy_bo_address(context, dst, src, size);
}
static inline BOOL wined3d_dsv_srv_conflict(const struct wined3d_rendertarget_view *dsv,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment