refactor renderer

This commit is contained in:
nmzik
2026-07-27 02:24:50 +02:00
parent a720b28b7f
commit a20cf5d298
112 changed files with 18269 additions and 18368 deletions
@@ -3,6 +3,7 @@
#include "graphics/host_gpu/vulkanCommon.h"
#include <array>
#include <cstdint>
#include <type_traits>
@@ -10,6 +11,30 @@ namespace Libs::Graphics {
static constexpr uint32_t RENDER_COLOR_ATTACHMENTS_MAX = 8;
struct RenderAttachment {
vk::ImageView image_view = nullptr;
vk::ImageLayout image_layout = vk::ImageLayout::eUndefined;
std::array<uint32_t, 4> clear_value = {};
bool is_clear = false;
bool has_depth = false;
bool depth_clear = false;
bool has_stencil = false;
bool stencil_clear = false;
bool operator==(const RenderAttachment&) const = default;
};
struct RenderState {
std::array<RenderAttachment, RENDER_COLOR_ATTACHMENTS_MAX> color_attachments;
RenderAttachment depth_stencil_attachment;
uint32_t width = 0;
uint32_t height = 0;
uint32_t num_layers = 1;
uint32_t num_color_attachments = 0;
bool operator==(const RenderState&) const = default;
};
[[nodiscard]] inline constexpr uint32_t render_sample_count(uint32_t encoded_samples) {
return encoded_samples <= 3 ? 1u << encoded_samples : 0;
}