aboutsummaryrefslogtreecommitdiffstats
path: root/include/primitive-renderpass.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2026-05-05 00:43:54 +0200
committerladevieq <ladevie.quentin@gmail.com>2026-05-05 00:49:12 +0200
commitc3aac9026951e2a6e35e76b9c7d36e114a281453 (patch)
treebdfc2ab5d5f1d196ba8c7a76371a29911f75913e /include/primitive-renderpass.hpp
parent754249d9c652ef941e6b082d2e86538d15ba9434 (diff)
Remove old api and move api-test content to src and include dirs
Diffstat (limited to 'include/primitive-renderpass.hpp')
-rw-r--r--include/primitive-renderpass.hpp93
1 files changed, 0 insertions, 93 deletions
diff --git a/include/primitive-renderpass.hpp b/include/primitive-renderpass.hpp
deleted file mode 100644
index 95562fe..0000000
--- a/include/primitive-renderpass.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-#pragma once
-
-#include <vector>
-
-#include "renderpass.hpp"
-#include "vk-renderer.hpp"
-
-class Buffer;
-class Texture;
-class Sampler;
-class Primitive;
-
-class PrimitiveRenderpass : public Renderpass {
- public:
-
- PrimitiveRenderpass(vkapi& api);
-
- void add_primitive(Primitive* new_primitive);
-
- void add_color_attachment(VkFormat format);
-
- void set_depth_stencil(Texture* depth_stencil);
-
- void set_viewport(float x, float y, float width, float height);
-
- void set_color_attachment(uint32_t index, Texture* attachment);
-
- void finalize_render_pass();
-
- void execute(vkrenderer& renderer, VkCommandBuffer command_buffer) final;
-
- VkRenderPass render_pass = VK_NULL_HANDLE;
-
- private:
-
- void create_framebuffers();
-
- void recreate_framebuffers();
-
- VkViewport viewport = { .minDepth = 0.f, .maxDepth = 1.f };
-
- std::vector<Texture*> color_attachments;
- std::vector<VkImageView> color_attachments_view;
- std::vector<VkFormat> color_attachments_format;
-
- framebuffer framebuffers[vkrenderer::virtual_frames_count];
-
- std::vector<Primitive*> primitives;
-};
-
-
-class Primitive {
- public:
-
- Primitive(PrimitiveRenderpass& render_pass);
-
- void set_pipeline(const char* shader_name);
-
- void set_constant_offset(off_t offset);
- void set_constant(off_t offset, uint64_t* constant);
- void set_constant(off_t offset, Texture* texture);
- void set_constant(off_t offset, Buffer* buffer);
- void set_constant(off_t offset, Sampler* sampler);
-
- void set_index_buffer(Buffer* buffer);
-
- void set_scissor(int32_t x, int32_t y, uint32_t width, uint32_t height);
-
- void set_draw_info(size_t vertex_count, off_t indices_off, off_t vertex_off);
-
- void render(VkCommandBuffer command_buffer);
-
-
-private:
-
- vkapi& api;
-
- PrimitiveRenderpass& primitive_render_pass;
-
- pipeline pipeline;
-
- Buffer* index_buffer;
-
- size_t element_count;
- off_t indices_offset;
- off_t vertex_offset;
-
- off_t constant_offset;
-
- VkRect2D scissor = {};
-
- uint8_t constants[64];
-};