wined3d: Pass a wined3d_context_gl structure to context_copy_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 2019-06-07 17:22:30 +04:30 committed by Alexandre Julliard
parent 813e08fc1d
commit 7bdbf00b0f
4 changed files with 13 additions and 12 deletions

View File

@ -1218,7 +1218,8 @@ void wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_off
src.addr += src_offset;
context = context_acquire(dst_buffer->resource.device, NULL, 0);
context_copy_bo_address(context, &dst, wined3d_buffer_gl(dst_buffer)->buffer_type_hint,
wined3d_context_gl_copy_bo_address(wined3d_context_gl(context),
&dst, wined3d_buffer_gl(dst_buffer)->buffer_type_hint,
&src, wined3d_buffer_gl(src_buffer)->buffer_type_hint, size);
context_release(context);

View File

@ -2634,15 +2634,14 @@ void context_unmap_bo_address(struct wined3d_context *context,
checkGLcall("Unmap buffer object");
}
void context_copy_bo_address(struct wined3d_context *context,
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)
{
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info;
BYTE *dst_ptr, *src_ptr;
gl_info = context->gl_info;
gl_info = context_gl->c.gl_info;
if (dst->buffer_object && src->buffer_object)
{
@ -2656,13 +2655,13 @@ void context_copy_bo_address(struct wined3d_context *context,
}
else
{
src_ptr = context_map_bo_address(context, src, size, src_binding, WINED3D_MAP_READ);
dst_ptr = context_map_bo_address(context, dst, size, dst_binding, WINED3D_MAP_WRITE);
src_ptr = context_map_bo_address(&context_gl->c, src, size, src_binding, WINED3D_MAP_READ);
dst_ptr = context_map_bo_address(&context_gl->c, dst, size, dst_binding, WINED3D_MAP_WRITE);
memcpy(dst_ptr, src_ptr, size);
context_unmap_bo_address(context, dst, dst_binding);
context_unmap_bo_address(context, src, src_binding);
context_unmap_bo_address(&context_gl->c, dst, dst_binding);
context_unmap_bo_address(&context_gl->c, src, src_binding);
}
}
else if (!dst->buffer_object && src->buffer_object)

View File

@ -1096,6 +1096,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context)
{
struct wined3d_unordered_access_view_gl *view_gl = wined3d_unordered_access_view_gl(view);
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
struct wined3d_bo_address dst, src;
DWORD dst_location;
@ -1108,7 +1109,7 @@ void wined3d_unordered_access_view_copy_counter(struct wined3d_unordered_access_
src.buffer_object = view_gl->counter_bo;
src.addr = NULL;
context_copy_bo_address(context, &dst, wined3d_buffer_gl(buffer)->buffer_type_hint,
wined3d_context_gl_copy_bo_address(context_gl, &dst, wined3d_buffer_gl(buffer)->buffer_type_hint,
&src, GL_ATOMIC_COUNTER_BUFFER, sizeof(GLuint));
wined3d_buffer_invalidate_location(buffer, ~dst_location);

View File

@ -2086,6 +2086,9 @@ void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *con
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;
void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
void wined3d_context_gl_free_fence(struct wined3d_fence *fence) DECLSPEC_HIDDEN;
void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN;
@ -2239,9 +2242,6 @@ void wined3d_raw_blitter_create(struct wined3d_blitter **next,
BOOL wined3d_clip_blit(const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN;
void context_copy_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *dst, GLenum dst_binding,
const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN;
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN;
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,