mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Store map offset in GPUBuffer so we only flush the mapped range
This commit is contained in:
@@ -214,6 +214,8 @@ void *GPUBuffer::Map(uint32_t *bindoffset, VkDeviceSize usedsize)
|
||||
if(bindoffset)
|
||||
*bindoffset = (uint32_t)offset;
|
||||
|
||||
mapoffset = offset;
|
||||
|
||||
void *ptr = NULL;
|
||||
VkResult vkr = m_pDriver->vkMapMemory(device, mem, offset, size, 0, (void **)&ptr);
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
@@ -247,7 +249,7 @@ void GPUBuffer::Unmap()
|
||||
if(!(createFlags & eGPUBufferReadback) && !(createFlags & eGPUBufferGPULocal))
|
||||
{
|
||||
VkMappedMemoryRange range = {
|
||||
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, NULL, mem, 0, VK_WHOLE_SIZE,
|
||||
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, NULL, mem, mapoffset, VK_WHOLE_SIZE,
|
||||
};
|
||||
|
||||
VkResult vkr = m_pDriver->vkFlushMappedMemoryRanges(device, 1, &range);
|
||||
|
||||
@@ -167,6 +167,7 @@ struct GPUBuffer
|
||||
// for handling ring allocations
|
||||
VkDeviceSize totalsize = 0;
|
||||
VkDeviceSize curoffset = 0;
|
||||
VkDeviceSize mapoffset = 0;
|
||||
|
||||
uint32_t ringCount = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user