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