#include <bufferbindinginstance.h>
Additional Inherited Members | |
![]() | |
const std::string | mBindingName |
BufferBindingChangedCallback | mBindingChangedCallback |
GPUBuffer * | mBuffer = nullptr |
Instantiated version of nap::BufferBindingStruct.
Every buffer binding 'resource' has an associative 'instance', ie: nap::BufferBindingNumeric -> nap::BufferBindingNumericInstance. An instance can be updated / inspected at run-time and is associated with a declaration.
Buffer bindings, unlike standard uniforms, store a reference to the underlying data as opposed to the data itself. This allows for any compute shader to read from and write to the same data storage. Buffer bindings always refer to a single nap::GPUBuffer, whether this is simple a nap::GPUBufferNumeric
or a more complex nap::StructGPUBuffer
.
A struct array can be addressed as a nap::GPUStructBuffer
:
BufferBindingStructInstance | ( | const std::string & | bindingName, |
const ShaderVariableStructBufferDeclaration & | declaration, | ||
const BufferBindingChangedCallback & | bindingChangedCallback | ||
) |
|
delete |
StructBuffer& getBuffer | ( | ) |
const StructBuffer& getBuffer | ( | ) | const |
|
overridevirtual |
Required virtual, needs to be implemented in derived classes
Implements BufferBindingInstance.
const ShaderVariableStructBufferDeclaration& getStructDeclaration | ( | ) | const |
|
delete |
void setBuffer | ( | const BufferBindingStruct & | resource | ) |
Updates the buffer from a resource
resource | resource to set buffer from. |
void setBuffer | ( | StructBuffer & | buffer | ) |
Binds a new buffer to the uniform instance
buffer | new buffer to bind |