mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[d3d9] Validate RT parent device during SetRenderTarget
This commit is contained in:
parent
77020760f1
commit
97ad37e409
1 changed files with 6 additions and 1 deletions
|
@ -1592,7 +1592,12 @@ namespace dxvk {
|
|||
IDirect3DSurface9* pRenderTarget) {
|
||||
D3D9DeviceLock lock = LockDevice();
|
||||
|
||||
if (unlikely((pRenderTarget == nullptr && RenderTargetIndex == 0)))
|
||||
if (unlikely(pRenderTarget == nullptr && RenderTargetIndex == 0))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
// We need to make sure the render target was created using this device.
|
||||
D3D9Surface* rt = static_cast<D3D9Surface*>(pRenderTarget);
|
||||
if (unlikely(rt != nullptr && rt->GetDevice() != this))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
return SetRenderTargetInternal(RenderTargetIndex, pRenderTarget);
|
||||
|
|
Loading…
Add table
Reference in a new issue