sandbox
Loading...
Searching...
No Matches
push_handler.hpp
1#ifndef LIBSBX_GRAPHICS_BUFFERS_PUSH_HANDLER_HPP_
2#define LIBSBX_GRAPHICS_BUFFERS_PUSH_HANDLER_HPP_
3
4#include <cinttypes>
5#include <optional>
6#include <memory>
7#include <concepts>
8
9#include <libsbx/graphics/pipeline/shader.hpp>
10#include <libsbx/graphics/pipeline/pipeline.hpp>
11
12#include <libsbx/graphics/commands/command_buffer.hpp>
13
14namespace sbx::graphics {
15
17
18public:
19
20 push_handler(const std::optional<shader::uniform_block>& uniform_block = std::nullopt);
21
22 template<typename Type>
23 auto push(const Type& object, std::size_t size, std::size_t offset) -> void;
24
25 template<typename Type>
26 auto push(const std::string& uniform_name, const Type& object, std::size_t size = 0) -> void;
27
28 auto update(const std::optional<shader::uniform_block>& uniform_block) -> bool;
29
30 auto bind(command_buffer& command_buffer, const pipeline& pipeline) -> void;
31
32private:
33
34 std::optional<shader::uniform_block> _uniform_block;
35 std::unique_ptr<std::uint8_t[]> _data;
36
37}; // class push_handler
38
39} // namespace sbx::graphics
40
41#include <libsbx/graphics/buffers/push_handler.ipp>
42
43#endif // LIBSBX_GRAPHICS_BUFFERS_PUSH_HANDLER_HPP_
Definition: command_buffer.hpp:14
Definition: pipeline.hpp:18
Definition: push_handler.hpp:16