Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::ShaderBuffer Class Reference

#include <ShaderBuffer.hpp>

Public Member Functions

C3D_API ShaderBuffer (Engine &engine, RenderDevice const &device, uint32_t size, castor::String name, VkFormat tboFormat=VK_FORMAT_R32G32B32A32_SFLOAT)
 Constructor. More...
 
C3D_API void upload (ashes::CommandBuffer const &commandBuffer) const
 Updates the buffer. More...
 
C3D_API void upload (ashes::CommandBuffer const &commandBuffer, VkDeviceSize offset, VkDeviceSize size) const
 Updates the buffer on GPU. More...
 
C3D_API VkDescriptorSetLayoutBinding createLayoutBinding (uint32_t index=0u) const
 Creates the descriptor set layout binding at given point. More...
 
C3D_API void createPassBinding (crg::FramePass &pass, castor::String const &name, uint32_t binding) const
 Creates a frame pass binding. More...
 
C3D_API ashes::WriteDescriptorSet getBinding (uint32_t binding, VkDeviceSize offset, VkDeviceSize size) const
 Creates the descriptor write for this buffer. More...
 
C3D_API ashes::WriteDescriptorSet getBinding (uint32_t binding) const
 Creates the descriptor write for this buffer. More...
 
C3D_API void createBinding (ashes::DescriptorSet &descriptorSet, VkDescriptorSetLayoutBinding const &binding) const
 Creates the descriptor set binding at given point. More...
 
uint8_t * getPtr ()
 
VkDeviceSize getSize ()
 
VkDescriptorType getType () const
 
RenderDevice const & getDevice () const
 

Constructor & Destructor Documentation

◆ ShaderBuffer()

C3D_API castor3d::ShaderBuffer::ShaderBuffer ( Engine engine,
RenderDevice const &  device,
uint32_t  size,
castor::String  name,
VkFormat  tboFormat = VK_FORMAT_R32G32B32A32_SFLOAT 
)

Constructor.

Parameters
[in]engineThe engine.
[in]deviceThe GPU device.
[in]sizeThe buffer size.
[in]nameThe shader buffer name.
[in]tboFormatThe format wanted for the TBO.

Member Function Documentation

◆ createBinding()

C3D_API void castor3d::ShaderBuffer::createBinding ( ashes::DescriptorSet &  descriptorSet,
VkDescriptorSetLayoutBinding const &  binding 
) const

Creates the descriptor set binding at given point.

Parameters
[in,out]descriptorSetReceives the created binding.
[in]bindingThe descriptor set layout binding.

◆ createLayoutBinding()

C3D_API VkDescriptorSetLayoutBinding castor3d::ShaderBuffer::createLayoutBinding ( uint32_t  index = 0u) const

Creates the descriptor set layout binding at given point.

Parameters
[in]indexThe binding point index.

◆ createPassBinding()

C3D_API void castor3d::ShaderBuffer::createPassBinding ( crg::FramePass &  pass,
castor::String const &  name,
uint32_t  binding 
) const

Creates a frame pass binding.

◆ getBinding() [1/2]

C3D_API ashes::WriteDescriptorSet castor3d::ShaderBuffer::getBinding ( uint32_t  binding) const

Creates the descriptor write for this buffer.

Parameters
[in]bindingThe descriptor set layout binding.

◆ getBinding() [2/2]

C3D_API ashes::WriteDescriptorSet castor3d::ShaderBuffer::getBinding ( uint32_t  binding,
VkDeviceSize  offset,
VkDeviceSize  size 
) const

Creates the descriptor write for this buffer.

Parameters
[in]bindingThe descriptor set layout binding.
[in]offset,sizeThe updated range.

◆ getDevice()

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

◆ getPtr()

uint8_t * castor3d::ShaderBuffer::getPtr ( )
inline

◆ getSize()

VkDeviceSize castor3d::ShaderBuffer::getSize ( )
inline

◆ getType()

VkDescriptorType castor3d::ShaderBuffer::getType ( ) const
inline

Referenced by castor3d::LightBuffer::getType(), castor3d::PassBuffer::getType(), and castor3d::SssProfileBuffer::getType().

Here is the caller graph for this function:

◆ upload() [1/2]

C3D_API void castor3d::ShaderBuffer::upload ( ashes::CommandBuffer const &  commandBuffer) const

Updates the buffer.

Parameters
[in]commandBufferThe command buffer receiving upload commands.

◆ upload() [2/2]

C3D_API void castor3d::ShaderBuffer::upload ( ashes::CommandBuffer const &  commandBuffer,
VkDeviceSize  offset,
VkDeviceSize  size 
) const

Updates the buffer on GPU.

Parameters
[in]commandBufferThe command buffer receiving upload commands.
[in]offset,sizeThe updated range.

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