48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
#pragma once
|
|
#include <vulkan/vulkan.hpp>
|
|
#include <map>
|
|
|
|
#include "buffer_vk.h"
|
|
|
|
class render_resource;
|
|
class texture;
|
|
|
|
/// 1. add_binding
|
|
/// 2. create();
|
|
/// 3. dispatch();
|
|
class CORE_API pipeline {
|
|
public:
|
|
virtual ~pipeline();
|
|
|
|
virtual void add_binding(uint32_t binding, vk::DescriptorType descriptor_type, uint32_t descriptor_count, vk::Sampler immutable_samplers) = 0;
|
|
|
|
void add_uniform_buffer(uint32_t binding, std::shared_ptr<buffer_vk> buf);
|
|
|
|
void add_storage_buffer(uint32_t binding, std::shared_ptr<buffer_vk> buf);
|
|
|
|
void add_sampled_image(uint32_t binding, std::shared_ptr<render_resource> in_texture);
|
|
|
|
void add_storage_image(uint32_t binding, std::shared_ptr<render_resource> in_texture);
|
|
|
|
void add_input_attachment(uint32_t binding);
|
|
|
|
void add_sampler(uint32_t binding, vk::Sampler immutable_samplers = nullptr);
|
|
|
|
void add_combined_image(uint32_t binding, std::shared_ptr<render_resource> in_texture);
|
|
|
|
virtual void create() = 0;
|
|
protected:
|
|
vk::Pipeline pipeline_;
|
|
vk::PipelineLayout pipeline_layout_;
|
|
vk::DescriptorSetLayout descriptor_set_layout_;
|
|
vk::DescriptorSet descriptor_set_;
|
|
|
|
vk::DescriptorPool descriptor_pool_;
|
|
std::vector<vk::DescriptorSetLayoutBinding> descriptor_set_layout_bindings_;
|
|
|
|
std::map<uint32_t, std::shared_ptr<buffer_vk>> buffers_;
|
|
std::map<uint32_t, std::shared_ptr<render_resource>> textures_;
|
|
protected:
|
|
void create_pipeline_layout();
|
|
};
|