Henri Verbeet : wined3d: Use wined3d_texture_get_sub_resource_target() in surface_download_data().
Alexandre Julliard
julliard at winehq.org
Wed Feb 21 18:39:40 CST 2018
Module: wine
Branch: master
Commit: a09edd24461c75529565a9195835a25c4e24f657
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a09edd24461c75529565a9195835a25c4e24f657
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Wed Feb 21 10:43:30 2018 +0330
wined3d: Use wined3d_texture_get_sub_resource_target() in surface_download_data().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/surface.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c3fabef..91979ee 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -555,6 +555,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
unsigned int src_row_pitch, src_slice_pitch;
struct wined3d_bo_address data;
BYTE *temporary_mem = NULL;
+ GLenum target;
void *mem;
/* Only support read back of converted P8 surfaces. */
@@ -565,8 +566,9 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
}
sub_resource = &texture->sub_resources[sub_resource_idx];
+ target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
- if (surface->texture_target == GL_TEXTURE_2D_ARRAY)
+ if (target == GL_TEXTURE_2D_ARRAY)
{
if (format->download)
{
@@ -658,7 +660,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
TRACE("Downloading compressed surface %p, level %u, format %#x, type %#x, data %p.\n",
surface, surface->texture_level, format->glFormat, format->glType, mem);
- GL_EXTCALL(glGetCompressedTexImage(surface->texture_target, surface->texture_level, mem));
+ GL_EXTCALL(glGetCompressedTexImage(target, surface->texture_level, mem));
checkGLcall("glGetCompressedTexImage");
}
else
@@ -666,8 +668,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
TRACE("Downloading surface %p, level %u, format %#x, type %#x, data %p.\n",
surface, surface->texture_level, format->glFormat, format->glType, mem);
- gl_info->gl_ops.gl.p_glGetTexImage(surface->texture_target, surface->texture_level,
- format->glFormat, format->glType, mem);
+ gl_info->gl_ops.gl.p_glGetTexImage(target, surface->texture_level, format->glFormat, format->glType, mem);
checkGLcall("glGetTexImage");
}
More information about the wine-cvs
mailing list