diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 90497777aa..160cb67399 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -155,6 +155,8 @@ typedef struct IDirect3D9Impl } IDirect3D9Impl; +void filter_caps(D3DCAPS9* pCaps); + /* ---------------- */ /* IDirect3DDevice9 */ /* ---------------- */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index baa11c3ce7..aa65c7e50d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -155,11 +155,18 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetDeviceCaps(LPDIRECT3DDEVICE9 ifa return D3DERR_INVALIDCALL; /* well this is what MSDN says to return */ } + memset(pCaps, 0, sizeof(*pCaps)); D3D9CAPSTOWINECAPS(pCaps, pWineCaps) EnterCriticalSection(&d3d9_cs); hrc = IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pWineCaps); LeaveCriticalSection(&d3d9_cs); HeapFree(GetProcessHeap(), 0, pWineCaps); + + /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps */ + pCaps->DevCaps2 |= D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES; + + filter_caps(pCaps); + TRACE("Returning %p %p\n", This, pCaps); return hrc; } diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index acc95ce181..28268f8168 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -219,6 +219,63 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 ifa return hr; } +void filter_caps(D3DCAPS9* pCaps) +{ + + DWORD textureFilterCaps = + D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR | D3DPTFILTERCAPS_MINFANISOTROPIC | + D3DPTFILTERCAPS_MINFPYRAMIDALQUAD | D3DPTFILTERCAPS_MINFGAUSSIANQUAD| + D3DPTFILTERCAPS_MIPFPOINT | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | + D3DPTFILTERCAPS_MAGFLINEAR |D3DPTFILTERCAPS_MAGFANISOTROPIC|D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD| + D3DPTFILTERCAPS_MAGFGAUSSIANQUAD; + pCaps->TextureFilterCaps &= textureFilterCaps; + pCaps->CubeTextureFilterCaps &= textureFilterCaps; + pCaps->VolumeTextureFilterCaps &= textureFilterCaps; + + pCaps->DevCaps &= + D3DDEVCAPS_EXECUTESYSTEMMEMORY | D3DDEVCAPS_EXECUTEVIDEOMEMORY | D3DDEVCAPS_TLVERTEXSYSTEMMEMORY | + D3DDEVCAPS_TLVERTEXVIDEOMEMORY | D3DDEVCAPS_TEXTURESYSTEMMEMORY| D3DDEVCAPS_TEXTUREVIDEOMEMORY | + D3DDEVCAPS_DRAWPRIMTLVERTEX | D3DDEVCAPS_CANRENDERAFTERFLIP | D3DDEVCAPS_TEXTURENONLOCALVIDMEM| + D3DDEVCAPS_DRAWPRIMITIVES2 | D3DDEVCAPS_SEPARATETEXTUREMEMORIES | + D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWTRANSFORMANDLIGHT| D3DDEVCAPS_CANBLTSYSTONONLOCAL | + D3DDEVCAPS_HWRASTERIZATION | D3DDEVCAPS_PUREDEVICE | D3DDEVCAPS_QUINTICRTPATCHES | + D3DDEVCAPS_RTPATCHES | D3DDEVCAPS_RTPATCHHANDLEZERO | D3DDEVCAPS_NPATCHES; + + pCaps->ShadeCaps &= + D3DPSHADECAPS_COLORGOURAUDRGB | D3DPSHADECAPS_SPECULARGOURAUDRGB | + D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_FOGGOURAUD; + + pCaps->RasterCaps &= + D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_FOGVERTEX | + D3DPRASTERCAPS_FOGTABLE | D3DPRASTERCAPS_MIPMAPLODBIAS | D3DPRASTERCAPS_ZBUFFERLESSHSR | + D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_ANISOTROPY | D3DPRASTERCAPS_WBUFFER | + D3DPRASTERCAPS_WFOG | D3DPRASTERCAPS_ZFOG | D3DPRASTERCAPS_COLORPERSPECTIVE | + D3DPRASTERCAPS_SCISSORTEST | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS | + D3DPRASTERCAPS_DEPTHBIAS | D3DPRASTERCAPS_MULTISAMPLE_TOGGLE; + + pCaps->DevCaps2 &= + D3DDEVCAPS2_STREAMOFFSET | D3DDEVCAPS2_DMAPNPATCH | D3DDEVCAPS2_ADAPTIVETESSRTPATCH | + D3DDEVCAPS2_ADAPTIVETESSNPATCH | D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES | + D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH| D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET; + + pCaps->Caps2 &= + D3DCAPS2_FULLSCREENGAMMA | D3DCAPS2_CANCALIBRATEGAMMA | D3DCAPS2_RESERVED | + D3DCAPS2_CANMANAGERESOURCE | D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_CANAUTOGENMIPMAP; + + pCaps->VertexProcessingCaps &= + D3DVTXPCAPS_TEXGEN | D3DVTXPCAPS_MATERIALSOURCE7 | D3DVTXPCAPS_DIRECTIONALLIGHTS | + D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_LOCALVIEWER | D3DVTXPCAPS_TWEENING | + D3DVTXPCAPS_TEXGEN_SPHEREMAP | D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER; + + pCaps->TextureCaps &= + D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 | D3DPTEXTURECAPS_ALPHA | + D3DPTEXTURECAPS_SQUAREONLY | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE | + D3DPTEXTURECAPS_ALPHAPALETTE | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | + D3DPTEXTURECAPS_PROJECTED | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_VOLUMEMAP | + D3DPTEXTURECAPS_MIPMAP | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP | + D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV; +} + static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) { IDirect3D9Impl *This = (IDirect3D9Impl *)iface; HRESULT hrc = D3D_OK; @@ -233,6 +290,7 @@ static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapt if(pWineCaps == NULL){ return D3DERR_INVALIDCALL; /*well this is what MSDN says to return*/ } + memset(pCaps, 0, sizeof(*pCaps)); D3D9CAPSTOWINECAPS(pCaps, pWineCaps) EnterCriticalSection(&d3d9_cs); hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps); @@ -241,6 +299,9 @@ static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapt /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps */ pCaps->DevCaps2 |= D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES; + + filter_caps(pCaps); + TRACE("(%p) returning %p\n", This, pCaps); return hrc; } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 43888bfb95..0522114ffb 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1974,8 +1974,12 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, WINED3DPTEXTURECAPS_BORDER | WINED3DPTEXTURECAPS_MIPMAP | WINED3DPTEXTURECAPS_PROJECTED | - WINED3DPTEXTURECAPS_PERSPECTIVE | - WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL; + WINED3DPTEXTURECAPS_PERSPECTIVE; + + if( !GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO)) { + *pCaps->TextureCaps |= WINED3DPTEXTURECAPS_POW2 | + WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL; + } if( GL_SUPPORT(EXT_TEXTURE3D)) { *pCaps->TextureCaps |= WINED3DPTEXTURECAPS_VOLUMEMAP | diff --git a/include/d3d9caps.h b/include/d3d9caps.h index 573d459df8..c66d291b05 100644 --- a/include/d3d9caps.h +++ b/include/d3d9caps.h @@ -171,6 +171,8 @@ #define D3DPTFILTERCAPS_MINFPOINT 0x00000100 #define D3DPTFILTERCAPS_MINFLINEAR 0x00000200 #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400 +#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800 +#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000 #define D3DPTFILTERCAPS_MIPFPOINT 0x00010000 #define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000 #define D3DPTFILTERCAPS_MAGFPOINT 0x01000000