mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[dxvk] Fix potential undesired host-visible buffer invalidation
We cannot invalidate mapped buffers in the backend because the frontend may cache the mapped slice from its own invalidations, which would then become invalid. Very unlikely to be an issue in practice.
This commit is contained in:
parent
cd8a2bcfcd
commit
45a6d5fb5b
@ -1417,6 +1417,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
void DxvkContext::discardBuffer(
|
void DxvkContext::discardBuffer(
|
||||||
const Rc<DxvkBuffer>& buffer) {
|
const Rc<DxvkBuffer>& buffer) {
|
||||||
|
if (buffer->memFlags() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_execBarriers.isBufferDirty(buffer->getSliceHandle(), DxvkAccess::Write))
|
if (m_execBarriers.isBufferDirty(buffer->getSliceHandle(), DxvkAccess::Write))
|
||||||
this->invalidateBuffer(buffer, buffer->allocSlice());
|
this->invalidateBuffer(buffer, buffer->allocSlice());
|
||||||
}
|
}
|
||||||
@ -2133,8 +2136,11 @@ namespace dxvk {
|
|||||||
VkDeviceSize offset,
|
VkDeviceSize offset,
|
||||||
VkDeviceSize size,
|
VkDeviceSize size,
|
||||||
const void* data) {
|
const void* data) {
|
||||||
|
bool isHostVisible = buffer->memFlags() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||||
|
|
||||||
bool replaceBuffer = (size == buffer->info().size)
|
bool replaceBuffer = (size == buffer->info().size)
|
||||||
&& (size <= (1 << 20)); /* 1 MB */
|
&& (size <= (1 << 20))
|
||||||
|
&& !isHostVisible;
|
||||||
|
|
||||||
DxvkBufferSliceHandle bufferSlice;
|
DxvkBufferSliceHandle bufferSlice;
|
||||||
DxvkCmdBuffer cmdBuffer;
|
DxvkCmdBuffer cmdBuffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user