diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2026-05-21 23:18:16 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2026-05-21 23:18:16 +0200 |
| commit | 92e09dc06f8c8dd5b7a9323d586f4bf642078727 (patch) | |
| tree | e88400323165ab55b39b05d5e0f01f6ebc2df7a7 /src/vk-device.cpp | |
| parent | 8f137322da4220aeb3863ff79724644e7e5152a0 (diff) | |
Save work on fixing images upload
Diffstat (limited to 'src/vk-device.cpp')
| -rw-r--r-- | src/vk-device.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/vk-device.cpp b/src/vk-device.cpp index 6fa3533..9c1b7a4 100644 --- a/src/vk-device.cpp +++ b/src/vk-device.cpp @@ -76,7 +76,19 @@ void vkdevice::deinit() { } -void vkdevice::wait() { vkDeviceWaitIdle(device); }; +void vkdevice::wait() { + vkDeviceWaitIdle(device); +}; + +void vkdevice::wait_for_fence(u64 value) { + VkSemaphoreWaitInfoKHR semaphore_wait_info { + .type = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR, + }; + semaphore_wait_info.pSemaphores = &semaphore; + semaphore_wait_info.semaphoreCount = 1; + semaphore_wait_info.pValues = &value; + VK_CHECK(vkWaitSemaphoresKHR(device->get_handle(), &semaphore_wait_info, UINT64_MAX)); +} handle<device_texture> vkdevice::create_texture(const texture_desc& desc) { device_texture device_texture; @@ -125,7 +137,9 @@ handle<device_buffer> vkdevice::create_buffer(const buffer_desc& desc) { .pUserData = nullptr, }; - VmaAllocationInfo alloc_info{}; + VmaAllocationInfo alloc_info{ + .pName = desc.name, + }; VKCHECK(vmaCreateBuffer(gpu_allocator, &create_info, &alloc_create_info, &device_buffer.vk_buffer, &device_buffer.alloc, &alloc_info)); vmaSetAllocationName(render_device.get_allocator(), device_buffer.alloc, desc.name); |
