Zebediah Figura : wined3d: Use wined3d_buffer_load_location() in wined3d_buffer_get_memory().

Alexandre Julliard julliard at winehq.org
Fri Jan 28 14:29:33 CST 2022


Module: wine
Branch: master
Commit: 287bfc775828762e4b8212157cabf05d38b3f237
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=287bfc775828762e4b8212157cabf05d38b3f237

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Fri Jan 28 15:47:24 2022 +0100

wined3d: Use wined3d_buffer_load_location() in wined3d_buffer_get_memory().

wined3d_buffer_load_location() can handle loading from
WINED3D_LOCATION_DISCARDED just fine, so use it instead of duplicating the
functionality here.

Signed-off-by: Zebediah Figura <zfigura 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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index b42c7bd919a..3d66af3e5e6 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -653,14 +653,12 @@ DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_co
     if (locations & WINED3D_LOCATION_DISCARDED)
     {
         locations = ((buffer->flags & WINED3D_BUFFER_USE_BO) ? WINED3D_LOCATION_BUFFER : WINED3D_LOCATION_SYSMEM);
-        if (!wined3d_buffer_prepare_location(buffer, context, locations))
+        if (!wined3d_buffer_load_location(buffer, context, locations))
         {
             data->buffer_object = 0;
             data->addr = NULL;
             return 0;
         }
-        wined3d_buffer_validate_location(buffer, locations);
-        wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_DISCARDED);
     }
     if (locations & WINED3D_LOCATION_BUFFER)
     {




More information about the wine-cvs mailing list