From 67eec36945ed1706f23d0fe6d3017a09516dc42b Mon Sep 17 00:00:00 2001 From: grm Date: Fri, 3 Jan 2025 02:14:17 +0200 Subject: Prepare for compute --- src/vksetup.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/vksetup.h') diff --git a/src/vksetup.h b/src/vksetup.h index daa9148..923083b 100644 --- a/src/vksetup.h +++ b/src/vksetup.h @@ -213,8 +213,8 @@ typedef struct vks_frame_data { VkDescriptorSet vk_descriptor_set; /* compute stuff */ - /* VkDescriptorSet vk_compute_descriptor_set; */ - /* vks_buffer shader_storage_buffer; */ + VkDescriptorSet vk_compute_descriptor_set; + vks_buffer shader_storage_buffer; } vks_frame_data; /* Info structs */ @@ -1335,7 +1335,12 @@ vks_create_buffer(const vks_context vk, allocInfo.usage = VMA_MEMORY_USAGE_AUTO; allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; - vmaCreateBuffer(vk.allocator, &bufferInfo, &allocInfo, &buffer->handle, &buffer->allocation, NULL); + VK_CHECK(vmaCreateBuffer(vk.allocator, &bufferInfo, &allocInfo, &buffer->handle, &buffer->allocation, NULL)); + + VmaAllocationInfo info = {0}; + + vmaGetAllocationInfo(vk.allocator, buffer->allocation, &info); + buffer->memory = info.deviceMemory; } #endif /* VKSETUP_IMPLEMENTATION */ -- cgit v1.2.3