Skip to content

Commit

Permalink
[d3d9] Reject Reset if there's any remaining DEFAULT resources
Browse files Browse the repository at this point in the history
  • Loading branch information
K0bin authored and misyltoad committed Jun 13, 2023
1 parent a1a91dd commit 52ac271
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 57 deletions.
5 changes: 5 additions & 0 deletions src/d3d9/d3d9_common_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ namespace dxvk {
m_dirtyRange = D3D9Range(0, m_desc.Size);
}

D3D9CommonBuffer::~D3D9CommonBuffer() {
if (m_desc.Pool == D3DPOOL_DEFAULT)
m_parent->DecrementLosableCounter();
}


HRESULT D3D9CommonBuffer::Lock(
UINT OffsetToLock,
Expand Down
2 changes: 2 additions & 0 deletions src/d3d9/d3d9_common_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ namespace dxvk {
D3D9DeviceEx* pDevice,
const D3D9_BUFFER_DESC* pDesc);

~D3D9CommonBuffer();

HRESULT Lock(
UINT OffsetToLock,
UINT SizeToLock,
Expand Down
3 changes: 3 additions & 0 deletions src/d3d9/d3d9_common_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ namespace dxvk {
m_device->ChangeReportedMemory(m_size);

m_device->RemoveMappedTexture(this);

if (m_desc.IsLosable)
m_device->DecrementLosableCounter();
}


Expand Down
1 change: 1 addition & 0 deletions src/d3d9/d3d9_common_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace dxvk {
bool IsBackBuffer;
bool IsAttachmentOnly;
bool IsLockable;
bool IsLosable;
};

struct D3D9ColorView {
Expand Down
Loading

0 comments on commit 52ac271

Please sign in to comment.