Commit 296573ca authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d: Filter R8G8B8 in d3d8 and d3d9.

parent 14eedc5b
......@@ -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:
......
......@@ -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:
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment