Commit 45fc3cbf authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 793ac83d
......@@ -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,
......
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