d3d9: Limit "NumSimultaneousRTs" to 4.

This commit is contained in:
Henri Verbeet 2009-09-20 21:58:45 +02:00 committed by Alexandre Julliard
parent 5b8b97a737
commit 359acf2461
3 changed files with 14 additions and 0 deletions

View File

@ -529,6 +529,7 @@ typedef struct IDirect3DVertexShader9Impl {
} IDirect3DVertexShader9Impl;
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
/* --------------------- */
/* IDirect3DPixelShader9 */

View File

@ -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);

View File

@ -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) {