#include <MTLComputeBuffer.hpp>
|
size_t | length |
| The length of the buffer.
|
|
size_t | itemsize |
| The size of each item in the buffer.
|
|
◆ Buffer() [1/3]
Constructor for the Buffer class.
Takes in the length of the buffer, the GPU device, and the storage mode and creates a new buffer
- Parameters
-
length | The length of the buffer |
gpu | The GPU device |
storageMode | The storage mode of the buffer |
◆ Buffer() [2/3]
Copy constructor for the Buffer class.
Constructs a new buffer from an existing buffer
- Parameters
-
◆ Buffer() [3/3]
Default constructor for the Buffer class.
Creates a new empty buffer object
◆ ~Buffer()
Destructor for the Buffer class.
Calls autorelease on the buffer object and sets the freed flag to true
◆ contents()
Get the contents of the buffer.
- Returns
- T* The contents of the buffer
◆ getBuffer()
Get the MTL::Buffer object.
- Returns
- MTL::Buffer* The MTL::Buffer object
◆ getData()
Get the data from the buffer as a vector.
- Returns
- std::vector<T> The data from the buffer
◆ getFreed()
Get whether the buffer has been freed.
- Returns
- bool Whether the buffer has been freed
◆ getGPU()
Get the GPU device.
- Returns
- MTL::Device* The GPU device
◆ getStorageMode()
◆ operator=() [1/2]
Overload the = operator to set buffer contents from another buffer.
- Parameters
-
other | The buffer to set the contents from |
◆ operator=() [2/2]
Overload the = operator to set buffer contents from a vector.
- Parameters
-
data | The data to set the buffer contents to |
◆ operator[]() [1/2]
Overload the [] operator to set the value at an index.
- Parameters
-
index | The index to set the value at |
- Returns
- T The value to set at the index
◆ operator[]() [2/2]
Overload the [] operator to get the value at an index.
- Parameters
-
index | The index to get the value from |
- Returns
- T The value at the index
◆ swap()
◆ buffer
◆ freed
Whether the buffer has been freed.
◆ gpu
◆ itemsize
The size of each item in the buffer.
◆ length
The length of the buffer.
◆ storageMode
The storage mode of the buffer.
The documentation for this class was generated from the following file: