d3d: Filter R8G8B8 in d3d8 and d3d9.

This commit is contained in:
Stefan Dösinger 2009-08-05 20:55:51 +02:00 committed by Alexandre Julliard
parent 14eedc5be7
commit 296573caae
3 changed files with 20 additions and 12 deletions

View File

@ -195,6 +195,14 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 i
WINED3DRESOURCETYPE WineD3DRType;
TRACE("(%p)->(%d, %d, %d, %08x, %d, %d)\n", This, Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
if(CheckFormat == D3DFMT_R8G8B8)
{
/* See comment in dlls/d3d9/directx.c, IDirect3D9Impl_CheckDeviceFormat for details */
WARN("D3DFMT_R8G8B8 is not available on windows, returning D3DERR_NOTAVAILABLE\n");
return D3DERR_NOTAVAILABLE;
}
switch(RType) {
case D3DRTYPE_VERTEXBUFFER:
case D3DRTYPE_INDEXBUFFER:

View File

@ -199,6 +199,18 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9EX iface,
WINED3DRESOURCETYPE WineD3DRType;
TRACE("%p\n", This);
/* This format is nothing special and it is supported perfectly.
* However, ati and nvidia driver on windows do not mark this format as
* supported (tested with the dxCapsViewer) and pretending to
* support this format uncovers a bug in Battlefield 1942 (fonts are missing)
* So do the same as Windows drivers and pretend not to support it on dx8 and 9
*/
if(CheckFormat == D3DFMT_R8G8B8)
{
WARN("D3DFMT_R8G8B8 is not available on windows, returning D3DERR_NOTAVAILABLE\n");
return D3DERR_NOTAVAILABLE;
}
switch(RType) {
case D3DRTYPE_VERTEXBUFFER:
case D3DRTYPE_INDEXBUFFER:

View File

@ -3644,18 +3644,6 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
return WINED3DERR_NOTAVAILABLE;
}
/* This format is nothing special and it is supported perfectly.
* However, ati and nvidia driver on windows do not mark this format as
* supported (tested with the dxCapsViewer) and pretending to
* support this format uncovers a bug in Battlefield 1942 (fonts are missing)
* So do the same as Windows drivers and pretend not to support it on dx8 and 9
* Enable it on dx7. It will need additional checking on dx10 when we support it.
*/
if(This->dxVersion > 7 && CheckFormat == WINED3DFMT_R8G8B8) {
TRACE_(d3d_caps)("[FAILED]\n");
return WINED3DERR_NOTAVAILABLE;
}
/* When the UsageCaps exactly matches Usage return WINED3D_OK except for the situation in which
* WINED3DUSAGE_AUTOGENMIPMAP isn't around, then WINED3DOK_NOAUTOGEN is returned if all the other
* usage flags match. */