Commit 32d17f1e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent cef12f97
...@@ -4627,7 +4627,7 @@ static void adapter_gl_uninit_3d(struct wined3d_device *device) ...@@ -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, 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); return wined3d_context_gl_map_bo_address(wined3d_context_gl(context), data, size, map_flags);
} }
......
...@@ -634,7 +634,7 @@ static VkAccessFlags vk_access_mask_from_buffer_usage(VkBufferUsageFlags usage) ...@@ -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, 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); struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
const struct wined3d_vk_info *vk_info; const struct wined3d_vk_info *vk_info;
...@@ -842,8 +842,8 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context, ...@@ -842,8 +842,8 @@ static void adapter_vk_copy_bo_address(struct wined3d_context *context,
return; return;
} }
src_ptr = adapter_vk_map_bo_address(context, src, size, src_bind_flags, WINED3D_MAP_READ); src_ptr = adapter_vk_map_bo_address(context, src, size, WINED3D_MAP_READ);
dst_ptr = adapter_vk_map_bo_address(context, dst, size, dst_bind_flags, WINED3D_MAP_WRITE); dst_ptr = adapter_vk_map_bo_address(context, dst, size, WINED3D_MAP_WRITE);
memcpy(dst_ptr, src_ptr, size); memcpy(dst_ptr, src_ptr, size);
......
...@@ -1080,8 +1080,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc ...@@ -1080,8 +1080,7 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
addr.buffer_object = buffer->buffer_object; addr.buffer_object = buffer->buffer_object;
addr.addr = 0; addr.addr = 0;
buffer->map_ptr = wined3d_context_map_bo_address(context, buffer->map_ptr = wined3d_context_map_bo_address(context, &addr, resource->size, flags);
&addr, resource->size, resource->bind_flags, flags);
if (((DWORD_PTR)buffer->map_ptr) & (RESOURCE_ALIGNMENT - 1)) 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 ...@@ -1659,8 +1658,7 @@ static void wined3d_buffer_vk_upload_ranges(struct wined3d_buffer *buffer, struc
dst.buffer_object = buffer->buffer_object; dst.buffer_object = buffer->buffer_object;
dst.addr = NULL; dst.addr = NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &dst, if (!(map_ptr = wined3d_context_map_bo_address(context, &dst, resource->size, WINED3D_MAP_WRITE)))
resource->size, resource->bind_flags, WINED3D_MAP_WRITE)))
{ {
FIXME("Failed to map buffer.\n"); FIXME("Failed to map buffer.\n");
return; return;
......
...@@ -2407,7 +2407,7 @@ static void adapter_no3d_uninit_3d(struct wined3d_device *device) ...@@ -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, 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) if (data->buffer_object)
{ {
......
...@@ -645,9 +645,9 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr ...@@ -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); wined3d_texture_get_memory(dst_texture, 0, &dst_data, map_binding);
src = wined3d_context_map_bo_address(context, &src_data, 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 = 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); 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 ...@@ -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_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); 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_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; src_map = dst_map;
} }
...@@ -1705,7 +1705,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int ...@@ -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_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); 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_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) if (upload)
{ {
...@@ -1724,7 +1724,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int ...@@ -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_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); 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_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]; 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, ...@@ -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_pitch(texture, level, &map.row_pitch, &map.slice_pitch);
wined3d_texture_get_memory(texture, view->sub_resource_idx, &data, map_binding); wined3d_texture_get_memory(texture, view->sub_resource_idx, &data, map_binding);
map.data = wined3d_context_map_bo_address(context, &data, 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 map.data = (BYTE *)map.data
+ (box->front * map.slice_pitch) + (box->front * map.slice_pitch)
+ ((box->top / view->format->block_height) * map.row_pitch) + ((box->top / view->format->block_height) * map.row_pitch)
......
...@@ -720,7 +720,7 @@ static void wined3d_texture_create_dc(void *object) ...@@ -720,7 +720,7 @@ static void wined3d_texture_create_dc(void *object)
if (!context) if (!context)
context = context_acquire(device, NULL, 0); context = context_acquire(device, NULL, 0);
desc.pMemory = wined3d_context_map_bo_address(context, &data, 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 else
{ {
...@@ -3152,7 +3152,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour ...@@ -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_invalidate_location(texture, sub_resource_idx, ~resource->map_binding);
wined3d_texture_get_memory(texture, sub_resource_idx, &data, 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; sub_resource->map_flags = flags;
TRACE("Base memory pointer %p.\n", base_memory); TRACE("Base memory pointer %p.\n", base_memory);
...@@ -4298,7 +4298,7 @@ static void wined3d_texture_vk_upload_data(struct wined3d_context *context, ...@@ -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.buffer_object = (uintptr_t)&staging_bo;
staging_bo_addr.addr = NULL; staging_bo_addr.addr = NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr, 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"); ERR("Failed to map staging bo.\n");
wined3d_context_vk_destroy_bo(context_vk, &staging_bo); wined3d_context_vk_destroy_bo(context_vk, &staging_bo);
...@@ -4493,7 +4493,7 @@ static void wined3d_texture_vk_download_data(struct wined3d_context *context, ...@@ -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.buffer_object = (uintptr_t)&staging_bo;
staging_bo_addr.addr = (uint8_t *)NULL; staging_bo_addr.addr = (uint8_t *)NULL;
if (!(map_ptr = wined3d_context_map_bo_address(context, &staging_bo_addr, 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"); ERR("Failed to map staging bo.\n");
wined3d_context_vk_destroy_bo(context_vk, &staging_bo); wined3d_context_vk_destroy_bo(context_vk, &staging_bo);
......
...@@ -2964,7 +2964,7 @@ struct wined3d_adapter_ops ...@@ -2964,7 +2964,7 @@ struct wined3d_adapter_ops
HRESULT (*adapter_init_3d)(struct wined3d_device *device); HRESULT (*adapter_init_3d)(struct wined3d_device *device);
void (*adapter_uninit_3d)(struct wined3d_device *device); void (*adapter_uninit_3d)(struct wined3d_device *device);
void *(*adapter_map_bo_address)(struct wined3d_context *context, 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, void (*adapter_unmap_bo_address)(struct wined3d_context *context, const struct wined3d_bo_address *data,
unsigned int range_count, const struct wined3d_range *ranges); unsigned int range_count, const struct wined3d_range *ranges);
void (*adapter_copy_bo_address)(struct wined3d_context *context, 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 ...@@ -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, 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, static inline void wined3d_context_unmap_bo_address(struct wined3d_context *context,
......
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