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

#include <LightBuffer.hpp>

Public Types

using LightsData = castor::ArrayView< castor::Point4f >
 

Public Member Functions

C3D_API LightBuffer (Engine &engine, RenderDevice const &device, uint32_t count)
 Constructor.
 
C3D_API void addLight (Light &light)
 Adds a light source to the buffer.
 
C3D_API void removeLight (Light &light)
 Removes a light source from the buffer.
 
C3D_API void update (CpuUpdater &updater)
 Updates the buffer CPU wise.
 
C3D_API void upload (UploadData &uploader)
 Uploads the buffer to VRAM.
 
C3D_API VkDescriptorSetLayoutBinding createLayoutBinding (VkShaderStageFlags stages, uint32_t binding) const
 Creates the descriptor set layout binding.
 
C3D_API void createPassBinding (crg::FramePass &pass, uint32_t binding) const
 Creates a frame pass binding.
 
C3D_API ashes::WriteDescriptorSet getBinding (uint32_t binding) const
 Creates the descriptor write for this buffer.
 
C3D_API ashes::WriteDescriptorSet getSingleBinding (uint32_t binding, VkDeviceSize offset, VkDeviceSize size) 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.
 
C3D_API uint32_t getLightsBufferCount (LightType type) const noexcept
 
uint8_t * getPtr ()
 
LightsArray getLights (LightType type) const
 

Member Typedef Documentation

◆ LightsData

Constructor & Destructor Documentation

◆ LightBuffer()

C3D_API castor3d::LightBuffer::LightBuffer ( Engine & engine,
RenderDevice const & device,
uint32_t count )

Constructor.

Parameters
[in]engineThe engine.
[in]deviceThe GPU device.
[in]countThe max passes count.

Member Function Documentation

◆ addLight()

C3D_API void castor3d::LightBuffer::addLight ( Light & light)

Adds a light source to the buffer.

Parameters
[in]lightThe light source.

◆ createBinding()

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

Creates the descriptor set binding at given point.

Parameters
[in]descriptorSetThe descriptor set that receives the binding.
[in]bindingThe descriptor set layout binding.

◆ createLayoutBinding()

C3D_API VkDescriptorSetLayoutBinding castor3d::LightBuffer::createLayoutBinding ( VkShaderStageFlags stages,
uint32_t binding ) const

Creates the descriptor set layout binding.

◆ createPassBinding()

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

Creates a frame pass binding.

◆ getBinding()

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

Creates the descriptor write for this buffer.

◆ getLights()

LightsArray castor3d::LightBuffer::getLights ( LightType type) const
inline

◆ getLightsBufferCount()

C3D_API uint32_t castor3d::LightBuffer::getLightsBufferCount ( LightType type) const
noexcept
Parameters
[in]typeThe light type.
Returns
The number of light sources of the given type, in the buffer.

◆ getPtr()

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

References castor3d::ShaderBuffer::getPtr().

Here is the call graph for this function:

◆ getSingleBinding()

C3D_API ashes::WriteDescriptorSet castor3d::LightBuffer::getSingleBinding ( uint32_t binding,
VkDeviceSize offset,
VkDeviceSize size ) const

Creates the descriptor write for this buffer.

◆ removeLight()

C3D_API void castor3d::LightBuffer::removeLight ( Light & light)

Removes a light source from the buffer.

Parameters
[in]lightThe light source.

◆ update()

C3D_API void castor3d::LightBuffer::update ( CpuUpdater & updater)

Updates the buffer CPU wise.

Parameters
[in,out]updaterThe update data.

◆ upload()

C3D_API void castor3d::LightBuffer::upload ( UploadData & uploader)

Uploads the buffer to VRAM.

Parameters
[in,out]uploaderReceives the upload requests.

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