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

#include <ShaderBuffer.hpp>

Public Member Functions

C3D_API ShaderBuffer (RenderDevice const &device, VkDeviceSize size, castor::String const &name, crg::AccessState wantedState={ VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT })
 Constructor.
 
C3D_API void upload (UploadData &uploader) const
 Updates the buffer.
 
C3D_API void upload (UploadData &uploader, VkDeviceSize offset, VkDeviceSize size) const
 Updates the buffer on GPU.
 
C3D_API VkDescriptorSetLayoutBinding createLayoutBinding (uint32_t index=0u, VkShaderStageFlags stages=(VK_SHADER_STAGE_FRAGMENT_BIT|VK_SHADER_STAGE_GEOMETRY_BIT|VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT|VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT|VK_SHADER_STAGE_VERTEX_BIT)) const
 Creates the descriptor set layout binding at given point.
 
C3D_API void createPassBinding (crg::FramePass &pass, uint32_t binding) const
 Creates a frame pass binding.
 
C3D_API ashes::WriteDescriptorSet getSingleBinding (uint32_t binding, VkDeviceSize offset, VkDeviceSize size) const
 Creates the descriptor write for this buffer.
 
C3D_API ashes::WriteDescriptorSet getBinding (uint32_t binding) const
 Creates the descriptor write for this buffer.
 
C3D_API void createBinding (ashes::DescriptorSet &descriptorSet, VkDescriptorSetLayoutBinding const &binding) const
 Creates the descriptor set binding at given point.
 
uint8_t * getPtr () const noexcept
 
VkDeviceSize getSize () const noexcept
 
RenderDevice const & getDevice () const noexcept
 
ashes::BufferBase const & getBuffer () const noexcept
 
void setFirstCount (uint32_t value) noexcept
 
void setSecondCount (uint32_t value) noexcept
 
void setThirdCount (uint32_t value) noexcept
 
void setFourthCount (uint32_t value) noexcept
 
void setCount (uint32_t value) noexcept
 

Constructor & Destructor Documentation

◆ ShaderBuffer()

C3D_API castor3d::ShaderBuffer::ShaderBuffer ( RenderDevice const & device,
VkDeviceSize size,
castor::String const & name,
crg::AccessState wantedState = { VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT } )

Constructor.

Parameters
[in]deviceThe GPU device.
[in]sizeThe buffer size.
[in]nameThe shader buffer name.
[in]wantedStateThe wanted state, after upload.

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,
VkShaderStageFlags stages = (VK_SHADER_STAGE_FRAGMENT_BIT|VK_SHADER_STAGE_GEOMETRY_BIT|VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT|VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT|VK_SHADER_STAGE_VERTEX_BIT) ) const

Creates the descriptor set layout binding at given point.

Parameters
[in]indexThe binding point index.
[in]stagesThe shader stages.

◆ createPassBinding()

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

Creates a frame pass binding.

◆ getBinding()

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.

◆ getBuffer()

ashes::BufferBase const & castor3d::ShaderBuffer::getBuffer ( ) const
inlinenoexcept

Referenced by castor3d::FontGlyphBuffer::getBuffer().

Here is the caller graph for this function:

◆ getDevice()

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

◆ getPtr()

uint8_t * castor3d::ShaderBuffer::getPtr ( ) const
inlinenoexcept

◆ getSingleBinding()

C3D_API ashes::WriteDescriptorSet castor3d::ShaderBuffer::getSingleBinding ( 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.

◆ getSize()

VkDeviceSize castor3d::ShaderBuffer::getSize ( ) const
inlinenoexcept

◆ setCount()

void castor3d::ShaderBuffer::setCount ( uint32_t value)
inlinenoexcept

References setFirstCount().

Here is the call graph for this function:

◆ setFirstCount()

void castor3d::ShaderBuffer::setFirstCount ( uint32_t value)
inlinenoexcept

name Mutators.

Referenced by setCount().

Here is the caller graph for this function:

◆ setFourthCount()

void castor3d::ShaderBuffer::setFourthCount ( uint32_t value)
inlinenoexcept

Referenced by castor3d::FontGlyphBuffer::setImgHeight().

Here is the caller graph for this function:

◆ setSecondCount()

void castor3d::ShaderBuffer::setSecondCount ( uint32_t value)
inlinenoexcept

Referenced by castor3d::FontGlyphBuffer::setMaxHeight().

Here is the caller graph for this function:

◆ setThirdCount()

void castor3d::ShaderBuffer::setThirdCount ( uint32_t value)
inlinenoexcept

Referenced by castor3d::FontGlyphBuffer::setImgWidth().

Here is the caller graph for this function:

◆ upload() [1/2]

C3D_API void castor3d::ShaderBuffer::upload ( UploadData & uploader) const

Updates the buffer.

Parameters
[in,out]uploaderReceives the upload requests.

◆ upload() [2/2]

C3D_API void castor3d::ShaderBuffer::upload ( UploadData & uploader,
VkDeviceSize offset,
VkDeviceSize size ) const

Updates the buffer on GPU.

Parameters
[in,out]uploaderReceives the upload requests.
[in]offset,sizeThe updated range.

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