[PATCH 5/5] wined3d: Do not download textures to WINED3D_LOCATION_BUFFER in wined3d_texture_gl_unload().

Henri Verbeet hverbeet at codeweavers.com
Tue Dec 3 10:36:00 CST 2019


Since we remove any potential PBO a few lines later.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/texture.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index a3bbf2585d8..1c315a1dd77 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2942,6 +2942,7 @@ static void wined3d_texture_gl_unload(struct wined3d_resource *resource)
     UINT sub_count = texture_gl->t.level_count * texture_gl->t.layer_count;
     struct wined3d_renderbuffer_entry *entry, *entry2;
     struct wined3d_device *device = resource->device;
+    unsigned int location = resource->map_binding;
     const struct wined3d_gl_info *gl_info;
     struct wined3d_context *context;
     UINT i;
@@ -2951,14 +2952,17 @@ static void wined3d_texture_gl_unload(struct wined3d_resource *resource)
     context = context_acquire(device, NULL, 0);
     gl_info = wined3d_context_gl(context)->gl_info;
 
+    if (location == WINED3D_LOCATION_BUFFER)
+        location = WINED3D_LOCATION_SYSMEM;
+
     for (i = 0; i < sub_count; ++i)
     {
         struct wined3d_texture_sub_resource *sub_resource = &texture_gl->t.sub_resources[i];
 
         if (resource->access & WINED3D_RESOURCE_ACCESS_CPU
-                && wined3d_texture_load_location(&texture_gl->t, i, context, resource->map_binding))
+                && wined3d_texture_load_location(&texture_gl->t, i, context, location))
         {
-            wined3d_texture_invalidate_location(&texture_gl->t, i, ~resource->map_binding);
+            wined3d_texture_invalidate_location(&texture_gl->t, i, ~location);
         }
         else
         {
-- 
2.11.0




More information about the wine-devel mailing list