From c4a6f4bbaaf86d50d5da103894469a9bc12a1323 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sat, 18 Jan 2025 23:48:11 +0100 Subject: Working api prototype --- include/api-test/command-buffer.hpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 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 f7a18b0..d26fa13 100644 --- a/include/api-test/command-buffer.hpp +++ b/include/api-test/command-buffer.hpp @@ -22,10 +22,22 @@ struct device_buffer; struct device_pipeline; struct dispatch_params { + enum class PARAM_BINDING : uint32_t { + PARAM1, + PARAM2, + PARAM3, + PARAM4, + PARAM5, + PARAM6, + PARAM7, + PARAM8, + MAX + }; + handle pipeline; vec3u group_size; vec3u local_group_size; - uint32_t uniforms_offset; + uint64_t params[static_cast(PARAM_BINDING::MAX)]; }; struct renderpass_params { @@ -41,14 +53,30 @@ public: rect render_area; std::span> color_attachments; }; + struct draw_params { + handle pipeline; + handle index_buffer; + uint32_t vertex_count; + uint32_t vertex_offset; + uint32_t instance_count; + uint64_t globals_address = 0U; // TODO: This is probably stupid and should be set elsewhere once ??? + uint64_t instances_address = 0U; + uint64_t uniforms_address = 0U; + uint64_t vertex_address = 0U; +}; + +struct draw_indexed_params { handle pipeline; handle index_buffer; uint32_t vertex_count; uint32_t vertex_offset; uint32_t index_offset; uint32_t instance_count; - uint32_t uniforms_offset; + uint64_t globals_address = 0U; // TODO: This is probably stupid and should be set elsewhere once ??? + uint64_t instances_address = 0U; + uint64_t uniforms_address = 0U; + uint64_t vertex_address = 0U; }; struct command_buffer { @@ -68,7 +96,8 @@ struct graphics_command_buffer: public command_buffer { void dispatch(const dispatch_params& params) const; void begin_renderpass(const renderpass_params& params) const; - void render(const draw_params& params) const; + void draw(const draw_params& params) const; + void draw_indexed(const draw_indexed_params& params) const; void end_renderpass() const; }; -- cgit v1.3