mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Don't mark lock on DONOTWAIT path
Fixes some issues in some games using this feature.
This commit is contained in:
parent
12356d7342
commit
5558460853
@ -302,15 +302,19 @@ namespace dxvk {
|
|||||||
|
|
||||||
const D3D9_VK_FORMAT_MAPPING& GetMapping() { return m_mapping; }
|
const D3D9_VK_FORMAT_MAPPING& GetMapping() { return m_mapping; }
|
||||||
|
|
||||||
bool MarkLocked(UINT Subresource, bool value) { return m_locked.exchange(Subresource, value); }
|
void SetLocked(UINT Subresource, bool value) { m_locked.set(Subresource, value); }
|
||||||
|
|
||||||
bool SetDirty(UINT Subresource, bool value) { return m_dirty.exchange(Subresource, value); }
|
bool GetLocked(UINT Subresource) const { return m_locked.get(Subresource); }
|
||||||
|
|
||||||
|
void SetDirty(UINT Subresource, bool value) { m_dirty.set(Subresource, value); }
|
||||||
|
|
||||||
|
bool GetDirty(UINT Subresource) const { return m_dirty.get(Subresource); }
|
||||||
|
|
||||||
void MarkAllDirty() { m_dirty.setAll(); }
|
void MarkAllDirty() { m_dirty.setAll(); }
|
||||||
|
|
||||||
void SetReadOnlyLocked(UINT Subresource, bool readOnly) { return m_readOnly.set(Subresource, readOnly); }
|
void SetReadOnlyLocked(UINT Subresource, bool readOnly) { return m_readOnly.set(Subresource, readOnly); }
|
||||||
|
|
||||||
bool GetReadOnlyLocked(UINT Subresource) { return m_readOnly.get(Subresource); }
|
bool GetReadOnlyLocked(UINT Subresource) const { return m_readOnly.get(Subresource); }
|
||||||
|
|
||||||
const Rc<DxvkImageView>& GetSampleView(bool srgb) const {
|
const Rc<DxvkImageView>& GetSampleView(bool srgb) const {
|
||||||
return m_sampleView.Pick(srgb && IsSrgbCompatible());
|
return m_sampleView.Pick(srgb && IsSrgbCompatible());
|
||||||
|
@ -3893,7 +3893,7 @@ namespace dxvk {
|
|||||||
UINT Subresource = pResource->CalcSubresource(Face, MipLevel);
|
UINT Subresource = pResource->CalcSubresource(Face, MipLevel);
|
||||||
|
|
||||||
// Don't allow multiple lockings.
|
// Don't allow multiple lockings.
|
||||||
if (unlikely(pResource->MarkLocked(Subresource, true)))
|
if (unlikely(pResource->GetLocked(Subresource)))
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
if (unlikely((Flags & (D3DLOCK_DISCARD | D3DLOCK_READONLY)) == (D3DLOCK_DISCARD | D3DLOCK_READONLY)))
|
if (unlikely((Flags & (D3DLOCK_DISCARD | D3DLOCK_READONLY)) == (D3DLOCK_DISCARD | D3DLOCK_READONLY)))
|
||||||
@ -3959,7 +3959,8 @@ namespace dxvk {
|
|||||||
// If we are dirty, then we need to copy -> buffer
|
// If we are dirty, then we need to copy -> buffer
|
||||||
// We are also always dirty if we are a render target,
|
// We are also always dirty if we are a render target,
|
||||||
// a depth stencil, or auto generate mipmaps.
|
// a depth stencil, or auto generate mipmaps.
|
||||||
bool dirty = pResource->SetDirty(Subresource, false) || renderable;
|
bool dirty = pResource->GetDirty(Subresource) || renderable;
|
||||||
|
pResource->SetDirty(Subresource, false);
|
||||||
|
|
||||||
DxvkBufferSliceHandle physSlice;
|
DxvkBufferSliceHandle physSlice;
|
||||||
|
|
||||||
@ -4095,6 +4096,8 @@ namespace dxvk {
|
|||||||
pLockedBox->SlicePitch = formatInfo->elementSize * blockCount.width * blockCount.height;
|
pLockedBox->SlicePitch = formatInfo->elementSize * blockCount.width * blockCount.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pResource->SetLocked(Subresource, true);
|
||||||
|
|
||||||
const uint32_t offset = CalcImageLockOffset(
|
const uint32_t offset = CalcImageLockOffset(
|
||||||
pLockedBox->SlicePitch,
|
pLockedBox->SlicePitch,
|
||||||
pLockedBox->RowPitch,
|
pLockedBox->RowPitch,
|
||||||
@ -4117,9 +4120,11 @@ namespace dxvk {
|
|||||||
UINT Subresource = pResource->CalcSubresource(Face, MipLevel);
|
UINT Subresource = pResource->CalcSubresource(Face, MipLevel);
|
||||||
|
|
||||||
// We weren't locked anyway!
|
// We weren't locked anyway!
|
||||||
if (unlikely(!pResource->MarkLocked(Subresource, false)))
|
if (unlikely(!pResource->GetLocked(Subresource)))
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
pResource->SetLocked(Subresource, false);
|
||||||
|
|
||||||
// Do we have a pending copy?
|
// Do we have a pending copy?
|
||||||
if (!pResource->GetReadOnlyLocked(Subresource)) {
|
if (!pResource->GetReadOnlyLocked(Subresource)) {
|
||||||
// Only flush buffer -> image if we actually have an image
|
// Only flush buffer -> image if we actually have an image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user