SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::IRenderPass Class Referenceabstract

Interface for a render pass. More...

#include <RenderPass.h>

Inheritance diagram for spark::render::IRenderPass:
spark::render::IStateResource spark::render::RenderPass< VulkanRenderPipeline, VulkanFrameBuffer, VulkanInputAttachmentMapping > spark::render::RenderPass< RenderPipelineType, FrameBufferType, InputAttachmentMappingType > spark::render::vk::VulkanRenderPass

Public Member Functions

virtual void begin (unsigned int buffer)=0
 Begins the render pass.
 
virtual void end () const =0
 Ends the render pass.
 
const IFrameBufferactiveFrameBuffer () const
 Gets the active frame buffer from the render pass.
 
std::vector< const IFrameBuffer * > frameBuffers () const noexcept
 Gets all frame buffers owned by the render pass.
 
virtual void resizeFrameBuffers (const math::Vector2< unsigned int > &new_render_area)=0
 Resets the frame buffers owned by the render pass.
 
std::vector< const IRenderPipeline * > pipelines () const noexcept
 Gets all render pipelines owned by the render pass.
 
virtual const RenderTargetrenderTarget (unsigned int location) const =0
 Gets the render target at the specified location.
 
virtual std::span< const RenderTargetrenderTargets () const noexcept=0
 Gets all render targets the render pass is rendering to.
 
virtual bool hasPresentRenderTarget () const noexcept=0
 Checks if one of the render targets is used for presentation in a ISwapChain.
 
virtual MultiSamplingLevel multiSamplingLevel () const noexcept=0
 Gets the number of samples the render targets are sampled with.
 
void updateAttachments (const IDescriptorSet &descriptor_set) const
 Resolves the input attachments mapped to the render pass and updates them on the descriptor set provided with descriptor_set.
 
- Public Member Functions inherited from spark::render::IStateResource
virtual const std::string & name () const noexcept=0
 Gets the name of the state resource.
 

Detailed Description

Interface for a render pass.

Member Function Documentation

◆ activeFrameBuffer()

const IFrameBuffer & spark::render::IRenderPass::activeFrameBuffer ( ) const
inlinenodiscard

Gets the active frame buffer from the render pass.

Returns
A IFrameBuffer used as back buffer by the render pass.
Exceptions
k2::base::RenderPassNotStartedExceptionif the render pass has not been started.

◆ begin()

virtual void spark::render::IRenderPass::begin ( unsigned int buffer)
pure virtual

Begins the render pass.

Parameters
bufferThe index of the back buffer to render to. Typically, the values returned by ISwapChain::swapBackBuffer() is used.
Exceptions
base::RenderPassAlreadyStartedExceptionif the render pass has already been started.
base::ArgumentOutOfRangeExceptionif buffer is out of range.

◆ end()

virtual void spark::render::IRenderPass::end ( ) const
pure virtual

Ends the render pass.

Note
If the frame buffer has a present render target, this causes the render pass to synchronize with the swap chain and issue a present command.
Exceptions
base::RenderPassNotStartedExceptionif the render pass has not been started.

Implemented in spark::render::vk::VulkanRenderPass.

◆ frameBuffers()

std::vector< const IFrameBuffer * > spark::render::IRenderPass::frameBuffers ( ) const
inlinenodiscardnoexcept

Gets all frame buffers owned by the render pass.

Returns
A std::vector of IFrameBuffer owned by the render pass.

◆ hasPresentRenderTarget()

virtual bool spark::render::IRenderPass::hasPresentRenderTarget ( ) const
nodiscardpure virtualnoexcept

Checks if one of the render targets is used for presentation in a ISwapChain.

Returns
true if one of the render targets is used for presentation in a ISwapChain, false otherwise.

Implemented in spark::render::vk::VulkanRenderPass.

◆ multiSamplingLevel()

virtual MultiSamplingLevel spark::render::IRenderPass::multiSamplingLevel ( ) const
nodiscardpure virtualnoexcept

Gets the number of samples the render targets are sampled with.

Returns
A MultiSamplingLevel value representing the number of samples the render targets are sampled with.

Implemented in spark::render::vk::VulkanRenderPass.

◆ pipelines()

std::vector< const IRenderPipeline * > spark::render::IRenderPass::pipelines ( ) const
inlinenodiscardnoexcept

Gets all render pipelines owned by the render pass.

Returns
A std::vector of IRenderPipeline owned by the render pass.

◆ renderTarget()

virtual const RenderTarget & spark::render::IRenderPass::renderTarget ( unsigned int location) const
nodiscardpure virtual

Gets the render target at the specified location.

Parameters
locationThe location of the render target to get.
Returns
The RenderTarget at the specified location.

◆ renderTargets()

virtual std::span< const RenderTarget > spark::render::IRenderPass::renderTargets ( ) const
nodiscardpure virtualnoexcept

Gets all render targets the render pass is rendering to.

Returns
A std::span of RenderTarget the render pass is rendering to.

Implemented in spark::render::vk::VulkanRenderPass.

◆ resizeFrameBuffers()

virtual void spark::render::IRenderPass::resizeFrameBuffers ( const math::Vector2< unsigned int > & new_render_area)
pure virtual

Resets the frame buffers owned by the render pass.

Parameters
new_render_areaThe size of the render area the frame buffers should be resized to.

◆ updateAttachments()

void spark::render::IRenderPass::updateAttachments ( const IDescriptorSet & descriptor_set) const
inline

Resolves the input attachments mapped to the render pass and updates them on the descriptor set provided with descriptor_set.

Parameters
descriptor_setThe IDescriptorSet to update the input attachments on.