2#include "graphics/GPUTypes.hpp"
26 void upload(
size_t sizeInBytes,
unsigned char * data,
size_t offset);
34 void upload(
const std::vector<T>& data,
size_t offset = 0);
41 void download(
size_t sizeInBytes,
unsigned char * data,
size_t offset);
50 const std::string &
name()
const;
84 std::unique_ptr<GPUBuffer>
gpu;
94 upload(
sizeof(T) * data.size(), (
unsigned char*)data.data(), offset);
120 bool upload(
unsigned char * data);
202 const T &
at(
size_t i)
const {
General purpose GPU buffer, with different use types determining its memory type, visibility and acce...
Definition: Buffer.hpp:10
void download(size_t sizeInBytes, unsigned char *data, size_t offset)
Definition: Buffer.cpp:43
size_t size
Buffer size in bytes.
Definition: Buffer.hpp:83
Buffer & operator=(const Buffer &)=delete
Buffer(const Buffer &)=delete
const BufferType type
Buffer type.
Definition: Buffer.hpp:71
virtual ~Buffer()
Definition: Buffer.cpp:30
std::unique_ptr< GPUBuffer > gpu
The GPU data (optional).
Definition: Buffer.hpp:84
void clean()
Definition: Buffer.cpp:18
const std::string & name() const
Definition: Buffer.cpp:26
Buffer & operator=(Buffer &&)=delete
void upload(size_t sizeInBytes, unsigned char *data, size_t offset)
Definition: Buffer.cpp:34
std::string _name
Resource name.
Definition: Buffer.hpp:88
Store data in a GPU buffer.
Definition: GPUObjects.hpp:86
UniformFrequency
The frequency at which a uniform buffer might be updated.
Definition: GPUTypes.hpp:48
BufferType
The type of data a buffer is storing, determining its use.
Definition: GPUTypes.hpp:33