Henri Verbeet : wined3d: Prefer bind flags over usage flags in wined3d_texture_init().
Alexandre Julliard
julliard at winehq.org
Thu Nov 1 16:33:51 CDT 2018
Module: wine
Branch: master
Commit: 14434751dd852cd4664df4ac2ee23afbedd98664
URL: https://source.winehq.org/git/wine.git/?a=commit;h=14434751dd852cd4664df4ac2ee23afbedd98664
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Nov 1 11:25:25 2018 +0330
wined3d: Prefer bind flags over usage flags in wined3d_texture_init().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/texture.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 45de4a1..df92b53 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2906,10 +2906,10 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
return WINED3DERR_INVALIDCALL;
}
- if (!(desc->usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL))
- && (flags & WINED3D_TEXTURE_CREATE_MAPPABLE))
+ if ((flags & WINED3D_TEXTURE_CREATE_MAPPABLE) && !((desc->usage & WINED3DUSAGE_DYNAMIC)
+ || (desc->bind_flags & (WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL))))
WARN("Creating a mappable texture that doesn't specify dynamic usage.\n");
- if (desc->usage & WINED3DUSAGE_RENDERTARGET && desc->access & WINED3D_RESOURCE_ACCESS_CPU)
+ if (desc->bind_flags & WINED3D_BIND_RENDER_TARGET && desc->access & WINED3D_RESOURCE_ACCESS_CPU)
FIXME("Trying to create a CPU accessible render target.\n");
pow2_width = desc->width;
@@ -2955,7 +2955,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->pow2_height = pow2_height;
if ((pow2_width > d3d_info->limits.texture_size || pow2_height > d3d_info->limits.texture_size)
- && (desc->usage & WINED3DUSAGE_TEXTURE))
+ && (desc->bind_flags & WINED3D_BIND_SHADER_RESOURCE))
{
/* One of four options:
* 1: Do the same as we do with NPOT and scale the texture. (Any
More information about the wine-cvs
mailing list