#pragma once #include #include #include "handle.hpp" #include "vec3.hpp" enum class QueueType : uint32_t { GRAPHICS, ASYNC_COMPUTE, TRANSFER, MAX, }; struct device_texture; struct device_buffer; struct device_pipeline; struct dispatch_params { handle pipeline; vec3u group_size; vec3u local_group_size; uint32_t uniforms_offset; }; struct command_buffer { void start() const; void stop() const; void barrier(handle texture_handle, VkPipelineStageFlags2 stage, VkAccessFlags2 access, VkImageLayout layout) const; void copy(handle buffer_handle, handle texture_handle, VkDeviceSize offset = 0) const; VkCommandBuffer vk_command_buffer; QueueType queue_type; }; // General purpose queue struct graphics_command_buffer: public command_buffer { void dispatch(const dispatch_params& params); }; struct compute_command_buffer: public command_buffer { void dispatch(const dispatch_params& params); }; struct transfer_command_buffer: public command_buffer { };