Unravel Engine C++ Reference
Loading...
Searching...
No Matches
blit_pass.h
Go to the documentation of this file.
1// blit_pass.h
2#pragma once
3
7#include <graphics/texture.h>
9
10namespace unravel
11{
12
14{
15public:
21
23 auto init(rtti::context& ctx) -> bool;
24
26 auto run(const run_params& params) -> gfx::frame_buffer::ptr;
27
28private:
31 auto create_or_update_output_fb(const gfx::frame_buffer::ptr& input,
32 const gfx::frame_buffer::ptr& output)
34
35 struct blit_program : uniforms_cache
36 {
38 void cache_uniforms()
39 {
40 cache_uniform(program.get(), s_input, "s_input", gfx::uniform_type::Sampler);
41 }
42
44 std::unique_ptr<gpu_program> program;
45 } blit_program_;
46
48};
49
50} // namespace unravel
auto init(rtti::context &ctx) -> bool
Must be called once (after bgfx::init() and after asset_manager is registered in context).
Definition blit_pass.cpp:10
auto run(const run_params &params) -> gfx::frame_buffer::ptr
Executes the blit: copies params.input → params.output. Returns the actual output framebuffer.
Definition blit_pass.cpp:85
std::shared_ptr< uniform > uniform_ptr
Definition program.h:19
gfx::frame_buffer::ptr input
Source framebuffer (must have a color texture).
Definition blit_pass.h:18
gfx::frame_buffer::ptr output
Optional destination framebuffer. If null, will be created to match input.
Definition blit_pass.h:19
Structure for caching uniforms.
void cache_uniform(gpu_program *program, gfx::program::uniform_ptr &uniform, const hpp::string_view &name, gfx::uniform_type type, uint16_t num=1)
Caches a uniform in the GPU program.