![]() |
Castor3D 0.12.0
Multiplatform 3D engine
|
#include <RenderQuad.hpp>
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... | |
RenderSystem * | getRenderSystem () 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 | |
RenderSystem & | m_renderSystem |
RenderDevice const & | m_device |
SamplerResPtr | m_sampler |
rq::ConfigData | m_config |
Friends | |
template<typename ConfigT , typename BuilderT > | |
class | RenderQuadBuilderT |
|
protected |
Constructor.
[in] | device | The RenderDevice. |
[in] | name | The pass name. |
[in] | samplerFilter | The sampler filter for the source texture. |
[in] | config | The configuration. |
|
virtual |
|
explicitnoexcept |
C3D_API void castor3d::RenderQuad::cleanup | ( | ) |
Cleans up GPU objects.
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.
[in] | size | The render size. |
[in] | position | The render position. |
[in] | program | The shader program. |
[in] | renderPass | The render pass to use. |
[in] | pushRanges | The push constant ranges. |
[in] | dsState | The depth and stencil state. |
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.
[in] | size | The render size. |
[in] | position | The render position. |
[in] | program | The shader program. |
[in] | renderPass | The render pass to use. |
[in] | writes | The pass descriptor writes. |
[in] | pushRanges | The push constant ranges. |
[in] | dsState | The depth stencil state to use. |
|
inline |
References m_device.
|
inline |
References m_renderSystem.
C3D_API void castor3d::RenderQuad::initialisePasses | ( | ) |
Initialises the descriptor sets for all registered passes.
|
inlinestatic |
Creates a descriptor write for buffer texel view.
[in] | buffer | The buffer. |
[in] | view | The texel view. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | dstArrayElement | The array element index. |
References makeDescriptorWrite().
|
inlinestatic |
Creates a descriptor write for storage buffer.
[in] | storageBuffer | The storage buffer. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | elemOffset | The offset, expressed in element count. |
[in] | elemRange | The range, expressed in element count. |
[in] | dstArrayElement | The array element index. |
References makeDescriptorWrite().
|
static |
Creates a descriptor write for buffer texel view.
[in] | buffer | The buffer. |
[in] | view | The texel view. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | dstArrayElement | The array element index. |
|
static |
Creates a descriptor write for storage buffer.
[in] | storageBuffer | The storage buffer. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | byteOffset | The offset, expressed in bytes. |
[in] | byteRange | The range, expressed in bytes. |
[in] | dstArrayElement | The array element index. |
|
static |
Creates a descriptor write for combined image sampler.
[in] | view | The image view. |
[in] | sampler | The sampler. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | dstArrayElement | The array element index. |
|
static |
Creates a descriptor write for uniform buffer.
[in] | buffer | The uniform buffer. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | elemOffset | The offset, expressed in element count. |
[in] | elemRange | The range, expressed in element count. |
[in] | dstArrayElement | The array element index. |
|
inlinestatic |
Creates a descriptor write for uniform buffer range.
[in] | buffer | The uniform buffer range. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | dstArrayElement | The array element index. |
References castor3d::UniformBufferOffsetT< DataT >::getDescriptorWrite().
|
static |
Creates a descriptor write for combined image sampler.
[in] | view | The image view. |
[in] | sampler | The sampler. |
[in] | dstBinding | The binding inside the descriptor set. |
[in] | dstArrayElement | The array element index. |
Referenced by makeDescriptorWrite().
|
inline |
Prpares the commands to render the quad, inside given command buffer.
[in,out] | commandBuffer | The command buffer. |
References registerPass().
C3D_API void castor3d::RenderQuad::registerPass | ( | ashes::CommandBuffer & | commandBuffer, |
uint32_t | descriptorSetIndex | ||
) | const |
Prpares the commands to render the quad, inside given command buffer.
[in,out] | commandBuffer | The command buffer. |
[in] | descriptorSetIndex | The render descriptor set index. |
Referenced by registerPass().
C3D_API void castor3d::RenderQuad::registerPassInputs | ( | ashes::WriteDescriptorSetArray const & | writes, |
bool | invertY = false |
||
) |
Creates the entries for one pass.
[in] | writes | The pass descriptor writes. |
[in] | invertY | true to Y invert the sampled image. |
|
friend |
|
protected |
|
protected |
Referenced by getDevice().
|
protected |
Referenced by getRenderSystem().
|
protected |
Referenced by getSampler().