1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[d3d9] Move pLockedBox/Rect checks to subresource

This commit is contained in:
Joshua Ashton 2020-05-26 13:14:58 +01:00
parent 4c1deabcd3
commit b958473cc9
3 changed files with 6 additions and 9 deletions

View File

@ -100,6 +100,9 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE D3D9Surface::LockRect(D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
if (unlikely(pLockedRect == nullptr))
return D3DERR_INVALIDCALL;
D3DBOX box;
if (pRect != nullptr) {
box.Left = pRect->left;

View File

@ -63,9 +63,6 @@ namespace dxvk {
if (unlikely(Level >= m_texture.ExposedMipLevels()))
return D3DERR_INVALIDCALL;
if (unlikely(pLockedRect == nullptr))
return D3DERR_INVALIDCALL;
return GetSubresource(Level)->LockRect(pLockedRect, pRect, Flags);
}
@ -143,9 +140,6 @@ namespace dxvk {
if (unlikely(Level >= m_texture.ExposedMipLevels()))
return D3DERR_INVALIDCALL;
if (unlikely(pLockedBox == nullptr))
return D3DERR_INVALIDCALL;
return GetSubresource(Level)->LockBox(pLockedBox, pBox, Flags);
}
@ -223,9 +217,6 @@ namespace dxvk {
if (unlikely(Face > D3DCUBEMAP_FACE_NEGATIVE_Z || Level >= m_texture.ExposedMipLevels()))
return D3DERR_INVALIDCALL;
if (unlikely(pLockedRect == nullptr))
return D3DERR_INVALIDCALL;
return GetSubresource(m_texture.CalcSubresource(UINT(Face), Level))->LockRect(pLockedRect, pRect, Flags);
}

View File

@ -91,6 +91,9 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D9Volume::LockBox(D3DLOCKED_BOX* pLockedBox, CONST D3DBOX* pBox, DWORD Flags) {
if (unlikely(pLockedBox == nullptr))
return D3DERR_INVALIDCALL;
return m_parent->LockImage(
m_texture,
m_face, m_mipLevel,