SDL3pp
A slim C++ wrapper for SDL3
|
An opaque handle representing a buffer. More...
Public Member Functions | |
constexpr | GPUBuffer (GPUBufferRaw gPUBuffer={}) |
Wraps GPUBuffer. More... | |
GPUBuffer (GPUDeviceParam device, const GPUBufferCreateInfo &createinfo) | |
Creates a buffer object to be used in graphics or compute workflows. More... | |
constexpr bool | operator== (const GPUBuffer &other) const =default |
Default comparison operator. | |
constexpr bool | operator== (GPUBufferRaw gPUBuffer) const |
Compares with the underlying type. | |
constexpr | operator GPUBufferRaw () const |
Unwraps to the underlying GPUBuffer. More... | |
Used for vertices, indices, indirect draw commands, and general compute data.
|
inlineconstexpr |
gPUBuffer | the value to be wrapped |
|
inline |
The contents of this buffer are undefined until data is written to the buffer.
Note that certain combinations of usage flags are invalid. For example, a buffer cannot have both the VERTEX and INDEX flags.
If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
For better understanding of underlying concepts and memory management with SDL GPU API, you may refer this blog post.
There are optional properties that can be provided through props
. These are the supported properties:
prop::GPUBuffer.CREATE_NAME_STRING
: a name that can be displayed in debugging tools.device | a GPU Context. |
createinfo | a struct describing the state of the buffer to create. |
Error | on failure. |
|
inlineconstexpr |