wined3d: Do not pass an offset and size to wined3d_bo_gl_map().

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:
Henri Verbeet 2021-11-30 17:55:21 -06:00 committed by Alexandre Julliard
parent 793ac83d5b
commit 45fc3cbf12
1 changed files with 8 additions and 8 deletions

View File

@ -2669,8 +2669,7 @@ void wined3d_context_gl_submit_command_fence(struct wined3d_context_gl *context_
wined3d_context_gl_poll_fences(context_gl);
}
static void *wined3d_bo_gl_map(struct wined3d_bo_gl *bo,
struct wined3d_context_gl *context_gl, size_t offset, size_t size, uint32_t flags)
static void *wined3d_bo_gl_map(struct wined3d_bo_gl *bo, struct wined3d_context_gl *context_gl, uint32_t flags)
{
struct wined3d_device_gl *device_gl = wined3d_device_gl(context_gl->c.device);
const struct wined3d_gl_info *gl_info;
@ -2712,13 +2711,11 @@ map:
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
{
if ((map_ptr = GL_EXTCALL(glMapBufferRange(bo->binding, 0, bo->size, wined3d_resource_gl_map_flags(bo, flags)))))
map_ptr += offset;
map_ptr = GL_EXTCALL(glMapBufferRange(bo->binding, 0, bo->size, wined3d_resource_gl_map_flags(bo, flags)));
}
else
{
if ((map_ptr = GL_EXTCALL(glMapBuffer(bo->binding, wined3d_resource_gl_legacy_map_flags(flags)))))
map_ptr += offset;
map_ptr = GL_EXTCALL(glMapBuffer(bo->binding, wined3d_resource_gl_legacy_map_flags(flags)));
}
wined3d_context_gl_bind_bo(context_gl, bo->binding, 0);
@ -2736,10 +2733,13 @@ void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl,
if (!(bo = data->buffer_object))
return data->addr;
if (!(map_ptr = wined3d_bo_gl_map(wined3d_bo_gl(bo), context_gl, (uintptr_t)data->addr, size, flags)))
if (!(map_ptr = wined3d_bo_gl_map(wined3d_bo_gl(bo), context_gl, flags)))
{
ERR("Failed to map bo.\n");
return NULL;
}
return map_ptr;
return (uint8_t *)map_ptr + (uintptr_t)data->addr;
}
static void flush_bo_ranges(struct wined3d_context_gl *context_gl, const struct wined3d_const_bo_address *data,