General purpose GPU buffer, with different use types determining its memory type, visibility and access pattern.
More...
#include <Buffer.hpp>
|
std::string | _name |
| Resource name.
|
|
General purpose GPU buffer, with different use types determining its memory type, visibility and access pattern.
Inherited by UniformBufferBase.
◆ Buffer() [1/4]
Buffer::Buffer |
( |
size_t |
sizeInBytes, |
|
|
BufferType |
atype, |
|
|
const std::string & |
name |
|
) |
| |
Constructor.
- Parameters
-
sizeInBytes | the size of the buffer in bytes |
atype | the use type of the buffer (uniform, index, vertex, storage...) |
name | the buffer identifier |
◆ Buffer() [2/4]
Buffer::Buffer |
( |
const Buffer & |
| ) |
|
|
delete |
Copy constructor (disabled).
◆ Buffer() [3/4]
◆ ~Buffer()
◆ Buffer() [4/4]
Buffer::Buffer |
( |
BufferType |
atype, |
|
|
const std::string & |
name |
|
) |
| |
|
protected |
Internal constructor, exposed for subclasses that override the size.
- Parameters
-
atype | the use type of the buffer (uniform, index, vertex, storage...) |
name | the buffer identifier |
◆ clean()
◆ download()
void Buffer::download |
( |
size_t |
sizeInBytes, |
|
|
unsigned char * |
data, |
|
|
size_t |
offset |
|
) |
| |
Download data from the buffer.
- Parameters
-
sizeInBytes | the size of the data to download, in bytes |
data | the storage to download to |
offset | offset in the buffer |
◆ name()
const std::string & Buffer::name |
( |
| ) |
const |
Get the resource name.
- Returns
- the name.
◆ operator=() [1/2]
Move assignment operator .
- Returns
- a reference to the object assigned to
◆ operator=() [2/2]
Copy assignment operator (disabled).
- Returns
- a reference to the object assigned to
◆ upload() [1/2]
template<typename T >
void Buffer::upload |
( |
const std::vector< T > & |
data, |
|
|
size_t |
offset = 0 |
|
) |
| |
Upload objects data from a vector to the buffer. You have to take care of synchronization when updating a subregion of the buffer that is currently in use.
- Parameters
-
data | the objects vector to upload |
offset | offset in the buffer |
◆ upload() [2/2]
void Buffer::upload |
( |
size_t |
sizeInBytes, |
|
|
unsigned char * |
data, |
|
|
size_t |
offset |
|
) |
| |
Upload data to the buffer. You have to take care of synchronization when updating a subregion of the buffer that is currently in use.
- Parameters
-
sizeInBytes | the size of the data to upload, in bytes |
data | the data to upload |
offset | offset in the buffer |
The documentation for this class was generated from the following files:
- src/engine/resources/Buffer.hpp
- src/engine/resources/Buffer.cpp