Ocular Engine
|
A generic buffer that can be uploaded to the GPU. More...
#include <GPUBuffer.hpp>
Public Member Functions | |
GPUBuffer (GPUBufferDescriptor const &descriptor) | |
virtual void | bind () |
virtual void | unbind () |
virtual bool | build (void const *source) |
virtual bool | read (void *destination, uint32_t start, uint32_t size) |
virtual bool | write (void const *source, uint32_t start, uint32_t size) |
GPUBufferDescriptor const & | getDescriptor () const |
Protected Attributes | |
GPUBufferDescriptor | m_Descriptor |
A generic buffer that can be uploaded to the GPU.
|
virtual |
Binds the buffer to shader stage and slot specified in the descriptor.
Reimplemented in Ocular::Graphics::D3D11StructuredBuffer.
|
virtual |
Attempts to (re)build the buffer. For buffers built without CPU write access, this is the only way to provide data.
[in] | source | Optional source data. If NULL, buffer will be populated with 0. |
Reimplemented in Ocular::Graphics::D3D11StructuredBuffer.
GPUBufferDescriptor const & Ocular::Graphics::GPUBuffer::getDescriptor | ( | ) | const |
|
virtual |
Attempts to read data from the buffer. Only available to buffers created with Read CPU Access.
[out] | destination | Destination to copy buffer data into. |
[in] | start | Starting offset into the GPU buffer to start reading from. |
[in] | size | Size of data to be read. |
Reimplemented in Ocular::Graphics::D3D11StructuredBuffer.
|
virtual |
Unbinds the buffer in the stage and slot specified by the descriptor.
Reimplemented in Ocular::Graphics::D3D11StructuredBuffer.
|
virtual |
Attempts to write data to the buffer. Only available to buffers created with Write CPU Access.
[in] | source | Source of data to place into buffer. If source is NULL, buffer will be filled with 0. |
[in] | start | Starting offset into the GPU buffer to start writing to. |
[in] | size | Size of the data to write. |
Reimplemented in Ocular::Graphics::D3D11StructuredBuffer.