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

#include <render_target.hpp>

Collaboration diagram for wren::RenderTarget:

Public Member Functions

auto resize (const std::shared_ptr< Context > &ctx, const math::Vec2f &new_size) -> expected< void >
 
auto view () const
 
auto view (const ::vk::ImageView &view)
 
auto format () const
 
auto format (const ::vk::Format &format)
 
auto size () const
 
auto size (const math::Vec2f &size)
 
auto sample_count () const
 
auto final_layout () const
 
auto final_layout (const ::vk::ImageLayout &layout)
 
auto usage () const
 

Static Public Member Functions

static auto create (const std::shared_ptr< Context > &ctx) -> expected< std::shared_ptr< RenderTarget > >
 Craete a RenderTarget object with all defaults for a colour target.
 
static auto create_depth (const std::shared_ptr< Context > &ctx) -> expected< std::shared_ptr< RenderTarget > >
 Create e render target to be used as a depth target.
 
static auto create (const math::Vec2f &size, ::vk::Format format, ::vk::SampleCountFlagBits sample_count, ::vk::ImageView image_view, ::vk::ImageUsageFlags image_usage) -> expected< std::shared_ptr< RenderTarget > >
 

Private Member Functions

 RenderTarget ()=default
 

Private Attributes

std::function< expected< void >()> transition_fn_
 
math::Vec2f size_
 
::vk::SampleCountFlagBits sample_count_
 
::vk::Format format_
 
std::optional< vk::Imageimage_
 
::vk::ImageView view_
 
::vk::ImageUsageFlags image_usage_
 
::vk::ImageLayout final_layout_ = ::vk::ImageLayout::ePresentSrcKHR
 
::vk::ImageAspectFlags aspect_
 

Constructor & Destructor Documentation

◆ RenderTarget()

wren::RenderTarget::RenderTarget ( )
privatedefault

Member Function Documentation

◆ create() [1/2]

auto wren::RenderTarget::create ( const math::Vec2f & size,
::vk::Format format,
::vk::SampleCountFlagBits sample_count,
::vk::ImageView image_view,
::vk::ImageUsageFlags image_usage ) -> expected<std::shared_ptr<RenderTarget>>
static

◆ create() [2/2]

auto wren::RenderTarget::create ( const std::shared_ptr< Context > & ctx) -> expected<std::shared_ptr<RenderTarget>>
static

Craete a RenderTarget object with all defaults for a colour target.

Parameters
ctxThe full application context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_depth()

auto wren::RenderTarget::create_depth ( const std::shared_ptr< Context > & ctx) -> expected<std::shared_ptr<RenderTarget>>
static

Create e render target to be used as a depth target.

Parameters
ctxthe full application context
Returns
On success a shared_ptr to the created depth RenderTarget or an error
Here is the caller graph for this function:

◆ final_layout() [1/2]

auto wren::RenderTarget::final_layout ( ) const
inline

◆ final_layout() [2/2]

auto wren::RenderTarget::final_layout ( const ::vk::ImageLayout & layout)
inline

◆ format() [1/2]

auto wren::RenderTarget::format ( ) const
inline

◆ format() [2/2]

auto wren::RenderTarget::format ( const ::vk::Format & format)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

auto wren::RenderTarget::resize ( const std::shared_ptr< Context > & ctx,
const math::Vec2f & new_size ) -> expected<void>

◆ sample_count()

auto wren::RenderTarget::sample_count ( ) const
inline

◆ size() [1/2]

auto wren::RenderTarget::size ( ) const
inline

◆ size() [2/2]

auto wren::RenderTarget::size ( const math::Vec2f & size)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

auto wren::RenderTarget::usage ( ) const
inline

◆ view() [1/2]

auto wren::RenderTarget::view ( ) const
inline

◆ view() [2/2]

auto wren::RenderTarget::view ( const ::vk::ImageView & view)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ aspect_

::vk::ImageAspectFlags wren::RenderTarget::aspect_
private

◆ final_layout_

::vk::ImageLayout wren::RenderTarget::final_layout_ = ::vk::ImageLayout::ePresentSrcKHR
private

◆ format_

::vk::Format wren::RenderTarget::format_
private

◆ image_

std::optional<vk::Image> wren::RenderTarget::image_
private

◆ image_usage_

::vk::ImageUsageFlags wren::RenderTarget::image_usage_
private

◆ sample_count_

::vk::SampleCountFlagBits wren::RenderTarget::sample_count_
private

◆ size_

math::Vec2f wren::RenderTarget::size_
private

◆ transition_fn_

std::function<expected<void>()> wren::RenderTarget::transition_fn_
private

◆ view_

::vk::ImageView wren::RenderTarget::view_
private

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