Commit fcc5a6c8 authored by Joshua Ashton's avatar Joshua Ashton 🐸

[d3d9] Fix and clarify Get/SetMapFlag interactions

parent 6d7e87c1
Pipeline #916 passed with stage
in 21 minutes and 30 seconds
......@@ -128,9 +128,9 @@ namespace dxvk {
return m_sliceHandle;
}
DWORD GetMapFlags(DWORD Flags) { return m_mapFlags; }
DWORD GetMapFlags() const { return m_mapFlags; }
DWORD SetMapFlags(DWORD Flags) { return std::exchange(m_mapFlags, Flags); }
void SetMapFlags(DWORD Flags) { m_mapFlags = Flags; }
const D3D9_BUFFER_DESC* Desc() const {
return &m_desc;
......
......@@ -4435,7 +4435,7 @@ namespace dxvk {
*ppbData = reinterpret_cast<void*>(data);
DWORD oldFlags = pResource->GetMapFlags(Flags);
DWORD oldFlags = pResource->GetMapFlags();
// We need to remove the READONLY flags from the map flags
// if there was ever a non-readonly upload.
......@@ -4484,9 +4484,11 @@ namespace dxvk {
if (pResource->GetMapMode() != D3D9_COMMON_BUFFER_MAP_MODE_BUFFER)
return D3D_OK;
if (pResource->GetMapFlags(0) & D3DLOCK_READONLY)
if (pResource->GetMapFlags() & D3DLOCK_READONLY)
return D3D_OK;
pResource->SetMapFlags(0);
if (pResource->Desc()->Pool != D3DPOOL_DEFAULT) {
pResource->MarkNeedsUpload();
return D3D_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment