SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Flush()

void Spices::VulkanBuffer::Flush ( VkDeviceSize size = VK_WHOLE_SIZE,
VkDeviceSize offset = 0 ) const

Flush the buffer's video memory data.

Parameters
[in]sizeThe buffer size.
[in]offsetThe buffer video memory offset.

Flush memory to update buffer's data.

Flush memory to update buffer's data.

Definition at line 213 of file VulkanBuffer.cpp.

214 {
216
217#if VMA_ALLOCATOR
218
222 VK_CHECK(vmaFlushAllocation(m_VulkanState.m_VmaAllocator, m_Alloc, offset, size))
223
224#else
225
229 VkMappedMemoryRange mappedRange {};
230 mappedRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
231 mappedRange.memory = m_BufferMemory;
232 mappedRange.offset = offset;
233 mappedRange.size = size;
234
238 VK_CHECK(vkFlushMappedMemoryRanges(m_VulkanState.m_Device, 1, &mappedRange))
239
240#endif
241
242 }
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
Definition VulkanUtils.h:68
VmaAllocation m_Alloc
VMA allocation.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.
VmaAllocator m_VmaAllocator
Definition VulkanUtils.h:97