[PATCH 1/6] wined3d: Use the texture dimension helpers in wined3d_volume_upload_data().

Henri Verbeet hverbeet at codeweavers.com
Wed Apr 13 12:09:51 CDT 2016


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

diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 02b5db6..cb60a24 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -79,9 +79,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
     const struct wined3d_gl_info *gl_info = context->gl_info;
     struct wined3d_texture *texture = volume->container;
     const struct wined3d_format *format = texture->resource.format;
-    UINT width = volume->resource.width;
-    UINT height = volume->resource.height;
-    UINT depth = volume->resource.depth;
+    unsigned int width, height, depth;
     const void *mem = data->addr;
     void *converted_mem = NULL;
 
@@ -89,6 +87,10 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
             volume, context, volume->texture_level, debug_d3dformat(format->id),
             format->id);
 
+    width = wined3d_texture_get_level_width(texture, volume->texture_level);
+    height = wined3d_texture_get_level_height(texture, volume->texture_level);
+    depth = wined3d_texture_get_level_depth(texture, volume->texture_level);
+
     if (format->convert)
     {
         UINT dst_row_pitch, dst_slice_pitch;
-- 
2.1.4




More information about the wine-patches mailing list