Add gpuFlushBuffer

This commit is contained in:
abdelrahman committed 2026-11-01 00:22:59 +00:00
1 parent 6c6dd5626c
commit f308900207
2 files changed
+15

No files matched your search

+7
View File
@@ -1037,6 +1037,13 @@ void gpuDestroyBuffer(GpuBuffer *buffer) {
buffer->size = 0;
}
void gpuFlushBuffer(GpuBufferFlushRequest request) {
u64 size = request.size > 0 ? request.size : VK_WHOLE_SIZE;
VkResult vk_result = vmaFlushAllocation(request.device->allocator, request.buffer.internal->allocation,
request.offset, size);
assertWithLogger(vk_result == VK_SUCCESS, &logger, "Failed to flush buffer");
}
GpuFence *gpuCreateFence(const WpAllocator *allocator, GpuDevice *device) {
GpuFence *fence = wpMemAllocatorAlloc(allocator, sizeof(GpuFence));
assertWithLogger(fence != NULL, &logger, "Failed to allocate fence internal");