wined3d: Drop the "bind_flags" parameter to wined3d_adapter_ops.adapter_map_bo_address().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-04-22 17:42:46 +04:30 committed by Alexandre Julliard
parent cef12f97d6
commit 32d17f1e9a
7 changed files with 20 additions and 22 deletions

View File

@ -4627,7 +4627,7 @@ static void adapter_gl_uninit_3d(struct wined3d_device *device)
}
static void *adapter_gl_map_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, uint32_t bind_flags, uint32_t map_flags)
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
{
return wined3d_context_gl_map_bo_address(wined3d_context_gl(context), data, size, map_flags);
}

View File

@ -634,7 +634,7 @@ static VkAccessFlags vk_access_mask_from_buffer_usage(VkBufferUsageFlags usage)
}
static void *adapter_vk_map_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, uint32_t bind_flags, uint32_t map_flags)
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
{
struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
const struct wined3d_vk_info *vk_info;
@ -842,8 +842,8 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
return;
}
src_ptr = adapter_vk_map_bo_address(context, src, size, src_bind_flags, WINED3D_MAP_READ);
dst_ptr = adapter_vk_map_bo_address(context, dst, size, dst_bind_flags, WINED3D_MAP_WRITE);
src_ptr = adapter_vk_map_bo_address(context, src, size, WINED3D_MAP_READ);
dst_ptr = adapter_vk_map_bo_address(context, dst, size, WINED3D_MAP_WRITE);
memcpy(dst_ptr, src_ptr, size);

View File

@ -1080,8 +1080,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
addr.buffer_object = buffer->buffer_object;
addr.addr = 0;
buffer->map_ptr = wined3d_context_map_bo_address(context,
&addr, resource->size, resource->bind_flags, flags);
buffer->map_ptr = wined3d_context_map_bo_address(context, &addr, resource->size, flags);
if (((DWORD_PTR)buffer->map_ptr) & (RESOURCE_ALIGNMENT - 1))
{
@ -1659,8 +1658,7 @@ static void wined3d_buffer_vk_upload_ranges(struct wined3d_buffer *buffer, struc
dst.buffer_object = buffer->buffer_object;
dst.addr = NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &dst,
resource->size, resource->bind_flags, WINED3D_MAP_WRITE)))
if (!(map_ptr = wined3d_context_map_bo_address(context, &dst, resource->size, WINED3D_MAP_WRITE)))
{
FIXME("Failed to map buffer.\n");
return;

View File

@ -2407,7 +2407,7 @@ static void adapter_no3d_uninit_3d(struct wined3d_device *device)
}
static void *adapter_no3d_map_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, uint32_t bind_flags, uint32_t map_flags)
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
{
if (data->buffer_object)
{

View File

@ -645,9 +645,9 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr
wined3d_texture_get_memory(dst_texture, 0, &dst_data, map_binding);
src = wined3d_context_map_bo_address(context, &src_data,
src_texture->sub_resources[sub_resource_idx].size, 0, WINED3D_MAP_READ);
src_texture->sub_resources[sub_resource_idx].size, WINED3D_MAP_READ);
dst = wined3d_context_map_bo_address(context, &dst_data,
dst_texture->sub_resources[0].size, 0, WINED3D_MAP_WRITE);
dst_texture->sub_resources[0].size, WINED3D_MAP_WRITE);
conv->convert(src, dst, src_row_pitch, dst_row_pitch, desc.width, desc.height);
@ -1668,7 +1668,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
wined3d_texture_get_pitch(dst_texture, texture_level, &dst_map.row_pitch, &dst_map.slice_pitch);
wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_data, map_binding);
dst_map.data = wined3d_context_map_bo_address(context, &dst_data,
dst_texture->sub_resources[dst_sub_resource_idx].size, 0, WINED3D_MAP_READ | WINED3D_MAP_WRITE);
dst_texture->sub_resources[dst_sub_resource_idx].size, WINED3D_MAP_READ | WINED3D_MAP_WRITE);
src_map = dst_map;
}
@ -1705,7 +1705,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
wined3d_texture_get_pitch(src_texture, texture_level, &src_map.row_pitch, &src_map.slice_pitch);
wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &src_data, map_binding);
src_map.data = wined3d_context_map_bo_address(context, &src_data,
src_texture->sub_resources[src_sub_resource_idx].size, 0, WINED3D_MAP_READ);
src_texture->sub_resources[src_sub_resource_idx].size, WINED3D_MAP_READ);
if (upload)
{
@ -1724,7 +1724,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
wined3d_texture_get_pitch(dst_texture, texture_level, &dst_map.row_pitch, &dst_map.slice_pitch);
wined3d_texture_get_memory(dst_texture, dst_sub_resource_idx, &dst_data, map_binding);
dst_map.data = wined3d_context_map_bo_address(context, &dst_data,
dst_texture->sub_resources[dst_sub_resource_idx].size, 0, WINED3D_MAP_WRITE);
dst_texture->sub_resources[dst_sub_resource_idx].size, WINED3D_MAP_WRITE);
}
}
src_fmt_flags = src_format->flags[src_texture->resource.gl_type];
@ -2192,7 +2192,7 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
wined3d_texture_get_pitch(texture, level, &map.row_pitch, &map.slice_pitch);
wined3d_texture_get_memory(texture, view->sub_resource_idx, &data, map_binding);
map.data = wined3d_context_map_bo_address(context, &data,
texture->sub_resources[view->sub_resource_idx].size, 0, WINED3D_MAP_WRITE);
texture->sub_resources[view->sub_resource_idx].size, WINED3D_MAP_WRITE);
map.data = (BYTE *)map.data
+ (box->front * map.slice_pitch)
+ ((box->top / view->format->block_height) * map.row_pitch)

View File

@ -720,7 +720,7 @@ static void wined3d_texture_create_dc(void *object)
if (!context)
context = context_acquire(device, NULL, 0);
desc.pMemory = wined3d_context_map_bo_address(context, &data,
texture->sub_resources[sub_resource_idx].size, 0, WINED3D_MAP_READ | WINED3D_MAP_WRITE);
texture->sub_resources[sub_resource_idx].size, WINED3D_MAP_READ | WINED3D_MAP_WRITE);
}
else
{
@ -3152,7 +3152,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
wined3d_texture_invalidate_location(texture, sub_resource_idx, ~resource->map_binding);
wined3d_texture_get_memory(texture, sub_resource_idx, &data, resource->map_binding);
base_memory = wined3d_context_map_bo_address(context, &data, sub_resource->size, 0, flags);
base_memory = wined3d_context_map_bo_address(context, &data, sub_resource->size, flags);
sub_resource->map_flags = flags;
TRACE("Base memory pointer %p.\n", base_memory);
@ -4298,7 +4298,7 @@ static void wined3d_texture_vk_upload_data(struct wined3d_context *context,
staging_bo_addr.buffer_object = (uintptr_t)&staging_bo;
staging_bo_addr.addr = NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr,
sub_resource->size, 0, WINED3D_MAP_DISCARD | WINED3D_MAP_WRITE)))
sub_resource->size, WINED3D_MAP_DISCARD | WINED3D_MAP_WRITE)))
{
ERR("Failed to map staging bo.\n");
wined3d_context_vk_destroy_bo(context_vk, &staging_bo);
@ -4493,7 +4493,7 @@ static void wined3d_texture_vk_download_data(struct wined3d_context *context,
staging_bo_addr.buffer_object = (uintptr_t)&staging_bo;
staging_bo_addr.addr = (uint8_t *)NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr,
sub_resource->size, 0, WINED3D_MAP_READ)))
sub_resource->size, WINED3D_MAP_READ)))
{
ERR("Failed to map staging bo.\n");
wined3d_context_vk_destroy_bo(context_vk, &staging_bo);

View File

@ -2964,7 +2964,7 @@ struct wined3d_adapter_ops
HRESULT (*adapter_init_3d)(struct wined3d_device *device);
void (*adapter_uninit_3d)(struct wined3d_device *device);
void *(*adapter_map_bo_address)(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, uint32_t bind_flags, uint32_t map_flags);
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags);
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,
@ -5475,9 +5475,9 @@ static inline float wined3d_get_float_state(const struct wined3d_state *state, e
}
static inline void *wined3d_context_map_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, size_t size, uint32_t bind_flags, uint32_t map_flags)
const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
{
return context->device->adapter->adapter_ops->adapter_map_bo_address(context, data, size, bind_flags, map_flags);
return context->device->adapter->adapter_ops->adapter_map_bo_address(context, data, size, map_flags);
}
static inline void wined3d_context_unmap_bo_address(struct wined3d_context *context,