[PATCH 4/5] wined3d: Pass a wined3d_context_gl structure to context_copy_bo_address().

Henri Verbeet hverbeet at codeweavers.com
Fri Jun 7 07:52:30 CDT 2019


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/buffer.c          |  3 ++-
 dlls/wined3d/context.c         | 13 ++++++-------
 dlls/wined3d/view.c            |  3 ++-
 dlls/wined3d/wined3d_private.h |  6 +++---
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8dc6d4b6a1b..9fcd96b864a 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -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);
 
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 18a516c606e..933bf13fefc 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -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)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 4456a10a36b..bd32b88e0eb 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -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);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 94623580109..42140831a0a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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,
-- 
2.11.0




More information about the wine-devel mailing list