#include <bufferbinding.h>
Public Member Functions | |
| virtual bool | init (utility::ErrorState &errorState) override |
| virtual int | getCount () const |
| virtual size_t | getSize () const |
| virtual size_t | getElementSize () const |
| const GPUBuffer * | getBuffer () const |
Public Member Functions inherited from Resource | |
| Resource () | |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| virtual void | onDestroy () |
| Object (Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&)=delete | |
| Object & | operator= (Object &&)=delete |
Public Attributes | |
| std::string | mName |
| Property: 'Name' name of buffer binding uniform in shader. More... | |
Public Attributes inherited from Object | |
| std::string | mID |
| Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Attributes | |
| const GPUBuffer * | mBuffer = nullptr |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Buffer Binding resource base class.
Buffer bindings, unlike uniforms, store a reference to the underlying data as opposed to the data itself. This allows for any compute shader to read from and write to the same data storage. Buffer bindings always refer to a single nap::GPUBuffer, whether this is simple a nap::VertexBufferVec4 or a more complex nap::StructGPUBuffer.
A single vec4 array can be addressed as a nap::VertexBufferVec4:
If you intend to pack some data types together, you can do so with a nap::StructGPUBuffer:
Declaring multiple shader variables outside of a struct is currently not supported:
| const GPUBuffer* getBuffer | ( | ) | const |
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
Ensures the buffer is set.
| errorState | contains the error if the binding can't be initialized |
Reimplemented from Object.
Reimplemented in BufferBindingStruct, BufferBindingNumeric, and TypedBufferBindingNumeric< T >.
|
protected |
| std::string mName |
Property: 'Name' name of buffer binding uniform in shader.