Inheritance Graph
graph BT
ResourceFormat
VertexDescription --> ResourceFormat
click ResourceFormat "classUtil_1_1ResourceFormat"
click VertexDescription "classRendering_1_1VertexDescription"
Description
ResourceFormat
Public Types
Public Functions
|
|
|
|
|
ResourceFormat(size_t _attributeAlignment) |
|
|
|
~ResourceFormat() |
|
|
const Attribute & |
appendAttribute(const StringIdentifier & nameId, TypeConstant type, uint32_t numValues, bool normalized, uint32_t internalType) |
|
|
const Attribute & |
_appendAttribute(const StringIdentifier & nameId, TypeConstant type, uint32_t numValues, bool normalized, uint32_t internalType, size_t offset) directly appends the attribute without recalculating offsets |
|
|
const Attribute & |
appendFloat(const Util::StringIdentifier & nameId, uint32_t numValues, bool normalized) Add an attribute with the given name and the given number of float values. |
|
|
const Attribute & |
appendUInt(const Util::StringIdentifier & nameId, uint32_t numValues) Add an attribute with the given name and the given number of unsigned int values. |
|
|
const Attribute & |
appendInt(const Util::StringIdentifier & nameId, uint32_t numValues) Add an attribute with the given name and the given number of int values. |
|
|
const Attribute & |
getAttribute(const StringIdentifier & nameId) const |
|
|
const Attribute & |
getAttribute(const std::string & name) const |
|
|
const Attribute & |
getAttribute(uint32_t location) const |
|
|
bool |
hasAttribute(const StringIdentifier & nameId) const |
|
|
bool |
hasAttribute(const std::string & name) const |
|
|
const uint32_t |
getAttributeLocation(const StringIdentifier & nameId) const Returns the location index of the attribute within the the resource format. |
|
|
const uint32_t |
getAttributeLocation(const std::string & name) const |
|
|
void |
updateAttribute(const Attribute & attr) |
|
|
void |
merge(const ResourceFormat & other) Merges this resource format with another. |
|
|
uint32_t |
getNumAttributes() const Returns the number of attributes. |
|
|
const AttributeContainer_t & |
getAttributes() const |
|
|
void |
setSize(size_t value) |
|
|
size_t |
getSize() const |
|
|
size_t |
getAlignment() const |
|
|
std::string |
toString(bool formatted) const |
|
|
bool |
operator==(const ResourceFormat & other) const |
|
|
bool |
operator!=(const ResourceFormat & other) const |
|
|
bool |
operator<(const ResourceFormat & other) const |
Documentation
Defined in Util/Resources/ResourceFormat.h:31
Defined in Util/Resources/ResourceFormat.h:32
Defined in Util/Resources/ResourceFormat.h:34
Defined in Util/Resources/ResourceFormat.h:35
Create and add a new attribute to the ResourceFormat .
Parameters
- nameId
- The name of the attribute.
- type
- The base type of the attribute.
- numValue
- The number of channels the attribute has (e.g., 3 for RGB)
- normalized
- Specifies that the underlying type is automatically converted to/from float value in the range [-1.0,1.0] or [0.0,1.0]
- internalType
- User defined internal type id (e.g., for compressed data).
Returns
the new attribute
Note: the owner of the attribute is the ResourceFormat
Note: Before using this function, check a default method can be used instead (e.g.appendFloat
)
Note: WheninternalType
is set, thetype
andnumValues
are still used for size calculation, e.g., if a R10G10B10A2 attribute is packed into a single 32 bit integer, the numValues should be 1.
Defined in Util/Resources/ResourceFormat.h:49
directly appends the attribute without recalculating offsets
Defined in Util/Resources/ResourceFormat.h:52
Add an attribute with the given name and the given number of float values.
Defined in Util/Resources/ResourceFormat.h:55
Add an attribute with the given name and the given number of unsigned int values.
Defined in Util/Resources/ResourceFormat.h:60
Add an attribute with the given name and the given number of int values.
Defined in Util/Resources/ResourceFormat.h:65
Get a reference to the attribute with the corresponding name.
Returns
Always returns an attribute. If the attribute is not present in the vertex description, it is empty.
Note: The owner of the attribute is the ResourceFormat , so be careful if the ResourceFormat is deleted or reassigned.
Defined in Util/Resources/ResourceFormat.h:74
Defined in Util/Resources/ResourceFormat.h:75
Defined in Util/Resources/ResourceFormat.h:78
Defined in Util/Resources/ResourceFormat.h:82
Defined in Util/Resources/ResourceFormat.h:83
Returns the location index of the attribute within the the resource format.
Defined in Util/Resources/ResourceFormat.h:88
Defined in Util/Resources/ResourceFormat.h:89
Update an existing attribute of or append a new attribute to the ResourceFormat .
Parameters
- attr
- Attribute that contains the new data.
- recalculateOffsets
- If
true
, the offsets of all attributes will be recalculated (The size will be recalculated either way).
Warning: When manually setting the offsets, make sure that they fit within the sizes and offsets of the other attributes. Otherwise, unpredictable side effects can occur.
Defined in Util/Resources/ResourceFormat.h:101
Merges this resource format with another.
Defined in Util/Resources/ResourceFormat.h:104
Returns the number of attributes.
Defined in Util/Resources/ResourceFormat.h:107
Defined in Util/Resources/ResourceFormat.h:108
Forcefully set the size of the resource format. This can be useful when requiring specific alignments.
Note: When adding/updating an attribute, the size gets recalculated.
Parameters
- value
- The size.
Defined in Util/Resources/ResourceFormat.h:117
Defined in Util/Resources/ResourceFormat.h:118
Defined in Util/Resources/ResourceFormat.h:120
|
|
|
|
|
|
std::string toString( |
bool |
formatted ) const |
Defined in Util/Resources/ResourceFormat.h:122
Defined in Util/Resources/ResourceFormat.h:123
Defined in Util/Resources/ResourceFormat.h:124
Defined in Util/Resources/ResourceFormat.h:125