=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Return location from wined3d_buffer_get_memory().

Alexandre Julliard julliard at winehq.org
Mon Nov 7 13:44:00 CST 2016


Module: wine
Branch: master
Commit: e2733ed7fbcc9ca205e5e9b7507f301021b742cc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e2733ed7fbcc9ca205e5e9b7507f301021b742cc

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Nov  4 13:43:47 2016 +0100

wined3d: Return location from wined3d_buffer_get_memory().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/buffer.c          | 10 +++++-----
 dlls/wined3d/wined3d_private.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6b59965..58c273c 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -631,7 +631,7 @@ BYTE *wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_c
     return buffer->resource.heap_memory;
 }
 
-void wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
+DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
         struct wined3d_bo_address *data, DWORD locations)
 {
     TRACE("buffer %p, data %p, locations %s.\n",
@@ -641,18 +641,19 @@ void wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
     {
         data->buffer_object = buffer->buffer_object;
         data->addr = NULL;
-        return;
+        return WINED3D_LOCATION_BUFFER;
     }
     if (locations & WINED3D_LOCATION_SYSMEM)
     {
         data->buffer_object = 0;
         data->addr = buffer->resource.heap_memory;
-        return;
+        return WINED3D_LOCATION_SYSMEM;
     }
 
     ERR("Unexpected locations %s.\n", wined3d_debug_location(locations));
     data->buffer_object = 0;
     data->addr = NULL;
+    return 0;
 }
 
 static void buffer_unload(struct wined3d_resource *resource)
@@ -1274,7 +1275,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
     context = context_acquire(device, NULL);
     gl_info = context->gl_info;
 
-    wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations);
+    dst_location = wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations);
     wined3d_buffer_get_memory(src_buffer, &src, src_buffer->locations);
 
     if (dst.buffer_object && src.buffer_object)
@@ -1326,7 +1327,6 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
         memcpy(dst.addr + dst_offset, src.addr + src_offset, size);
     }
 
-    dst_location = dst.buffer_object ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM;
     wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size);
 
     context_release(context);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 503f7f2..6e742f6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3179,7 +3179,7 @@ static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resourc
 }
 
 void buffer_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN;
-void wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
+DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer,
         struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN;
 void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location) DECLSPEC_HIDDEN;
 void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context,




More information about the wine-cvs mailing list