#include <structfillpolicy.h>
Classes | |
class | BaseEntry |
class | Entry |
Public Member Functions | |
bool | fill (StructBufferDescriptor *descriptor, uint8 *data, utility::ErrorState &errorState) |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
std::vector< rtti::ObjectPtr< BaseEntry > > | mFillPolicies |
Property 'FillPolicies': List of shader variable fill policy entries. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Member Functions | |
bool | fillFromUniformRecursive (const UniformStruct *uniformStruct, uint8 *data, size_t &outElementSize, utility::ErrorState &errorState) |
template<typename T > | |
const FillPolicy< T > * | findPolicy (const std::string &name) |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Fill policy for struct buffers.
Fill policies are initialization utilities that can help fill large blocks of preallocated memory. The fill function assigns a contiguous block of data based on the specified arguments.
StructFillPolicy internally uses TypedFillPolicyNumeric mapped to member names to determine how to fill the struct buffer. The behavior of this fill policy is created in configuration using a set of variable fill policy entries. Each entry maps a struct member name to a fill policy. The fill() function is then able to fill the buffer it is bound to automatically.
Fill policies can be bound to another resource's property (i.e. StructGPUBuffer) in configuration. Typically, an object will first check if a policy is available, and if so, use it to fill an internal buffer. Any object accepting a fill policy is free to implement the way fill() is used in their own way however.
bool fill | ( | StructBufferDescriptor * | descriptor, |
uint8 * | data, | ||
utility::ErrorState & | errorState | ||
) |
Fills a preallocated buffer using the specified struct buffer descriptor.
descriptor | buffer fill description handle |
data | pointer to the preallocated data |
errorState | contains the error if the buffer cannot be filled |
|
protected |
Recursively fills the buffer based on the specified uniform struct.
uniformStruct | the reference uniform used to determine the memory locations to fill |
data | pointer to the preallocated data |
outElementSize | the size of the specified uniform struct in bytes |
errorState | contains the error if the buffer cannot be filled |
|
protected |
Returns a fill policy for the given member name if it is specified in the variable fill policies property, otherwise returns nullptr.
name | the name of the member to apply the associated fill policy on |
std::vector<rtti::ObjectPtr<BaseEntry> > mFillPolicies |
Property 'FillPolicies': List of shader variable fill policy entries.