Overte C++ Documentation
gpu::Stream::Format Class Reference

Stream Format is describing how to feed a list of attributes from a bunch of stream buffer channels. More...

#include <Stream.h>

Collaboration diagram for gpu::Stream::Format:

Classes

class  ChannelInfo
 Contains information about single channel. More...
 

Public Member Functions

size_t getNumAttributes () const
 
const AttributeMap & getAttributes () const
 
size_t getNumChannels () const
 
const ChannelMap & getChannels () const
 
Offset getChannelStride (Slot channel) const
 
size_t getElementTotalSize () const
 
bool setAttribute (Slot slot, Slot channel, Element element, Offset offset=0, Frequency frequency=PER_VERTEX)
 Sets attribute in a format. More...
 
bool hasAttribute (Slot slot) const
 
Attribute getAttribute (Slot slot) const
 
const std::string & getKey () const
 

Public Attributes

const GPUObjectPointer gpuObject {}
 GPU backend-specific object representing format.
 

Protected Member Functions

void evaluateCache ()
 

Protected Attributes

AttributeMap _attributes
 Attributes mapped to slots.
 
ChannelMap _channels
 Channels mapped to binding indices.
 
uint32 _elementTotalSize { 0 }
 Sum of the size of all attributes in bytes.
 
std::string _key
 String uniquely describing a format. Automatically updated when adding attributes.
 

Detailed Description

Stream Format is describing how to feed a list of attributes from a bunch of stream buffer channels.

Member Function Documentation

◆ evaluateCache()

void Stream::Format::evaluateCache ( )
protected

Updates key, channel map and total size. Automatically called when adding attributes.

◆ getAttribute()

Stream::Attribute Stream::Format::getAttribute ( Slot  slot) const

Attribute object with default constructor if there's no attribute at the given slot.

Parameters
slotSlot index to get attribute from.
Returns
Attribute at a given slot.

◆ getAttributes()

const AttributeMap& gpu::Stream::Format::getAttributes ( ) const
inline
Returns
Attributes mapped to slots.

◆ getChannels()

const ChannelMap& gpu::Stream::Format::getChannels ( ) const
inline
Returns
Channels this format.

◆ getChannelStride()

Offset gpu::Stream::Format::getChannelStride ( Slot  channel) const
inline
Parameters
channelBinding number for a given data source.
Returns
Stride for a channel in a given binding location.

◆ getElementTotalSize()

size_t gpu::Stream::Format::getElementTotalSize ( ) const
inline
Returns

◆ getKey()

const std::string& gpu::Stream::Format::getKey ( ) const
inline
Returns
Gets a string uniquely representing this format.

◆ getNumAttributes()

size_t gpu::Stream::Format::getNumAttributes ( ) const
inline
Returns
Number of attributes for this format.

◆ getNumChannels()

size_t gpu::Stream::Format::getNumChannels ( ) const
inline
Returns
Number of channels for this format.

◆ hasAttribute()

bool gpu::Stream::Format::hasAttribute ( Slot  slot) const
inline
Parameters
slotSlot index to check.
Returns
Returns true if there's an attribute on a given slot.

◆ setAttribute()

bool Stream::Format::setAttribute ( Slot  slot,
Slot  channel,
Element  element,
Offset  offset = 0,
Frequency  frequency = PER_VERTEX 
)

Sets attribute in a format.

After adding attribute calls evaluateCache() to update channels map.

Parameters
slotSlot at which data will be available to the shader.
channelBinding number for a given data source.
elementObject containing information about the element type of this attribute.
offsetOffset in bytes for the given element.
frequencyHow often data position is incremented. Must be the same for entire channel.
Returns
Always returns true currently.

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