sandbox
Loading...
Searching...
No Matches
separate_sampler_array.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_GRAPHICS_SAMPLERS_SAMPLER_STATE_ARRAY_HPP_
3#define LIBSBX_GRAPHICS_SAMPLERS_SAMPLER_STATE_ARRAY_HPP_
4
5#include <vector>
6#include <unordered_map>
7
8#include <libsbx/graphics/descriptor/descriptor.hpp>
9#include <libsbx/graphics/images/sampler_state.hpp>
10
11namespace sbx::graphics {
12
14
15public:
16
17 inline static constexpr auto max_size = std::uint32_t{16u};
18
20
22
24
25 static auto create_descriptor_set_layout_binding(std::uint32_t binding, VkDescriptorType descriptor_type, VkShaderStageFlags shader_stage_flags) noexcept -> VkDescriptorSetLayoutBinding;
26
27 auto write_descriptor_set(std::uint32_t binding, VkDescriptorType descriptor_type) const noexcept -> graphics::write_descriptor_set override;
28
29 auto push_back(const handle_type& handle) -> std::uint32_t;
30
31 auto clear() -> void;
32
33private:
34
35 std::vector<handle_type> _sampler_ids;
36 std::unordered_map<handle_type, std::uint32_t> _id_to_indices;
37
38}; // class separate_sampler_array
39
40} // namespace sbx::graphics
41
42#endif // LIBSBX_GRAPHICS_SAMPLERS_SAMPLER_STATE_ARRAY_HPP_
Definition: descriptor.hpp:38
Definition: resource_storage.hpp:18
Definition: separate_sampler_array.hpp:13
Definition: descriptor.hpp:13