[PATCH 3/7] d3dx9: Implement D3DXCheckTextureRequirements.

Henri Verbeet hverbeet at gmail.com
Fri Sep 19 12:04:04 CDT 2008


2008/9/19 Philip Nilsson <pnilsson at nullref.se>:

> +        hr = IDirect3DDevice9_GetDirect3D(device, &d3d9);
> +        if (hr != D3D_OK || !device)
> +            return D3DERR_INVALIDCALL;
> +
> +        IDirect3D9_GetAdapterDisplayMode(d3d9, D3DADAPTER_DEFAULT, &d3ddm);
> +
> +        /* TODO: Use something more advanced that looks more like what's in MSDN. */
> +        hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3ddm.Format, usage, D3DRTYPE_TEXTURE, *format);
You shouldn't guess the adapter, device type, etc., but use whatever
the device was created with. IDirect3DDevice9_GetCreationParameters()
should help there.

> +        if (hr != D3D_OK) {
> +            if (usage & D3DUSAGE_DEPTHSTENCIL) {
> +                switch (*format) {
...
> +        }
> +        IDirect3D9_Release(d3d9);
> +    }
I'm not sure about the big switch statement there, but I do know that
just changing the format isn't enough. There's no guarantee the new
format will work, or if there is any format that will support that
specific set of usage flags at all.



More information about the wine-devel mailing list