Used to store vertex and index data data. More...
Inherits Buffer.
Public Member Functions | |
Constructor, Destructor and Initializers | |
| BufferMTL (id< MTLDevice > mtlDevice, std::size_t size, BufferType type, BufferUsage usage) | |
| BufferMTL constructor. More... | |
| ~BufferMTL () | |
Update Buffer | |
| virtual void | updateData (void *data, std::size_t size) override |
| Update buffer data. More... | |
| virtual void | updateSubData (void *data, std::size_t offset, std::size_t size) override |
| Update buffer sub-region data. More... | |
| virtual void | usingDefaultStoredData (bool needDefaultStoredData) override |
| Emply implementation. More... | |
Public Member Functions inherited from Buffer | |
| std::size_t | getSize () const |
| Get buffer size in bytes. More... | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| void | release () |
| Releases the ownership immediately. More... | |
| Ref * | autorelease () |
| Releases the ownership sometime soon automatically. More... | |
| unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. More... | |
Setters & Getters | |
| id< MTLBuffer > | getMTLBuffer () const |
| void | beginFrame () |
| a triple buffering Will switch to next buffer and use the buffer in the following render pass in current frame. | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID | |
| int | _luaID |
| Lua reference id. | |
| void * | _scriptObject |
| scriptObject, support for swift | |
| bool | _rooted |
| When true, it means that the object was already rooted. | |
Used to store vertex and index data data.
Dynamic buffer data refers to frequently updated data stored in a buffer. To avoid creating new buffers per frame and to minimize processor idle time between frames, implement a triple buffering model to update dynamic buffer.
| BufferMTL | ( | id< MTLDevice > | mtlDevice, |
| std::size_t | size, | ||
| BufferType | type, | ||
| BufferUsage | usage | ||
| ) |
BufferMTL constructor.
| mtlDevice | The device for which MTLBuffer object was created. |
| size | Specifies the size in bytes of the buffer object's new data store. |
| type | Specifies the target buffer object. The symbolic constant must be BufferType::VERTEX or BufferType::INDEX. |
| usage | Specifies the expected usage pattern of the data store. The symbolic constant must be BufferUsage::STATIC, BufferUsage::DYNAMIC. |
|
overridevirtual |
Update buffer data.
| data | Specifies a pointer to data that will be copied into the data store for initialization. |
| size | Specifies the size in bytes of the data store region being replaced. |
updateSubData(void* data, unsigned int offset, unsigned int size) Implements Buffer.
|
overridevirtual |
Update buffer sub-region data.
| data | Specifies a pointer to the new data that will be copied into the data store. |
| offset | Specifies the offset into the buffer object's data store where data replacement will begin, measured in bytes. |
| size | Specifies the size in bytes of the data store region being replaced. |
updateData(void* data, unsigned int size) Implements Buffer.
|
inlineoverridevirtual |