[PATCH 5/6] wined3d: Check texture usage/pool in volumetexture_init().

Henri Verbeet hverbeet at codeweavers.com
Thu Apr 14 12:32:49 CDT 2016


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/texture.c | 7 +++++++
 dlls/wined3d/volume.c  | 9 ---------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 52b026b..0f29367 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1850,6 +1850,13 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
         }
     }
 
+    if (desc->usage & WINED3DUSAGE_DYNAMIC && (desc->pool == WINED3D_POOL_MANAGED
+            || desc->pool == WINED3D_POOL_SCRATCH))
+    {
+        WARN("Attempted to create a DYNAMIC texture in pool %s.\n", debug_d3dpool(desc->pool));
+        return WINED3DERR_INVALIDCALL;
+    }
+
     if (!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO])
     {
         UINT pow2_w, pow2_h, pow2_d;
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index cb60a24..643969c 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -441,15 +441,6 @@ HRESULT wined3d_volume_init(struct wined3d_volume *volume, struct wined3d_textur
     HRESULT hr;
     UINT size;
 
-    /* TODO: Write tests for other resources and move this check
-     * to resource_init, if applicable. */
-    if (desc->usage & WINED3DUSAGE_DYNAMIC
-            && (desc->pool == WINED3D_POOL_MANAGED || desc->pool == WINED3D_POOL_SCRATCH))
-    {
-        WARN("Attempted to create a DYNAMIC texture in pool %s.\n", debug_d3dpool(desc->pool));
-        return WINED3DERR_INVALIDCALL;
-    }
-
     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,
-- 
2.1.4




More information about the wine-patches mailing list