4#include <vulkan/vulkan.hpp>
5#include <vulkan/vulkan_enums.hpp>
6#include <vulkan/vulkan_structs.hpp>
22 static auto create(
const std::shared_ptr<Context> &ctx)
38 const std::shared_ptr<RenderTarget> &target) {
43 const std::function<
void(::vk::CommandBuffer &)> &cmd_buf)
47 explicit Renderer(
const std::shared_ptr<Context> &ctx);
55 const std::vector<::vk::SurfaceFormatKHR> &formats)
56 -> ::vk::SurfaceFormatKHR;
58 const std::vector<::vk::PresentModeKHR> &formats) -> ::vk::PresentModeKHR;
60 const ::vk::SurfaceCapabilitiesKHR &surface_capabilities)
63 std::unordered_map<std::string, std::shared_ptr<Pipeline>>
pipelines_;
64 std::shared_ptr<Context>
ctx_;
69 std::unordered_map<std::string, std::shared_ptr<RenderTarget>>
auto compile() const -> expected< Graph >
Definition graph.cpp:19
Definition renderer.hpp:17
std::unordered_map< std::string, std::shared_ptr< Pipeline > > pipelines_
Definition renderer.hpp:63
static auto create(const std::shared_ptr< Context > &ctx) -> expected< std::shared_ptr< Renderer > >
Definition renderer.cpp:131
auto submit_command_buffer(const std::function< void(::vk::CommandBuffer &)> &cmd_buf) -> expected< void >
Definition renderer.cpp:92
auto render_targets() const
Get the swapchain's targets.
Definition renderer.hpp:36
static constexpr std::string_view kSwapchainRendertargetName
Definition renderer.hpp:18
::vk::CommandPool command_pool_
Definition renderer.hpp:79
void draw()
Definition renderer.cpp:19
auto recreate_swapchain() -> expected< void >
Definition renderer.cpp:178
auto swapchain_images_views() const
Definition renderer.hpp:32
Graph render_graph
Definition renderer.hpp:82
::vk::Fence in_flight_fence
Definition renderer.hpp:77
auto choose_swapchain_format(const std::vector<::vk::SurfaceFormatKHR > &formats) -> ::vk::SurfaceFormatKHR
Definition renderer.cpp:299
std::shared_ptr< Context > ctx_
Definition renderer.hpp:64
auto choose_swapchain_presentation_mode(const std::vector<::vk::PresentModeKHR > &formats) -> ::vk::PresentModeKHR
Definition renderer.cpp:314
std::unordered_map< std::string, std::shared_ptr< RenderTarget > > render_targets_
Definition renderer.hpp:70
Renderer(const std::shared_ptr< Context > &ctx)
Definition renderer.cpp:114
std::vector<::vk::Image > swapchain_images_
Definition renderer.hpp:66
::vk::SwapchainKHR swapchain_
Definition renderer.hpp:65
std::vector<::vk::ImageView > swapchain_image_views_
Definition renderer.hpp:67
auto begin_frame() -> expected< uint32_t >
Definition renderer.cpp:26
auto set_graph_builder(const GraphBuilder &builder)
Definition renderer.hpp:27
auto add_target(const std::string &name, const std::shared_ptr< RenderTarget > &target)
Definition renderer.hpp:37
::vk::Format swapchain_image_format_
Definition renderer.hpp:72
::vk::CommandBuffer one_time_cmd_buffer
Definition renderer.hpp:80
::vk::Semaphore render_finished
Definition renderer.hpp:76
auto choose_swapchain_extent(const ::vk::SurfaceCapabilitiesKHR &surface_capabilities) -> ::vk::Extent2D
Definition renderer.cpp:325
::vk::Extent2D swapchain_extent_
Definition renderer.hpp:73
auto get_graph() const
Definition renderer.hpp:30
Mesh m
Definition renderer.hpp:84
void end_frame(uint32_t image_index)
Definition renderer.cpp:57
::vk::Semaphore image_available
Definition renderer.hpp:75
Definition editor_scene.hpp:5
std::expected< T, Err > expected
Definition result.hpp:49