API Documentation
Public Member Functions | List of all members
nkGraphics::ConstantBuffer Class Referenceabstract

Describes a constant buffer. More...

Inheritance diagram for nkGraphics::ConstantBuffer:
nkExport::Exportable

Public Member Functions

 ConstantBuffer ()
 
virtual ~ConstantBuffer ()
 
ShaderPassMemorySlotgetPassMemorySlot (unsigned int index)
 
ShaderPassMemorySlotgetPassMemorySlotReadOnly (unsigned int index) const
 
ShaderPassMemorySlotaddPassMemorySlot ()
 
void changePassMemorySlotOrder (unsigned int fromIndex, unsigned int toIndex)
 
void deletePassMemorySlot (unsigned int index)
 
virtual void checkBuffer ()=0
 
virtual void fillBuffer ()=0
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable () noexcept
 
virtual ~Exportable ()
 

Detailed Description

Describes a constant buffer.

Constructor & Destructor Documentation

◆ ConstantBuffer()

nkGraphics::ConstantBuffer::ConstantBuffer ( )

Constructor. See Shader::addConstantBuffer().

◆ ~ConstantBuffer()

virtual nkGraphics::ConstantBuffer::~ConstantBuffer ( )
virtual

Destructor.

Member Function Documentation

◆ getPassMemorySlot()

ShaderPassMemorySlot* nkGraphics::ConstantBuffer::getPassMemorySlot ( unsigned int  index)
Parameters
indexThe index of the slot to retrieve.
Returns
The slot requested if available, nullptr else.

◆ getPassMemorySlotReadOnly()

ShaderPassMemorySlot* nkGraphics::ConstantBuffer::getPassMemorySlotReadOnly ( unsigned int  index) const

The read only version of the getter. Use this version when possible, as this avoid a dirtification of the tracking data.

Parameters
indexThe index of the slot to retrieve.
Returns
The slot requested if available, nullptr else.

◆ addPassMemorySlot()

ShaderPassMemorySlot* nkGraphics::ConstantBuffer::addPassMemorySlot ( )

Adds a pass memory slot. Memory slots are fed sequentially, in the order they are declared. Be sure to align all structures within shaders to be coherent with the way the data is fed.

Returns
A freshly allocated memory slot. The buffer is responsible for the memory returned, external code should not delete it. See deletePassMemorySlot().

◆ changePassMemorySlotOrder()

void nkGraphics::ConstantBuffer::changePassMemorySlotOrder ( unsigned int  fromIndex,
unsigned int  toIndex 
)

Changes the ordering in the slots, impacting the way they are fed to the buffer.

Parameters
fromIndexThe index of the slot to change.
toIndexThe index to which the slot should be moved.

◆ deletePassMemorySlot()

void nkGraphics::ConstantBuffer::deletePassMemorySlot ( unsigned int  index)

Erases and frees a slot.

Parameters
indexThe index of the slot to erase.

◆ checkBuffer()

virtual void nkGraphics::ConstantBuffer::checkBuffer ( )
pure virtual

Used internally for update purpose.

◆ fillBuffer()

virtual void nkGraphics::ConstantBuffer::fillBuffer ( )
pure virtual

Used internally for update purpose.

◆ exportClassToTree()

virtual void nkGraphics::ConstantBuffer::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Basic exporting capabilities.

Parameters
rootNodeThe tree to export to.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::ConstantBuffer::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Basic importing capabilities.

Parameters
rootNodeThe tree to import from.

Implements nkExport::Exportable.


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