2#ifndef LIBSBX_POST_FILTERS_UPSAMPLE_FILTER_HPP_
3#define LIBSBX_POST_FILTERS_UPSAMPLE_FILTER_HPP_
8#include <libsbx/core/engine.hpp>
10#include <libsbx/graphics/graphics_module.hpp>
11#include <libsbx/graphics/buffers/push_handler.hpp>
13#include <libsbx/post/filter.hpp>
23 upsample_filter(
const std::vector<graphics::attachment_description>& attachments,
const std::filesystem::path& path, std::string low_attachment, std::string base_attachment, std::float_t intensity = 1.0f)
24 :
base{attachments, path, base::default_pipeline_definition},
25 _push_handler{base::pipeline()},
26 _low_attachment{std::move(low_attachment)},
27 _base_attachment{std::move(base_attachment)},
28 _intensity{intensity} { }
33 EASY_BLOCK(
"upsample_filter::render");
35 auto& pipeline = base::pipeline();
36 auto& descriptor_handler = base::descriptor_handler();
38 auto& graphics_module = core::engine::get_module<graphics::graphics_module>();
40 pipeline.bind(command_buffer);
42 _push_handler.push(
"intensity", _intensity);
44 descriptor_handler.push(
"low_image", graphics_module.attachment(_low_attachment));
45 descriptor_handler.push(
"base_image", graphics_module.attachment(_base_attachment));
47 if (!descriptor_handler.update(pipeline)) {
51 descriptor_handler.bind_descriptors(command_buffer);
52 _push_handler.bind(command_buffer);
54 command_buffer.draw(3, 1, 0, 0);
60 std::string _low_attachment;
61 std::string _base_attachment;
62 std::float_t _intensity;
Definition: command_buffer.hpp:15
Definition: push_handler.hpp:18
Definition: filter.hpp:19
Definition: upsample_filter.hpp:17