aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/api-test/command-buffer.hpp28
-rw-r--r--include/api-test/vk-device-types.hpp3
-rw-r--r--include/vulkan-loader.hpp2
3 files changed, 32 insertions, 1 deletions
diff --git a/include/api-test/command-buffer.hpp b/include/api-test/command-buffer.hpp
index ffeafc4..2cd1d75 100644
--- a/include/api-test/command-buffer.hpp
+++ b/include/api-test/command-buffer.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
+#include <span>
#include <vulkan/vulkan_core.h>
@@ -27,6 +28,27 @@ struct dispatch_params {
uint32_t uniforms_offset;
};
+struct renderpass_params {
+private:
+ struct rect {
+ int32_t x;
+ int32_t y;
+ uint32_t width;
+ uint32_t height;
+ };
+
+public:
+ rect render_area;
+ std::span<handle<device_texture>> color_attachments;
+ // optional viewport
+ // optional scissor
+};
+struct draw_params {
+ handle<device_pipeline> pipeline;
+ uint32_t vertex_count;
+ uint32_t instance_count;
+};
+
struct command_buffer {
void start() const;
void stop() const;
@@ -41,7 +63,11 @@ struct command_buffer {
// General purpose queue
struct graphics_command_buffer: public command_buffer {
- void dispatch(const dispatch_params& params);
+ void dispatch(const dispatch_params& params) const;
+
+ void begin_renderpass(const renderpass_params& params) const;
+ void render(const draw_params& params) const;
+ void end_renderpass() const;
};
struct compute_command_buffer: public command_buffer {
diff --git a/include/api-test/vk-device-types.hpp b/include/api-test/vk-device-types.hpp
index 33a7738..bca57af 100644
--- a/include/api-test/vk-device-types.hpp
+++ b/include/api-test/vk-device-types.hpp
@@ -59,6 +59,9 @@ struct pipeline_desc {
std::span<uint8_t> vs_code;
std::span<uint8_t> fs_code;
std::span<uint8_t> cs_code;
+ std::span<VkFormat> color_attachments_format;
+ VkFormat depth_attachment_format;
+ VkFormat stencil_attachment_format;
};
struct device_pipeline {
diff --git a/include/vulkan-loader.hpp b/include/vulkan-loader.hpp
index d0ad3a5..cd93415 100644
--- a/include/vulkan-loader.hpp
+++ b/include/vulkan-loader.hpp
@@ -88,6 +88,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
X(vkCmdPushConstants) \
X(vkCmdClearColorImage) \
X(vkCmdBeginRenderPass) \
+ X(vkCmdBeginRendering) \
X(vkCmdBindPipeline) \
X(vkCmdBindVertexBuffers) \
X(vkCmdBindIndexBuffer) \
@@ -101,6 +102,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
X(vkCmdDraw) \
X(vkCmdDrawIndexed) \
X(vkCmdDispatch) \
+ X(vkCmdEndRendering) \
X(vkCmdEndRenderPass) \
X(vkEndCommandBuffer) \
X(vkResetCommandBuffer) \