Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
castor3d::RenderQuad Class Reference

#include <RenderQuad.hpp>

Inheritance diagram for castor3d::RenderQuad:
Inheritance graph
[legend]
Collaboration diagram for castor3d::RenderQuad:
Collaboration graph
[legend]

Public Member Functions

virtual C3D_API ~RenderQuad ()
 
C3D_API RenderQuad (RenderQuad &&rhs) noexcept
 
C3D_API void cleanup ()
 Cleans up GPU objects. More...
 
C3D_API void createPipeline (VkExtent2D const &size, castor::Position const &position, ashes::PipelineShaderStageCreateInfoArray const &program, ashes::RenderPass const &renderPass, ashes::VkPushConstantRangeArray const &pushRanges=ashes::VkPushConstantRangeArray{}, ashes::PipelineDepthStencilStateCreateInfo dsState=ashes::PipelineDepthStencilStateCreateInfo{ 0u, VK_FALSE, VK_FALSE })
 Creates the rendering pipeline. More...
 
C3D_API void registerPassInputs (ashes::WriteDescriptorSetArray const &writes, bool invertY=false)
 Creates the entries for one pass. More...
 
C3D_API void initialisePasses ()
 Initialises the descriptor sets for all registered passes. More...
 
C3D_API void createPipelineAndPass (VkExtent2D const &size, castor::Position const &position, ashes::PipelineShaderStageCreateInfoArray const &program, ashes::RenderPass const &renderPass, ashes::WriteDescriptorSetArray const &writes, ashes::VkPushConstantRangeArray const &pushRanges=ashes::VkPushConstantRangeArray{}, ashes::PipelineDepthStencilStateCreateInfo dsState=ashes::PipelineDepthStencilStateCreateInfo{ 0u, false, false })
 Creates the rendering pipeline and initialises the quad for one pass. More...
 
C3D_API void registerPass (ashes::CommandBuffer &commandBuffer, uint32_t descriptorSetIndex) const
 Prpares the commands to render the quad, inside given command buffer. More...
 
void registerPass (ashes::CommandBuffer &commandBuffer) const
 Prpares the commands to render the quad, inside given command buffer. More...
 
RenderSystemgetRenderSystem () const
 
RenderDevice const & getDevice () const
 
Sampler const & getSampler () const
 

Static Public Member Functions

static C3D_API ashes::WriteDescriptorSet makeDescriptorWrite (VkImageView const &view, VkSampler const &sampler, uint32_t dstBinding, uint32_t dstArrayElement=0u)
 Creates a descriptor write for combined image sampler. More...
 
static C3D_API ashes::WriteDescriptorSet makeDescriptorWrite (ashes::ImageView const &view, ashes::Sampler const &sampler, uint32_t dstBinding, uint32_t dstArrayElement=0u)
 Creates a descriptor write for combined image sampler. More...
 
static C3D_API ashes::WriteDescriptorSet makeDescriptorWrite (ashes::UniformBuffer const &buffer, uint32_t dstBinding, uint32_t elemOffset, uint32_t elemRange, uint32_t dstArrayElement=0u)
 Creates a descriptor write for uniform buffer. More...
 
template<typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite (UniformBufferOffsetT< DataT > const &buffer, uint32_t dstBinding, uint32_t dstArrayElement=0u)
 Creates a descriptor write for uniform buffer range. More...
 
static C3D_API ashes::WriteDescriptorSet makeDescriptorWrite (ashes::BufferBase const &storageBuffer, uint32_t dstBinding, uint32_t byteOffset, uint32_t byteRange, uint32_t dstArrayElement=0u)
 Creates a descriptor write for storage buffer. More...
 
template<typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite (ashes::Buffer< DataT > const &storageBuffer, uint32_t dstBinding, uint32_t elemOffset, uint32_t elemRange, uint32_t dstArrayElement=0u)
 Creates a descriptor write for storage buffer. More...
 
static C3D_API ashes::WriteDescriptorSet makeDescriptorWrite (ashes::BufferBase const &buffer, ashes::BufferView const &view, uint32_t dstBinding, uint32_t dstArrayElement=0u)
 Creates a descriptor write for buffer texel view. More...
 
template<typename DataT >
static ashes::WriteDescriptorSet makeDescriptorWrite (ashes::Buffer< DataT > const &buffer, ashes::BufferView const &view, uint32_t dstBinding, uint32_t dstArrayElement=0u)
 Creates a descriptor write for buffer texel view. More...
 

Protected Member Functions

C3D_API RenderQuad (RenderDevice const &device, castor::String const &name, VkFilter samplerFilter, rq::Config config)
 Constructor. More...
 

Protected Attributes

RenderSystemm_renderSystem
 
RenderDevice const & m_device
 
SamplerResPtr m_sampler
 
rq::ConfigData m_config
 

Friends

template<typename ConfigT , typename BuilderT >
class RenderQuadBuilderT
 

Constructor & Destructor Documentation

◆ RenderQuad() [1/2]

C3D_API castor3d::RenderQuad::RenderQuad ( RenderDevice const &  device,
castor::String const &  name,
VkFilter  samplerFilter,
rq::Config  config 
)
protected

Constructor.

Parameters
[in]deviceThe RenderDevice.
[in]nameThe pass name.
[in]samplerFilterThe sampler filter for the source texture.
[in]configThe configuration.

◆ ~RenderQuad()

virtual C3D_API castor3d::RenderQuad::~RenderQuad ( )
virtual

◆ RenderQuad() [2/2]

C3D_API castor3d::RenderQuad::RenderQuad ( RenderQuad &&  rhs)
explicitnoexcept

Member Function Documentation

◆ cleanup()

C3D_API void castor3d::RenderQuad::cleanup ( )

Cleans up GPU objects.

◆ createPipeline()

C3D_API void castor3d::RenderQuad::createPipeline ( VkExtent2D const &  size,
castor::Position const &  position,
ashes::PipelineShaderStageCreateInfoArray const &  program,
ashes::RenderPass const &  renderPass,
ashes::VkPushConstantRangeArray const &  pushRanges = ashes::VkPushConstantRangeArray{},
ashes::PipelineDepthStencilStateCreateInfo  dsState = ashes::PipelineDepthStencilStateCreateInfo{ 0u, VK_FALSE, VK_FALSE } 
)

Creates the rendering pipeline.

Parameters
[in]sizeThe render size.
[in]positionThe render position.
[in]programThe shader program.
[in]renderPassThe render pass to use.
[in]pushRangesThe push constant ranges.
[in]dsStateThe depth and stencil state.

◆ createPipelineAndPass()

C3D_API void castor3d::RenderQuad::createPipelineAndPass ( VkExtent2D const &  size,
castor::Position const &  position,
ashes::PipelineShaderStageCreateInfoArray const &  program,
ashes::RenderPass const &  renderPass,
ashes::WriteDescriptorSetArray const &  writes,
ashes::VkPushConstantRangeArray const &  pushRanges = ashes::VkPushConstantRangeArray{},
ashes::PipelineDepthStencilStateCreateInfo  dsState = ashes::PipelineDepthStencilStateCreateInfo{ 0u, false, false } 
)

Creates the rendering pipeline and initialises the quad for one pass.

Parameters
[in]sizeThe render size.
[in]positionThe render position.
[in]programThe shader program.
[in]renderPassThe render pass to use.
[in]writesThe pass descriptor writes.
[in]pushRangesThe push constant ranges.
[in]dsStateThe depth stencil state to use.

◆ getDevice()

RenderDevice const & castor3d::RenderQuad::getDevice ( ) const
inline

References m_device.

◆ getRenderSystem()

RenderSystem * castor3d::RenderQuad::getRenderSystem ( ) const
inline

References m_renderSystem.

◆ getSampler()

Sampler const & castor3d::RenderQuad::getSampler ( ) const
inline

References m_sampler.

◆ initialisePasses()

C3D_API void castor3d::RenderQuad::initialisePasses ( )

Initialises the descriptor sets for all registered passes.

◆ makeDescriptorWrite() [1/8]

template<typename DataT >
static ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::Buffer< DataT > const &  buffer,
ashes::BufferView const &  view,
uint32_t  dstBinding,
uint32_t  dstArrayElement = 0u 
)
inlinestatic

Creates a descriptor write for buffer texel view.

Parameters
[in]bufferThe buffer.
[in]viewThe texel view.
[in]dstBindingThe binding inside the descriptor set.
[in]dstArrayElementThe array element index.

References makeDescriptorWrite().

Here is the call graph for this function:

◆ makeDescriptorWrite() [2/8]

template<typename DataT >
static ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::Buffer< DataT > const &  storageBuffer,
uint32_t  dstBinding,
uint32_t  elemOffset,
uint32_t  elemRange,
uint32_t  dstArrayElement = 0u 
)
inlinestatic

Creates a descriptor write for storage buffer.

Parameters
[in]storageBufferThe storage buffer.
[in]dstBindingThe binding inside the descriptor set.
[in]elemOffsetThe offset, expressed in element count.
[in]elemRangeThe range, expressed in element count.
[in]dstArrayElementThe array element index.

References makeDescriptorWrite().

Here is the call graph for this function:

◆ makeDescriptorWrite() [3/8]

static C3D_API ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::BufferBase const &  buffer,
ashes::BufferView const &  view,
uint32_t  dstBinding,
uint32_t  dstArrayElement = 0u 
)
static

Creates a descriptor write for buffer texel view.

Parameters
[in]bufferThe buffer.
[in]viewThe texel view.
[in]dstBindingThe binding inside the descriptor set.
[in]dstArrayElementThe array element index.

◆ makeDescriptorWrite() [4/8]

static C3D_API ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::BufferBase const &  storageBuffer,
uint32_t  dstBinding,
uint32_t  byteOffset,
uint32_t  byteRange,
uint32_t  dstArrayElement = 0u 
)
static

Creates a descriptor write for storage buffer.

Parameters
[in]storageBufferThe storage buffer.
[in]dstBindingThe binding inside the descriptor set.
[in]byteOffsetThe offset, expressed in bytes.
[in]byteRangeThe range, expressed in bytes.
[in]dstArrayElementThe array element index.

◆ makeDescriptorWrite() [5/8]

static C3D_API ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::ImageView const &  view,
ashes::Sampler const &  sampler,
uint32_t  dstBinding,
uint32_t  dstArrayElement = 0u 
)
static

Creates a descriptor write for combined image sampler.

Parameters
[in]viewThe image view.
[in]samplerThe sampler.
[in]dstBindingThe binding inside the descriptor set.
[in]dstArrayElementThe array element index.

◆ makeDescriptorWrite() [6/8]

static C3D_API ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( ashes::UniformBuffer const &  buffer,
uint32_t  dstBinding,
uint32_t  elemOffset,
uint32_t  elemRange,
uint32_t  dstArrayElement = 0u 
)
static

Creates a descriptor write for uniform buffer.

Parameters
[in]bufferThe uniform buffer.
[in]dstBindingThe binding inside the descriptor set.
[in]elemOffsetThe offset, expressed in element count.
[in]elemRangeThe range, expressed in element count.
[in]dstArrayElementThe array element index.

◆ makeDescriptorWrite() [7/8]

template<typename DataT >
static ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( UniformBufferOffsetT< DataT > const &  buffer,
uint32_t  dstBinding,
uint32_t  dstArrayElement = 0u 
)
inlinestatic

Creates a descriptor write for uniform buffer range.

Parameters
[in]bufferThe uniform buffer range.
[in]dstBindingThe binding inside the descriptor set.
[in]dstArrayElementThe array element index.

References castor3d::UniformBufferOffsetT< DataT >::getDescriptorWrite().

Here is the call graph for this function:

◆ makeDescriptorWrite() [8/8]

static C3D_API ashes::WriteDescriptorSet castor3d::RenderQuad::makeDescriptorWrite ( VkImageView const &  view,
VkSampler const &  sampler,
uint32_t  dstBinding,
uint32_t  dstArrayElement = 0u 
)
static

Creates a descriptor write for combined image sampler.

Parameters
[in]viewThe image view.
[in]samplerThe sampler.
[in]dstBindingThe binding inside the descriptor set.
[in]dstArrayElementThe array element index.

Referenced by makeDescriptorWrite().

Here is the caller graph for this function:

◆ registerPass() [1/2]

void castor3d::RenderQuad::registerPass ( ashes::CommandBuffer &  commandBuffer) const
inline

Prpares the commands to render the quad, inside given command buffer.

Parameters
[in,out]commandBufferThe command buffer.

References registerPass().

Here is the call graph for this function:

◆ registerPass() [2/2]

C3D_API void castor3d::RenderQuad::registerPass ( ashes::CommandBuffer &  commandBuffer,
uint32_t  descriptorSetIndex 
) const

Prpares the commands to render the quad, inside given command buffer.

Parameters
[in,out]commandBufferThe command buffer.
[in]descriptorSetIndexThe render descriptor set index.

Referenced by registerPass().

Here is the caller graph for this function:

◆ registerPassInputs()

C3D_API void castor3d::RenderQuad::registerPassInputs ( ashes::WriteDescriptorSetArray const &  writes,
bool  invertY = false 
)

Creates the entries for one pass.

Parameters
[in]writesThe pass descriptor writes.
[in]invertYtrue to Y invert the sampled image.

Friends And Related Function Documentation

◆ RenderQuadBuilderT

template<typename ConfigT , typename BuilderT >
friend class RenderQuadBuilderT
friend

Member Data Documentation

◆ m_config

rq::ConfigData castor3d::RenderQuad::m_config
protected

◆ m_device

RenderDevice const& castor3d::RenderQuad::m_device
protected

Referenced by getDevice().

◆ m_renderSystem

RenderSystem& castor3d::RenderQuad::m_renderSystem
protected

Referenced by getRenderSystem().

◆ m_sampler

SamplerResPtr castor3d::RenderQuad::m_sampler
protected

Referenced by getSampler().


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