=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Fix downloading data for 1D array textures.

Alexandre Julliard julliard at winehq.org
Fri Nov 16 14:38:20 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Fri Nov 16 13:02:10 2018 +0100

wined3d: Fix downloading data for 1D array textures.

glGetTexImage() downloads data for all layers.

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/texture.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index e01becd..05f210f 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2159,7 +2159,7 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
     }
 }
 
-static void texture2d_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
+static void texture_download_data_slow_path(struct wined3d_texture *texture, unsigned int sub_resource_idx,
         struct wined3d_context *context, const struct wined3d_bo_address *data)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -2186,7 +2186,7 @@ static void texture2d_download_data(struct wined3d_texture *texture, unsigned in
     target = wined3d_texture_gl_get_sub_resource_target(wined3d_texture_gl(texture), sub_resource_idx);
     level = sub_resource_idx % texture->level_count;
 
-    if (target == GL_TEXTURE_2D_ARRAY)
+    if (target == GL_TEXTURE_1D_ARRAY || target == GL_TEXTURE_2D_ARRAY)
     {
         if (format_gl->f.download)
         {
@@ -2401,12 +2401,12 @@ void wined3d_texture_download_data(struct wined3d_texture *texture, unsigned int
     target = wined3d_texture_gl_get_sub_resource_target(wined3d_texture_gl(texture), sub_resource_idx);
     level = sub_resource_idx % texture->level_count;
 
-    if (texture->resource.type == WINED3D_RTYPE_TEXTURE_2D
-        && (target == GL_TEXTURE_2D_ARRAY || format_gl->f.conv_byte_count
+    if ((texture->resource.type == WINED3D_RTYPE_TEXTURE_2D
+            && (target == GL_TEXTURE_2D_ARRAY || format_gl->f.conv_byte_count
             || texture->flags & (WINED3D_TEXTURE_CONVERTED | WINED3D_TEXTURE_COND_NP2_EMULATED)))
+            || target == GL_TEXTURE_1D_ARRAY)
     {
-        /* 2D-specific special cases. */
-        texture2d_download_data(texture, sub_resource_idx, context, data);
+        texture_download_data_slow_path(texture, sub_resource_idx, context, data);
         return;
     }
 




More information about the wine-cvs mailing list