Skip to content

Commit

Permalink
[d3d9+d3d11] Remove DEVICE_LOCAL flag when forcing cached memory
Browse files Browse the repository at this point in the history
Otherwise DXVK removes both flags at once
and we may end up with uncached memory.
  • Loading branch information
K0bin authored and doitsujin committed May 22, 2023
1 parent 1a2e724 commit d2759c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/d3d11/d3d11_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ namespace dxvk {
|| (m_parent->GetOptions()->cachedDynamicResources & m_desc.BindFlags);

if ((memoryFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && useCached) {
memoryFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
memoryFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
}
Expand Down
1 change: 1 addition & 0 deletions src/d3d9/d3d9_common_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace dxvk {
}

if (memoryFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT && m_parent->GetOptions()->apitraceMode) {
memoryFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
memoryFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
}
Expand Down

0 comments on commit d2759c2

Please sign in to comment.