[PATCH] d3dx: don't pass usage flags when creating temporary texture buffer.

Matteo Bruni matteo.mystral at gmail.com
Thu Feb 25 08:12:15 CST 2016


2016-02-25 11:37 GMT+01:00 Paul Gofman <gofmanp at gmail.com>:
> Some usage flags require D3DPOOL_DEFAULT (and not D3DPOOL_SYSTEMMEM),
> and the usage of texture being created is overall not related to
> intermediate buffer texture usage. If texture being created has
> D3DUSAGE_AUTOGENMIPMAP, updating it from non autogenerated mipmap
> should be fine according to MSDN (IDirect3DDevice9::UpdateTexture).
> Passing the usage is harmless though, the patch just silences some
> misleading d3d FIXME's.
>
> Signed-off-by: Paul Gofman <gofmanp at gmail.com>
> ---
>  dlls/d3dx9_36/texture.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
> index 38349e2..27f08ad 100644
> --- a/dlls/d3dx9_36/texture.c
> +++ b/dlls/d3dx9_36/texture.c
> @@ -678,7 +678,7 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi
>      dynamic_texture = (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) && (usage & D3DUSAGE_DYNAMIC);
>      if (pool == D3DPOOL_DEFAULT && !dynamic_texture)
>      {
> -        hr = D3DXCreateTexture(device, width, height, miplevels, usage, format, D3DPOOL_SYSTEMMEM, &buftex);
> +        hr = D3DXCreateTexture(device, width, height, miplevels, 0, format, D3DPOOL_SYSTEMMEM, &buftex);
>          texptr = &buftex;
>      }
>      else
> --
> 2.5.0

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>

Possibly with the name adjusted into "d3dx9: Don't pass usage flags
when creating temporary texture."



More information about the wine-patches mailing list