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
auto render_finished_semaphore () 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 >(const RenderTarget *)> transition_fn_
math::Vec2f size_
::vk::Semaphore render_finished_semaphore_
::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
Here is the caller graph for this function:

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
Here is the call graph for this function:

◆ 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 call graph for this function:
Here is the caller graph for this function:

◆ final_layout() [1/2]

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

◆ final_layout() [2/2]

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

◆ format() [1/2]

auto wren::RenderTarget::format ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ format() [2/2]

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

◆ render_finished_semaphore()

auto wren::RenderTarget::render_finished_semaphore ( ) const
inlinenodiscard

◆ resize()

auto wren::RenderTarget::resize ( const std::shared_ptr< Context > & ctx,
const math::Vec2f & new_size ) -> expected<void>
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_count()

auto wren::RenderTarget::sample_count ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ size() [1/2]

auto wren::RenderTarget::size ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ size() [2/2]

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

◆ usage()

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

◆ view() [1/2]

auto wren::RenderTarget::view ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ view() [2/2]

auto wren::RenderTarget::view ( const ::vk::ImageView & view)
inline
Here is the call 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

◆ render_finished_semaphore_

::vk::Semaphore wren::RenderTarget::render_finished_semaphore_
private

◆ sample_count_

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

◆ size_

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

◆ transition_fn_

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

◆ view_

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

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