mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
Vulkan/StagingBuffer: Don't try to invalidate unmapped buffer
Fixes crash on Mali.
This commit is contained in:
parent
fb6538da35
commit
282f166e7a
|
@ -84,7 +84,7 @@ void StagingBuffer::Unmap()
|
||||||
void StagingBuffer::FlushCPUCache(VkDeviceSize offset, VkDeviceSize size)
|
void StagingBuffer::FlushCPUCache(VkDeviceSize offset, VkDeviceSize size)
|
||||||
{
|
{
|
||||||
Assert(offset >= m_map_offset);
|
Assert(offset >= m_map_offset);
|
||||||
if (m_coherent)
|
if (m_coherent || !IsMapped())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VkMappedMemoryRange range = {VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, nullptr, m_memory, offset - m_map_offset, size};
|
VkMappedMemoryRange range = {VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, nullptr, m_memory, offset - m_map_offset, size};
|
||||||
|
@ -129,7 +129,7 @@ void StagingBuffer::FlushGPUCache(VkCommandBuffer command_buffer, VkAccessFlagBi
|
||||||
void StagingBuffer::InvalidateCPUCache(VkDeviceSize offset, VkDeviceSize size)
|
void StagingBuffer::InvalidateCPUCache(VkDeviceSize offset, VkDeviceSize size)
|
||||||
{
|
{
|
||||||
Assert(offset >= m_map_offset);
|
Assert(offset >= m_map_offset);
|
||||||
if (m_coherent)
|
if (m_coherent || !IsMapped())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VkMappedMemoryRange range = {VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, nullptr, m_memory, offset - m_map_offset, size};
|
VkMappedMemoryRange range = {VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, nullptr, m_memory, offset - m_map_offset, size};
|
||||||
|
|
Loading…
Reference in a new issue