[PATCH 2/4] wined3d: Fix downloading data for 1D array textures.

Józef Kucia jkucia at codeweavers.com
Fri Nov 16 06:02:10 CST 2018


glGetTexImage() downloads data for all layers.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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 e01becd44f84..05f210f6fd52 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;
     }
 
-- 
2.18.1




More information about the wine-devel mailing list