[PATCH 3/5] wined3d: Make volumes sub resources.

Stefan Dösinger stefan at codeweavers.com
Mon Feb 10 06:28:19 CST 2014


---
 dlls/wined3d/device.c          |   8 +--
 dlls/wined3d/texture.c         |   2 +-
 dlls/wined3d/volume.c          | 129 +++++++++++++++++++++--------------------
 dlls/wined3d/wined3d_private.h |   4 +-
 4 files changed, 73 insertions(+), 70 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 42cee15..63041f3 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3321,14 +3321,14 @@ static HRESULT device_update_volume(struct wined3d_device *device,
     TRACE("device %p, src_volume %p, dst_volume %p.\n",
             device, src_volume, dst_volume);
 
-    if (src_volume->resource.format != dst_volume->resource.format)
+    if (src_volume->sub_resource.resource.format != dst_volume->sub_resource.resource.format)
     {
         FIXME("Source and destination formats do not match.\n");
         return WINED3DERR_INVALIDCALL;
     }
-    if (src_volume->resource.width != dst_volume->resource.width
-            || src_volume->resource.height != dst_volume->resource.height
-            || src_volume->resource.depth != dst_volume->resource.depth)
+    if (src_volume->sub_resource.resource.width != dst_volume->sub_resource.resource.width
+            || src_volume->sub_resource.resource.height != dst_volume->sub_resource.resource.height
+            || src_volume->sub_resource.resource.depth != dst_volume->sub_resource.resource.depth)
     {
         FIXME("Source and destination sizes do not match.\n");
         return WINED3DERR_INVALIDCALL;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index f325d9c..754ebeb 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1179,7 +1179,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
             return hr;
         }
 
-        texture->sub_resources[i] = &volume->resource;
+        texture->sub_resources[i] = &volume->sub_resource.resource;
 
         /* Calculate the next mipmap level. */
         volume_desc.width = max(1, volume_desc.width >> 1);
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 817fe7e..dfdeb61 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -36,10 +36,10 @@ void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture
 
 static BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
 {
-    if (volume->resource.heap_memory)
+    if (volume->sub_resource.resource.heap_memory)
         return TRUE;
 
-    if (!wined3d_resource_allocate_sysmem(&volume->resource))
+    if (!wined3d_resource_allocate_sysmem(&volume->sub_resource.resource))
     {
         ERR("Failed to allocate system memory.\n");
         return FALSE;
@@ -52,7 +52,7 @@ static void wined3d_volume_allocate_texture(struct wined3d_volume *volume,
         const struct wined3d_context *context, BOOL srgb)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
-    const struct wined3d_format *format = volume->resource.format;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
     void *mem = NULL;
 
     if (gl_info->supported[APPLE_CLIENT_STORAGE] && !format->convert
@@ -61,14 +61,14 @@ static void wined3d_volume_allocate_texture(struct wined3d_volume *volume,
         TRACE("Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p\n", volume);
         gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
         checkGLcall("glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE)");
-        mem = volume->resource.heap_memory;
+        mem = volume->sub_resource.resource.heap_memory;
         volume->flags |= WINED3D_VFLAG_CLIENT_STORAGE;
     }
 
     GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, volume->texture_level,
             srgb ? format->glGammaInternal : format->glInternal,
-            volume->resource.width, volume->resource.height, volume->resource.depth,
-            0, format->glFormat, format->glType, mem));
+            volume->sub_resource.resource.width, volume->sub_resource.resource.height,
+            volume->sub_resource.resource.depth, 0, format->glFormat, format->glType, mem));
     checkGLcall("glTexImage3D");
 
     if (mem)
@@ -81,23 +81,25 @@ static void wined3d_volume_allocate_texture(struct wined3d_volume *volume,
 static void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pitch,
         UINT *slice_pitch)
 {
-    const struct wined3d_format *format = volume->resource.format;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
 
     if (format->flags & WINED3DFMT_FLAG_BLOCKS)
     {
         /* Since compressed formats are block based, pitch means the amount of
          * bytes to the next row of block rather than the next row of pixels. */
-        UINT row_block_count = (volume->resource.width + format->block_width - 1) / format->block_width;
-        UINT slice_block_count = (volume->resource.height + format->block_height - 1) / format->block_height;
+        UINT row_block_count = (volume->sub_resource.resource.width + format->block_width - 1)
+                / format->block_width;
+        UINT slice_block_count = (volume->sub_resource.resource.height + format->block_height - 1)
+                / format->block_height;
         *row_pitch = row_block_count * format->block_byte_count;
         *slice_pitch = *row_pitch * slice_block_count;
     }
     else
     {
-        unsigned char alignment = volume->resource.device->surface_alignment;
-        *row_pitch = format->byte_count * volume->resource.width;  /* Bytes / row */
+        unsigned char alignment = volume->sub_resource.resource.device->surface_alignment;
+        *row_pitch = format->byte_count * volume->sub_resource.resource.width;  /* Bytes / row */
         *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
-        *slice_pitch = *row_pitch * volume->resource.height;
+        *slice_pitch = *row_pitch * volume->sub_resource.resource.height;
     }
 
     TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
@@ -108,10 +110,10 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
         const struct wined3d_bo_address *data)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
-    const struct wined3d_format *format = volume->resource.format;
-    UINT width = volume->resource.width;
-    UINT height = volume->resource.height;
-    UINT depth = volume->resource.depth;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
+    UINT width = volume->sub_resource.resource.width;
+    UINT height = volume->sub_resource.resource.height;
+    UINT depth = volume->sub_resource.resource.depth;
     BYTE *mem = data->addr;
 
     TRACE("volume %p, context %p, level %u, format %s (%#x).\n",
@@ -122,7 +124,7 @@ void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wine
     {
         UINT dst_row_pitch, dst_slice_pitch;
         UINT src_row_pitch, src_slice_pitch;
-        UINT alignment = volume->resource.device->surface_alignment;
+        UINT alignment = volume->sub_resource.resource.device->surface_alignment;
 
         if (data->buffer_object)
             ERR("Loading a converted volume from a PBO.\n");
@@ -180,7 +182,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume,
         const struct wined3d_context *context, const struct wined3d_bo_address *data)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
-    const struct wined3d_format *format = volume->resource.format;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
 
     if (format->convert)
     {
@@ -209,7 +211,7 @@ static void wined3d_volume_download_data(struct wined3d_volume *volume,
 
 static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
 {
-    wined3d_resource_free_sysmem(&volume->resource);
+    wined3d_resource_free_sysmem(&volume->sub_resource.resource);
     wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM);
 }
 
@@ -248,7 +250,7 @@ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
 
     WARN_(d3d_perf)("Performing slow rgb/srgb volume transfer.\n");
     data.buffer_object = 0;
-    data.addr = HeapAlloc(GetProcessHeap(), 0, volume->resource.size);
+    data.addr = HeapAlloc(GetProcessHeap(), 0, volume->sub_resource.resource.size);
     if (!data.addr)
         return;
 
@@ -262,11 +264,11 @@ static void wined3d_volume_srgb_transfer(struct wined3d_volume *volume,
 
 static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume)
 {
-    if (volume->resource.pool != WINED3D_POOL_MANAGED)
+    if (volume->sub_resource.resource.pool != WINED3D_POOL_MANAGED)
         return FALSE;
     if (volume->download_count >= 10)
         return FALSE;
-    if (volume->resource.format->convert)
+    if (volume->sub_resource.resource.format->convert)
         return FALSE;
     if (volume->flags & WINED3D_VFLAG_CLIENT_STORAGE)
         return FALSE;
@@ -288,10 +290,10 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
         return;
     }
 
-    if ((volume->resource.access_flags & required_access) != required_access)
+    if ((volume->sub_resource.resource.access_flags & required_access) != required_access)
     {
         ERR("Operation requires %#x access, but volume only has %#x.\n",
-                required_access, volume->resource.access_flags);
+                required_access, volume->sub_resource.resource.access_flags);
         return;
     }
 
@@ -312,7 +314,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
             }
             else if (volume->locations & WINED3D_LOCATION_SYSMEM)
             {
-                struct wined3d_bo_address data = {0, volume->resource.heap_memory};
+                struct wined3d_bo_address data = {0, volume->sub_resource.resource.heap_memory};
                 wined3d_volume_upload_data(volume, context, &data);
             }
             else if (volume->locations & WINED3D_LOCATION_BUFFER)
@@ -341,7 +343,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
             break;
 
         case WINED3D_LOCATION_SYSMEM:
-            if (!volume->resource.heap_memory)
+            if (!volume->sub_resource.resource.heap_memory)
                 ERR("Trying to load WINED3D_LOCATION_SYSMEM without setting it up first.\n");
 
             if (volume->locations & WINED3D_LOCATION_DISCARDED)
@@ -351,7 +353,7 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
             }
             else if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
             {
-                struct wined3d_bo_address data = {0, volume->resource.heap_memory};
+                struct wined3d_bo_address data = {0, volume->sub_resource.resource.heap_memory};
 
                 if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB)
                     wined3d_texture_bind_and_dirtify(volume->container, context, FALSE);
@@ -442,7 +444,8 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win
 
     GL_EXTCALL(glGenBuffersARB(1, &volume->pbo));
     GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->pbo));
-    GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->resource.size, NULL, GL_STREAM_DRAW_ARB));
+    GL_EXTCALL(glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, volume->sub_resource.resource.size,
+            NULL, GL_STREAM_DRAW_ARB));
     GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
     checkGLcall("Create PBO");
 
@@ -451,7 +454,7 @@ static void wined3d_volume_prepare_pbo(struct wined3d_volume *volume, struct win
 
 static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
 {
-    struct wined3d_context *context = context_acquire(volume->resource.device, NULL);
+    struct wined3d_context *context = context_acquire(volume->sub_resource.resource.device, NULL);
     const struct wined3d_gl_info *gl_info = context->gl_info;
 
     TRACE("Deleting PBO %u belonging to volume %p.\n", volume->pbo, volume);
@@ -464,10 +467,10 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
 static void volume_unload(struct wined3d_resource *resource)
 {
     struct wined3d_volume *volume = volume_from_resource(resource);
-    struct wined3d_device *device = volume->resource.device;
+    struct wined3d_device *device = volume->sub_resource.resource.device;
     struct wined3d_context *context;
 
-    if (volume->resource.pool == WINED3D_POOL_DEFAULT)
+    if (volume->sub_resource.resource.pool == WINED3D_POOL_DEFAULT)
         ERR("Unloading DEFAULT pool volume.\n");
 
     TRACE("texture %p.\n", resource);
@@ -512,7 +515,7 @@ ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume)
         return wined3d_texture_incref(volume->container);
     }
 
-    refcount = InterlockedIncrement(&volume->resource.ref);
+    refcount = InterlockedIncrement(&volume->sub_resource.resource.ref);
 
     TRACE("%p increasing refcount to %u.\n", volume, refcount);
 
@@ -529,7 +532,7 @@ ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
         return wined3d_texture_decref(volume->container);
     }
 
-    refcount = InterlockedDecrement(&volume->resource.ref);
+    refcount = InterlockedDecrement(&volume->sub_resource.resource.ref);
 
     TRACE("%p decreasing refcount to %u.\n", volume, refcount);
 
@@ -538,8 +541,8 @@ ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume)
         if (volume->pbo)
             wined3d_volume_free_pbo(volume);
 
-        resource_cleanup(&volume->resource);
-        volume->resource.parent_ops->wined3d_object_destroyed(volume->resource.parent);
+        resource_cleanup(&volume->sub_resource.resource);
+        volume->sub_resource.resource.parent_ops->wined3d_object_destroyed(volume->sub_resource.resource.parent);
         HeapFree(GetProcessHeap(), 0, volume);
     }
 
@@ -550,17 +553,17 @@ void * CDECL wined3d_volume_get_parent(const struct wined3d_volume *volume)
 {
     TRACE("volume %p.\n", volume);
 
-    return volume->resource.parent;
+    return volume->sub_resource.resource.parent;
 }
 
 DWORD CDECL wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD priority)
 {
-    return resource_set_priority(&volume->resource, priority);
+    return resource_set_priority(&volume->sub_resource.resource, priority);
 }
 
 DWORD CDECL wined3d_volume_get_priority(const struct wined3d_volume *volume)
 {
-    return resource_get_priority(&volume->resource);
+    return resource_get_priority(&volume->sub_resource.resource);
 }
 
 void CDECL wined3d_volume_preload(struct wined3d_volume *volume)
@@ -572,14 +575,14 @@ struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volum
 {
     TRACE("volume %p.\n", volume);
 
-    return &volume->resource;
+    return &volume->sub_resource.resource;
 }
 
 static BOOL volume_check_block_align(const struct wined3d_volume *volume,
         const struct wined3d_box *box)
 {
     UINT width_mask, height_mask;
-    const struct wined3d_format *format = volume->resource.format;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
 
     if (!box)
         return TRUE;
@@ -595,9 +598,9 @@ static BOOL volume_check_block_align(const struct wined3d_volume *volume,
         return FALSE;
     if (box->top & height_mask)
         return FALSE;
-    if (box->right & width_mask && box->right != volume->resource.width)
+    if (box->right & width_mask && box->right != volume->sub_resource.resource.width)
         return FALSE;
-    if (box->bottom & height_mask && box->bottom != volume->resource.height)
+    if (box->bottom & height_mask && box->bottom != volume->sub_resource.resource.height)
         return FALSE;
 
     return TRUE;
@@ -615,11 +618,11 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
         return FALSE;
     if (box->front >= box->back)
         return FALSE;
-    if (box->right > volume->resource.width)
+    if (box->right > volume->sub_resource.resource.width)
         return FALSE;
-    if (box->bottom > volume->resource.height)
+    if (box->bottom > volume->sub_resource.resource.height)
         return FALSE;
-    if (box->back > volume->resource.depth)
+    if (box->back > volume->sub_resource.resource.depth)
         return FALSE;
 
     return TRUE;
@@ -628,22 +631,22 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
 HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
         struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
 {
-    struct wined3d_device *device = volume->resource.device;
+    struct wined3d_device *device = volume->sub_resource.resource.device;
     struct wined3d_context *context;
     const struct wined3d_gl_info *gl_info;
     BYTE *base_memory;
-    const struct wined3d_format *format = volume->resource.format;
+    const struct wined3d_format *format = volume->sub_resource.resource.format;
 
     TRACE("volume %p, map_desc %p, box %p, flags %#x.\n",
             volume, map_desc, box, flags);
 
     map_desc->data = NULL;
-    if (!(volume->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
+    if (!(volume->sub_resource.resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
     {
         WARN("Volume %p is not CPU accessible.\n", volume);
         return WINED3DERR_INVALIDCALL;
     }
-    if (volume->resource.map_count)
+    if (volume->sub_resource.resource.map_count)
     {
         WARN("Volume is already mapped.\n");
         return WINED3DERR_INVALIDCALL;
@@ -660,7 +663,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
         return WINED3DERR_INVALIDCALL;
     }
 
-    flags = wined3d_resource_sanitize_map_flags(&volume->resource, flags);
+    flags = wined3d_resource_sanitize_map_flags(&volume->sub_resource.resource, flags);
 
     if (volume->flags & WINED3D_VFLAG_PBO)
     {
@@ -680,7 +683,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
             GLbitfield mapflags = wined3d_resource_gl_map_flags(flags);
             mapflags &= ~GL_MAP_FLUSH_EXPLICIT_BIT;
             base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER_ARB,
-                    0, volume->resource.size, mapflags));
+                    0, volume->sub_resource.resource.size, mapflags));
         }
         else
         {
@@ -712,15 +715,15 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
             wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM);
             context_release(context);
         }
-        base_memory = volume->resource.heap_memory;
+        base_memory = volume->sub_resource.resource.heap_memory;
     }
 
     TRACE("Base memory pointer %p.\n", base_memory);
 
     if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH)
     {
-        map_desc->row_pitch = volume->resource.width * format->byte_count;
-        map_desc->slice_pitch = map_desc->row_pitch * volume->resource.height;
+        map_desc->row_pitch = volume->sub_resource.resource.width * format->byte_count;
+        map_desc->slice_pitch = map_desc->row_pitch * volume->sub_resource.resource.height;
     }
     else
     {
@@ -751,7 +754,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
             map_desc->data = base_memory
                     + (map_desc->slice_pitch * box->front)
                     + (map_desc->row_pitch * box->top)
-                    + (box->left * volume->resource.format->byte_count);
+                    + (box->left * volume->sub_resource.resource.format->byte_count);
         }
     }
 
@@ -765,7 +768,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
             wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM);
     }
 
-    volume->resource.map_count++;
+    volume->sub_resource.resource.map_count++;
 
     TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n",
             map_desc->data, map_desc->row_pitch, map_desc->slice_pitch);
@@ -782,7 +785,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
 {
     TRACE("volume %p.\n", volume);
 
-    if (!volume->resource.map_count)
+    if (!volume->sub_resource.resource.map_count)
     {
         WARN("Trying to unlock an unlocked volume %p.\n", volume);
         return WINED3DERR_INVALIDCALL;
@@ -790,7 +793,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
 
     if (volume->flags & WINED3D_VFLAG_PBO)
     {
-        struct wined3d_device *device = volume->resource.device;
+        struct wined3d_device *device = volume->sub_resource.resource.device;
         struct wined3d_context *context = context_acquire(device, NULL);
         const struct wined3d_gl_info *gl_info = context->gl_info;
 
@@ -802,7 +805,7 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
         context_release(context);
     }
 
-    volume->resource.map_count--;
+    volume->sub_resource.resource.map_count--;
 
     return WINED3D_OK;
 }
@@ -837,7 +840,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture
 
     size = wined3d_format_calculate_size(format, device->surface_alignment, desc->width, desc->height, desc->depth);
 
-    if (FAILED(hr = resource_init(&volume->resource, device, WINED3D_RTYPE_VOLUME, format,
+    if (FAILED(hr = resource_init(&volume->sub_resource.resource, device, WINED3D_RTYPE_VOLUME, format,
             WINED3D_MULTISAMPLE_NONE, 0, desc->usage, desc->pool, desc->width, desc->height, desc->depth,
             size, NULL, &wined3d_null_parent_ops, &volume_resource_ops)))
     {
@@ -852,7 +855,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture
             && gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
             && !format->convert)
     {
-        wined3d_resource_free_sysmem(&volume->resource);
+        wined3d_resource_free_sysmem(&volume->sub_resource.resource);
         volume->flags |= WINED3D_VFLAG_PBO;
     }
 
@@ -896,8 +899,8 @@ HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wi
 
     TRACE("Created volume %p, parent %p, parent_ops %p.\n", object, parent, parent_ops);
 
-    object->resource.parent = parent;
-    object->resource.parent_ops = parent_ops;
+    object->sub_resource.resource.parent = parent;
+    object->sub_resource.resource.parent_ops = parent_ops;
     *volume = object;
 
     return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index bf30ad4..d3c0f5b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2137,7 +2137,7 @@ const char *wined3d_debug_location(DWORD location) DECLSPEC_HIDDEN;
 
 struct wined3d_volume
 {
-    struct wined3d_resource resource;
+    struct wined3d_sub_resource sub_resource;
     struct wined3d_texture *container;
 
     DWORD flags, locations;
@@ -2148,7 +2148,7 @@ struct wined3d_volume
 
 static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
 {
-    return CONTAINING_RECORD(resource, struct wined3d_volume, resource);
+    return CONTAINING_RECORD(resource, struct wined3d_volume, sub_resource.resource);
 }
 
 HRESULT wined3d_volume_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc,
-- 
1.8.3.2




More information about the wine-patches mailing list