Module: wine Branch: master Commit: 359acf2461b62373827f6c4e617646718175352e URL: http://source.winehq.org/git/wine.git/?a=commit;h=359acf2461b62373827f6c4e61...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Sun Sep 20 21:58:45 2009 +0200
d3d9: Limit "NumSimultaneousRTs" to 4.
---
dlls/d3d9/d3d9_private.h | 1 + dlls/d3d9/device.c | 12 ++++++++++++ dlls/d3d9/directx.c | 1 + 3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index bea76d9..c9b3581 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -529,6 +529,7 @@ typedef struct IDirect3DVertexShader9Impl { } IDirect3DVertexShader9Impl;
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256 +#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
/* --------------------- */ /* IDirect3DPixelShader9 */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 86890ff..f3b2e5e 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -992,6 +992,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX HRESULT hr; TRACE("(%p) Relay\n" , This);
+ if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS) + { + WARN("Invalid index %u specified.\n", RenderTargetIndex); + return D3DERR_INVALIDCALL; + } + wined3d_mutex_lock(); hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL); wined3d_mutex_unlock(); @@ -1010,6 +1016,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX return D3DERR_INVALIDCALL; }
+ if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS) + { + WARN("Invalid index %u specified.\n", RenderTargetIndex); + return D3DERR_INVALIDCALL; + } + wined3d_mutex_lock();
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget); diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index aba3362..301f901 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -337,6 +337,7 @@ void filter_caps(D3DCAPS9* pCaps) D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
pCaps->MaxVertexShaderConst = min(D3D9_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst); + pCaps->NumSimultaneousRTs = min(D3D9_MAX_SIMULTANEOUS_RENDERTARGETS, pCaps->NumSimultaneousRTs); }
static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9EX iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {