summaryrefslogtreecommitdiff
path: root/src/vulkan_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan_helper.h')
-rw-r--r--src/vulkan_helper.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vulkan_helper.h b/src/vulkan_helper.h
index ebdd691..c2b1c8c 100644
--- a/src/vulkan_helper.h
+++ b/src/vulkan_helper.h
@@ -23,14 +23,13 @@ struct Buffer_t {
VkBuffer buffer;
VmaAllocator allocator;
VmaAllocation allocation;
-
VkBufferUsageFlags flags;
VkDeviceSize size;
void *mapped_data = nullptr;
- ~Buffer_t();
void* map();
void unmap();
+ void release();
};
typedef std::shared_ptr<Buffer_t> Buffer;
@@ -45,7 +44,7 @@ struct Texture2D_t {
VkImageUsageFlags flags;
VkExtent2D extent;
- ~Texture2D_t();
+ void release();
};
typedef std::shared_ptr<Texture2D_t> Texture2D;
@@ -60,12 +59,21 @@ struct CommandBuffer {
VkQueue queue;
CommandBuffer(VkDevice device, uint32_t queue_family_index, VkQueue queue);
- ~CommandBuffer();
-
+ void destroy();
void begin(VkCommandBufferUsageFlags flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
void submit_sync();
};
+struct AsyncCommandBuffer {
+ VkDevice device;
+ VkCommandPool pool;
+ VkCommandBuffer buffer;
+ VkQueue queue;
+
+ AsyncCommandBuffer(VkDevice device, uint32_t queue_family_index, VkQueue queue);
+ void destroy();
+};
+
struct Device {
VkInstance instance;
VkPhysicalDevice physical_device;
@@ -75,6 +83,7 @@ struct Device {
VmaAllocator allocator;
#ifdef USE_VULKAN_VALIDATION_LAYERS
VkDebugReportCallbackEXT debugReportCallback;
+ VkDebugUtilsMessengerEXT debugUtilsMessenger;
#endif
Device() = delete;
@@ -122,6 +131,7 @@ struct Device {
});
CommandBuffer create_command_buffer();
+ AsyncCommandBuffer create_async_command_buffer();
};
} // namespace iris \ No newline at end of file