2#ifndef LIBSBX_POST_FILTER_HPP_
3#define LIBSBX_POST_FILTER_HPP_
8#include <libsbx/graphics/subrenderer.hpp>
9#include <libsbx/graphics/graphics_module.hpp>
11#include <libsbx/graphics/pipeline/graphics_pipeline.hpp>
12#include <libsbx/graphics/pipeline/vertex_input_description.hpp>
14#include <libsbx/graphics/descriptor/descriptor_handler.hpp>
25 filter(
const std::vector<graphics::attachment_description>& attachments,
const std::filesystem::path& path,
const graphics::pipeline_definition& pipeline_definition = default_pipeline_definition,
const VkSpecializationInfo* specialization_info =
nullptr)
27 _pipeline{path, attachments, pipeline_definition, specialization_info},
28 _descriptor_handler{_pipeline, 0u} { }
30 virtual ~filter()
override =
default;
33 return _descriptor_handler;
41 if (
auto it = _descriptors.find(descriptor_name); it != _descriptors.end()) {
48 auto attachment(
const std::string& descriptor_name,
const std::string& render_attachment) ->
const graphics::descriptor& {
49 if (
auto it = _descriptors.find(descriptor_name); it != _descriptors.end()) {
53 auto& graphics_module = core::engine::get_module<graphics::graphics_module>();
55 return graphics_module.attachment(render_attachment);
58 auto set_attachment(
const std::string& descriptor_name,
const graphics::descriptor& descriptor) ->
void {
59 if (
auto entry = _descriptors.find(descriptor_name); entry != _descriptors.end()) {
60 entry->second = &descriptor;
62 _descriptors.emplace(descriptor_name, &descriptor);
66 auto remove_attachment(
const std::string& descriptor_name) ->
bool {
67 if (
auto it = _descriptors.find(descriptor_name); it != _descriptors.end()) {
68 _descriptors.erase(it);
78 .depth = graphics::depth::disabled,
79 .uses_transparency =
false,
81 .polygon_mode = graphics::polygon_mode::fill,
82 .cull_mode = graphics::cull_mode::none,
83 .front_face = graphics::front_face::counter_clockwise
89 std::map<std::string, memory::observer_ptr<const graphics::descriptor>> _descriptors;
Definition: descriptor_handler.hpp:26
Definition: descriptor.hpp:38
Definition: graphics_pipeline.hpp:115
Definition: subrenderer.hpp:14
Definition: filter.hpp:19
Definition: graphics_pipeline.hpp:106
Definition: graphics_pipeline.hpp:67