sandbox
Loading...
Searching...
No Matches
particle_subrenderer.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_PARTICLES_PARTICLE_SUBRENDERER_HPP_
3#define LIBSBX_PARTICLES_PARTICLE_SUBRENDERER_HPP_
4
5#include <libsbx/memory/observer_ptr.hpp>
6#include <libsbx/memory/tracking_allocator.hpp>
7
8#include <libsbx/graphics/subrenderer.hpp>
9
10#include <libsbx/graphics/pipeline/compute_pipeline.hpp>
11#include <libsbx/graphics/pipeline/graphics_pipeline.hpp>
12
13#include <libsbx/graphics/descriptor/descriptor_handler.hpp>
14
15#include <libsbx/graphics/buffers/push_handler.hpp>
16
17#include <libsbx/particles/particle_emitter.hpp>
18#include <libsbx/particles/particle_task.hpp>
19
20namespace sbx::particles {
21
23
24 inline static const auto definition = graphics::pipeline_definition{
25 .depth = graphics::depth::read_only,
26 .uses_transparency = true,
27 .rasterization_state = graphics::rasterization_state{
28 .polygon_mode = graphics::polygon_mode::fill,
29 .cull_mode = graphics::cull_mode::none,
30 .front_face = graphics::front_face::counter_clockwise
31 }
32 };
33
34public:
35
36 particle_subrenderer(const std::vector<graphics::attachment_description>& attachments, const std::filesystem::path& path, memory::observer_ptr<const particle_task> particle_task);
37
38 ~particle_subrenderer() override = default;
39
40 auto render(graphics::command_buffer& command_buffer) -> void override;
41
42private:
43
44 struct descriptor_data {
45 graphics::descriptor_handler descriptor_handler;
48 }; // struct descriptor_data
49
51
53 graphics::push_handler _push_handler;
54
55 std::unordered_map<scenes::node, descriptor_data> _descriptor_data;
56
57}; // class particle_subrenderer
58
59} // namespace sbx::particles
60
61#endif // LIBSBX_PARTICLES_PARTICLE_SUBRENDERER_HPP_
Definition: command_buffer.hpp:15
Definition: descriptor_handler.hpp:26
Definition: graphics_pipeline.hpp:113
Definition: push_handler.hpp:18
Definition: sampler_state.hpp:11
Definition: separate_image2d_array.hpp:16
Definition: subrenderer.hpp:14
A non-owning pointer that can be used to observe the value of a pointer.
Definition: observer_ptr.hpp:28
Definition: particle_subrenderer.hpp:22
Definition: particle_task.hpp:32
Definition: graphics_pipeline.hpp:104
Definition: graphics_pipeline.hpp:65