d3d9: Limit "NumSimultaneousRTs" to 4.
This commit is contained in:
parent
5b8b97a737
commit
359acf2461
|
@ -529,6 +529,7 @@ typedef struct IDirect3DVertexShader9Impl {
|
||||||
} IDirect3DVertexShader9Impl;
|
} IDirect3DVertexShader9Impl;
|
||||||
|
|
||||||
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
|
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
|
||||||
|
#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
|
||||||
|
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
/* IDirect3DPixelShader9 */
|
/* IDirect3DPixelShader9 */
|
||||||
|
|
|
@ -992,6 +992,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetRenderTarget(LPDIRECT3DDEVICE9EX
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
TRACE("(%p) Relay\n" , This);
|
TRACE("(%p) Relay\n" , This);
|
||||||
|
|
||||||
|
if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS)
|
||||||
|
{
|
||||||
|
WARN("Invalid index %u specified.\n", RenderTargetIndex);
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL);
|
hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, RenderTargetIndex, pSurface ? pSurface->wineD3DSurface : NULL);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
@ -1010,6 +1016,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(LPDIRECT3DDEVICE9EX
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RenderTargetIndex >= D3D9_MAX_SIMULTANEOUS_RENDERTARGETS)
|
||||||
|
{
|
||||||
|
WARN("Invalid index %u specified.\n", RenderTargetIndex);
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
|
|
||||||
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
|
hr=IWineD3DDevice_GetRenderTarget(This->WineD3DDevice,RenderTargetIndex,&pRenderTarget);
|
||||||
|
|
|
@ -337,6 +337,7 @@ void filter_caps(D3DCAPS9* pCaps)
|
||||||
D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
|
D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2| D3DPTEXTURECAPS_NOPROJECTEDBUMPENV;
|
||||||
|
|
||||||
pCaps->MaxVertexShaderConst = min(D3D9_MAX_VERTEX_SHADER_CONSTANTF, pCaps->MaxVertexShaderConst);
|
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) {
|
static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9EX iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
|
||||||
|
|
Loading…
Reference in New Issue