Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/adapter_gl.c | 9 +-------- dlls/wined3d/context_gl.c | 19 +++++++++---------- dlls/wined3d/view.c | 3 +-- dlls/wined3d/wined3d_private.h | 3 +-- 4 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 49b9c7bcd97..ec8a2cadd23 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4654,14 +4654,7 @@ 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) { - struct wined3d_context_gl *context_gl; - GLenum dst_binding, src_binding; - - context_gl = wined3d_context_gl(context); - dst_binding = wined3d_buffer_gl_binding_from_bind_flags(context_gl->gl_info, dst_bind_flags); - src_binding = wined3d_buffer_gl_binding_from_bind_flags(context_gl->gl_info, src_bind_flags); - - wined3d_context_gl_copy_bo_address(context_gl, dst, dst_binding, src, src_binding, size); + wined3d_context_gl_copy_bo_address(wined3d_context_gl(context), dst, src, size); }
static HRESULT adapter_gl_create_swapchain(struct wined3d_device *device, struct wined3d_swapchain_desc *desc, diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index f435c7e7607..4e0af7474c1 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -2581,8 +2581,7 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl, }
void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, - const struct wined3d_bo_address *dst, GLenum dst_binding, - const struct wined3d_bo_address *src, GLenum src_binding, size_t size) + const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size) { const struct wined3d_gl_info *gl_info; struct wined3d_bo_gl *src_bo, *dst_bo; @@ -2605,27 +2604,27 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, } else { - src_ptr = wined3d_context_gl_map_bo_address(context_gl, src, size, src_binding, WINED3D_MAP_READ); - dst_ptr = wined3d_context_gl_map_bo_address(context_gl, dst, size, dst_binding, WINED3D_MAP_WRITE); + src_ptr = wined3d_context_gl_map_bo_address(context_gl, src, size, src_bo->binding, WINED3D_MAP_READ); + dst_ptr = wined3d_context_gl_map_bo_address(context_gl, dst, size, dst_bo->binding, WINED3D_MAP_WRITE);
memcpy(dst_ptr, src_ptr, size);
range.offset = 0; range.size = size; - wined3d_context_gl_unmap_bo_address(context_gl, dst, dst_binding, 1, &range); - wined3d_context_gl_unmap_bo_address(context_gl, src, src_binding, 0, NULL); + wined3d_context_gl_unmap_bo_address(context_gl, dst, dst_bo->binding, 1, &range); + wined3d_context_gl_unmap_bo_address(context_gl, src, src_bo->binding, 0, NULL); } } else if (!dst_bo && src_bo) { - wined3d_context_gl_bind_bo(context_gl, src_binding, src_bo->id); - GL_EXTCALL(glGetBufferSubData(src_binding, (GLintptr)src->addr, size, dst->addr)); + wined3d_context_gl_bind_bo(context_gl, src_bo->binding, src_bo->id); + GL_EXTCALL(glGetBufferSubData(src_bo->binding, (GLintptr)src->addr, size, dst->addr)); checkGLcall("buffer download"); } else if (dst_bo && !src_bo) { - wined3d_context_gl_bind_bo(context_gl, dst_binding, dst_bo->id); - GL_EXTCALL(glBufferSubData(dst_binding, (GLintptr)dst->addr, size, src->addr)); + wined3d_context_gl_bind_bo(context_gl, dst_bo->binding, dst_bo->id); + GL_EXTCALL(glBufferSubData(dst_bo->binding, (GLintptr)dst->addr, size, src->addr)); checkGLcall("buffer upload"); } else diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index e1dd4de8dab..cb0f2e2e25b 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1073,8 +1073,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_ src.buffer_object = (uintptr_t)&view_gl->counter_bo; src.addr = NULL;
- wined3d_context_gl_copy_bo_address(context_gl, &dst, wined3d_buffer_gl(buffer)->bo.binding, - &src, GL_ATOMIC_COUNTER_BUFFER, sizeof(GLuint)); + wined3d_context_gl_copy_bo_address(context_gl, &dst, &src, sizeof(GLuint));
wined3d_buffer_invalidate_location(buffer, ~dst_location); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e6cbfce17d8..86986209683 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2176,8 +2176,7 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name) DECLSPEC_HIDDEN; void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target) DECLSPEC_HIDDEN; void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl, - const struct wined3d_bo_address *dst, GLenum dst_binding, - const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN; + const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, size_t size) DECLSPEC_HIDDEN; void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,