Henri Verbeet : wined3d: Check texture usage/pool in volumetexture_init().
Module: wine Branch: master Commit: 5eedb704f18d555b0252f31053ac6859a1ff16a5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5eedb704f18d555b0252f31053... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 14 19:32:49 2016 +0200 wined3d: Check texture usage/pool in volumetexture_init(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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,
participants (1)
-
Alexandre Julliard