wined3d: Filter WINED3DSTENCILCAPS_TWOSIDED in d3d8.

This commit is contained in:
Stefan Dösinger 2009-08-07 12:17:41 +02:00 committed by Alexandre Julliard
parent 296573caae
commit 6f5a1d9a15
4 changed files with 19 additions and 21 deletions

View File

@ -97,6 +97,8 @@
_pD3D8Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
_pD3D8Caps->MaxPixelShaderValue = _pWineCaps->PixelShader1xMaxValue;
void fixup_caps(WINED3DCAPS *pWineCaps);
/* Direct3D8 Interfaces: */
typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;

View File

@ -394,18 +394,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface
EnterCriticalSection(&d3d8_cs);
hrc = IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pWineCaps);
LeaveCriticalSection(&d3d8_cs);
fixup_caps(pWineCaps);
WINECAPSTOD3D8CAPS(pCaps, pWineCaps)
HeapFree(GetProcessHeap(), 0, pWineCaps);
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){
pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
}
if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){
pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
}
pCaps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst);
TRACE("Returning %p %p\n", This, pCaps);
return hrc;
}

View File

@ -250,6 +250,20 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface,
return hr;
}
void fixup_caps(WINED3DCAPS *caps)
{
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if (caps->PixelShaderVersion > D3DPS_VERSION(1,4)) {
caps->PixelShaderVersion = D3DPS_VERSION(1,4);
}
if (caps->VertexShaderVersion > D3DVS_VERSION(1,1)) {
caps->VertexShaderVersion = D3DVS_VERSION(1,1);
}
caps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, caps->MaxVertexShaderConst);
caps->StencilCaps &= ~WINED3DSTENCILCAPS_TWOSIDED;
}
static HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps) {
IDirect3D8Impl *This = (IDirect3D8Impl *)iface;
HRESULT hrc = D3D_OK;
@ -267,18 +281,10 @@ static HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Ada
EnterCriticalSection(&d3d8_cs);
hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps);
LeaveCriticalSection(&d3d8_cs);
fixup_caps(pWineCaps);
WINECAPSTOD3D8CAPS(pCaps, pWineCaps)
HeapFree(GetProcessHeap(), 0, pWineCaps);
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){
pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
}
if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){
pCaps->VertexShaderVersion = D3DVS_VERSION(1,1);
}
pCaps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst);
TRACE("(%p) returning %p\n", This, pCaps);
return hrc;
}

View File

@ -4050,9 +4050,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
pCaps->StencilCaps |= WINED3DSTENCILCAPS_DECR |
WINED3DSTENCILCAPS_INCR;
}
if ( This->dxVersion > 8 &&
( GL_SUPPORT(EXT_STENCIL_TWO_SIDE) ||
GL_SUPPORT(ATI_SEPARATE_STENCIL) ) ) {
if (GL_SUPPORT(EXT_STENCIL_TWO_SIDE) || GL_SUPPORT(ATI_SEPARATE_STENCIL)) {
pCaps->StencilCaps |= WINED3DSTENCILCAPS_TWOSIDED;
}