wren
Vulkan-based game engine
Loading...
Searching...
No Matches
wren::RenderPass Class Reference

#include <render_pass.hpp>

Collaboration diagram for wren::RenderPass:

Public Types

using execute_fn_t = std::function<void(RenderPass&, ::vk::CommandBuffer&)>
 

Public Member Functions

void execute ()
 
template<typename T >
void write_scratch_buffer (const ::vk::CommandBuffer &cmd, uint32_t set, uint32_t binding, T data)
 
auto get_scratch_buffer (uint32_t set, uint32_t binding, size_t size) -> void *
 
auto resize_target (const math::Vec2f &new_size) -> expected< void >
 
void on_resource_resized (const std::pair< float, float > &size)
 
auto output_size () const
 
auto colour_target () const
 
auto resources () const
 
auto get_command_buffers () const
 
auto get_framebuffer () const
 
void recreate_framebuffers (const ::vk::Device &device)
 
void bind_pipeline (const std::string &pipeline_name)
 
auto get () const
 

Static Public Member Functions

static auto create (const std::shared_ptr< Context > &ctx, const std::string &name, const PassResources &resources, const std::shared_ptr< RenderTarget > &colour_target, const std::shared_ptr< RenderTarget > &depth_target, const execute_fn_t &fn) -> expected< std::shared_ptr< RenderPass > >
 

Private Member Functions

 RenderPass (const std::shared_ptr< Context > &ctx, std::string name, PassResources resources, const std::shared_ptr< RenderTarget > &colour_target, const std::shared_ptr< RenderTarget > &depth_target, execute_fn_t fn)
 

Private Attributes

std::shared_ptr< Contextctx_
 
std::string name_
 
PassResources resources_
 
std::shared_ptr< vk::Shader > last_bound_shader_
 
math::Vec2f size_ {}
 
execute_fn_t execute_fn_
 
::vk::RenderPass render_pass_
 
::vk::CommandPool command_pool_
 
std::vector<::vk::CommandBuffer > command_buffers_
 
std::shared_ptr< RenderTargetcolour_target_
 
std::shared_ptr< RenderTargetdepth_target_
 
::vk::Framebuffer framebuffer_
 
std::map< std::pair< uint32_t, uint32_t >, std::shared_ptr< vk::Buffer > > ubos_
 

Member Typedef Documentation

◆ execute_fn_t

using wren::RenderPass::execute_fn_t = std::function<void(RenderPass&, ::vk::CommandBuffer&)>

Constructor & Destructor Documentation

◆ RenderPass()

wren::RenderPass::RenderPass ( const std::shared_ptr< Context > & ctx,
std::string name,
PassResources resources,
const std::shared_ptr< RenderTarget > & colour_target,
const std::shared_ptr< RenderTarget > & depth_target,
execute_fn_t fn )
private

Member Function Documentation

◆ bind_pipeline()

void wren::RenderPass::bind_pipeline ( const std::string & pipeline_name)
Here is the caller graph for this function:

◆ colour_target()

auto wren::RenderPass::colour_target ( ) const
inline

◆ create()

auto wren::RenderPass::create ( const std::shared_ptr< Context > & ctx,
const std::string & name,
const PassResources & resources,
const std::shared_ptr< RenderTarget > & colour_target,
const std::shared_ptr< RenderTarget > & depth_target,
const execute_fn_t & fn ) -> expected<std::shared_ptr<RenderPass>>
static
Here is the caller graph for this function:

◆ execute()

void wren::RenderPass::execute ( )

◆ get()

auto wren::RenderPass::get ( ) const
inline

◆ get_command_buffers()

auto wren::RenderPass::get_command_buffers ( ) const
inline

◆ get_framebuffer()

auto wren::RenderPass::get_framebuffer ( ) const
inline

◆ get_scratch_buffer()

auto wren::RenderPass::get_scratch_buffer ( uint32_t set,
uint32_t binding,
size_t size ) -> void*

◆ on_resource_resized()

void wren::RenderPass::on_resource_resized ( const std::pair< float, float > & size)

◆ output_size()

auto wren::RenderPass::output_size ( ) const
inline

◆ recreate_framebuffers()

void wren::RenderPass::recreate_framebuffers ( const ::vk::Device & device)

◆ resize_target()

auto wren::RenderPass::resize_target ( const math::Vec2f & new_size) -> expected<void>

◆ resources()

auto wren::RenderPass::resources ( ) const
inline

◆ write_scratch_buffer()

template<typename T >
void wren::RenderPass::write_scratch_buffer ( const ::vk::CommandBuffer & cmd,
uint32_t set,
uint32_t binding,
T data )
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ colour_target_

std::shared_ptr<RenderTarget> wren::RenderPass::colour_target_
private

◆ command_buffers_

std::vector<::vk::CommandBuffer> wren::RenderPass::command_buffers_
private

◆ command_pool_

::vk::CommandPool wren::RenderPass::command_pool_
private

◆ ctx_

std::shared_ptr<Context> wren::RenderPass::ctx_
private

◆ depth_target_

std::shared_ptr<RenderTarget> wren::RenderPass::depth_target_
private

◆ execute_fn_

execute_fn_t wren::RenderPass::execute_fn_
private

◆ framebuffer_

::vk::Framebuffer wren::RenderPass::framebuffer_
private

◆ last_bound_shader_

std::shared_ptr<vk::Shader> wren::RenderPass::last_bound_shader_
private

◆ name_

std::string wren::RenderPass::name_
private

◆ render_pass_

::vk::RenderPass wren::RenderPass::render_pass_
private

◆ resources_

PassResources wren::RenderPass::resources_
private

◆ size_

math::Vec2f wren::RenderPass::size_ {}
private

◆ ubos_

std::map<std::pair<uint32_t, uint32_t>, std::shared_ptr<vk::Buffer> > wren::RenderPass::ubos_
private

The documentation for this class was generated from the following files: