From 0a882c4b85423a170455f05a52d18f7fa7c9220b Mon Sep 17 00:00:00 2001 From: Quentin LADEVIE Date: Sun, 22 Jan 2023 17:59:24 +0100 Subject: Api test bindless and command buffers --- include/api-test/command-buffer.hpp | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'include/api-test/command-buffer.hpp') diff --git a/include/api-test/command-buffer.hpp b/include/api-test/command-buffer.hpp index 140a291..1a0e553 100644 --- a/include/api-test/command-buffer.hpp +++ b/include/api-test/command-buffer.hpp @@ -6,6 +6,8 @@ #include "handle.hpp" +#include "vec3.hpp" + enum class QueueType : uint32_t { GRAPHICS, ASYNC_COMPUTE, @@ -14,31 +16,36 @@ enum class QueueType : uint32_t { }; -struct device_buffer; struct device_texture; +struct device_buffer; +struct device_pipeline; + +struct dispatch_params { + handle pipeline; + vec3u group_size; + vec3u local_group_size; +}; struct command_buffer { - void start() const; - void stop() const; + void start() const; + void stop() const; + + void barrier(handle texture_handle, VkPipelineStageFlags2 stage, VkAccessFlags2 access, VkImageLayout layout) const; - void barrier(); + void copy(handle buffer_handle, handle texture_handle, VkDeviceSize offset = 0) const; - VkCommandBuffer handle; + VkCommandBuffer vk_command_buffer; QueueType queue_type; }; -struct graphics_command_buffer : public command_buffer { - void set_pipeline(); - - void dispatch(); +// General purpose queue +struct graphics_command_buffer: public command_buffer { + void dispatch(const dispatch_params& params); }; -struct compute_command_buffer : public command_buffer { - void set_pipeline(); - - void dispatch(); +struct compute_command_buffer: public command_buffer { + void dispatch(const dispatch_params& params); }; -struct transfer_command_buffer : public command_buffer { - void copy(::handle buffer_handle, ::handle texture_handle); +struct transfer_command_buffer: public command_buffer { }; -- cgit v1.3