Commit 7bdbf00b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_context_gl structure to context_copy_bo_address().

parent 813e08fc
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
......@@ -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,
......
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