From c3aac9026951e2a6e35e76b9c7d36e114a281453 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Tue, 5 May 2026 00:43:54 +0200 Subject: Remove old api and move api-test content to src and include dirs --- include/vk-bindless.hpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 include/vk-bindless.hpp (limited to 'include/vk-bindless.hpp') diff --git a/include/vk-bindless.hpp b/include/vk-bindless.hpp new file mode 100644 index 0000000..008e420 --- /dev/null +++ b/include/vk-bindless.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include + +#include "handle.hpp" + +enum UniformTypes : uint32_t { + GLOBAL, + PASS, + DRAW, + MAX, +}; + +enum SamplerType : uint32_t { + NEAREST, + LINEAR, + MAX_SAMPLER, +}; + +struct device_buffer; + +struct bindless_model { + [[nodiscard]] device_buffer& get_uniform_buffer(enum UniformTypes type) const; + + void init(); + + void deinit(); + + VkPipelineLayout global_layout; + VkDescriptorSet global_set; + +public: + static constexpr size_t push_constant_slot_size = sizeof(uintptr_t); + static constexpr size_t push_constant_slots = 3U; + +private: + VkDescriptorSetLayout global_set_layout; + VkDescriptorPool descriptor_pool; + handle uniform_buffers[UniformTypes::MAX]; + + static constexpr size_t descriptor_pool_allocable_sets_count = 64U; + static constexpr uint32_t set_descriptors_count = 1024U; + + VkSampler samplers[SamplerType::MAX_SAMPLER]; + + static constexpr size_t globals_uniform_buffer_size = 64 * KB; + static constexpr size_t passes_uniform_buffer_size = 64 * KB; + static constexpr size_t draws_uniform_buffer_size = 64 * KB; +}; -- cgit v1.3