Class wrapping buffer-related functionality with direct state access. More...
#include </home/chochlik/devel/oglplus/include/oglplus/dsa/buffer.hpp>
Classes | |
struct | Property |
Types related to Buffer. More... | |
Public Types | |
typedef DSABufferTypedMap < GLubyte > | Map |
Mapping of the buffer to the client address space. | |
typedef BufferTarget | Target |
Buffer bind targets. | |
typedef BufferIndexedTarget | IndexedTarget |
Buffer indexed bind targets. | |
Public Member Functions | |
bool | Mapped (void) const |
Returns true if the buffer is mapped. More... | |
void | Resize (BufferSize size, BufferUsage usage=BufferUsage::StaticDraw) |
Allocates buffer storage to the specified size without any data. More... | |
void | Data (const BufferData &data, BufferUsage usage=BufferUsage::StaticDraw) const |
Uploads (sets) the buffer data. More... | |
void | RawData (BufferSize size, const GLvoid *data, BufferUsage usage=BufferUsage::StaticDraw) const |
Uploads (sets) the buffer data. More... | |
template<typename GLtype > | |
void | Data (GLsizei count, const GLtype *data, BufferUsage usage=BufferUsage::StaticDraw) const |
Uploads (sets) the buffer data. More... | |
void | SubData (BufferSize offset, const BufferData &data) const |
Uploads (sets) a subrange of the buffer data. More... | |
template<typename GLtype > | |
void | SubData (BufferSize offset, GLsizei count, GLtype *data) const |
Uploads (sets) a subrange of the buffer data. More... | |
template<typename GLtype > | |
void | ClearData (PixelDataInternalFormat internal_format, PixelDataFormat format, const GLtype *data) const |
Clear the buffer data. More... | |
template<typename GLtype > | |
void | ClearSubData (PixelDataInternalFormat internal_format, BufferSize offset, BufferSize size, PixelDataFormat format, const GLtype *data) const |
Clear a subrange of the buffer data. More... | |
GLsizei | Size (void) const |
Returns the buffer size. More... | |
BufferUsage | Usage (void) const |
Returns the buffer usage. More... | |
Bitfield< BufferMapAccess > | Access (void) const |
Returns the buffer usage. More... | |
void | MakeResident (AccessSpecifier access) const |
Makes this buffer accessible to GLSL shaders. More... | |
void | MakeNonResident (void) const |
Makes this buffer inaccessible to GLSL shaders. More... | |
BufferGPUAddress | GPUAddress (void) const |
Returns the GPU address of this buffer. More... | |
void | Bind (Target target) const |
Binds this buffer to the specified target . More... | |
void | BindBase (IndexedTarget target, GLuint index) const |
Binds this buffer to the specified indexed target . More... | |
void | BindBaseUniform (UniformBufferBindingPoint index) const |
Bind this buffer to the specified uniform buffer binding point. More... | |
void | BindBaseTransformFeedback (TransformFeedbackBufferBindingPoint index) const |
Bind this buffer to the specified TFB buffer binding point. More... | |
void | BindBaseAtomicCounter (AtomicCounterBufferBindingPoint index) const |
Bind this buffer to the specified atomic counter buffer binding point. More... | |
void | BindBaseShaderStorage (ShaderStorageBufferBindingPoint index) const |
Bind this buffer to the specified shader storage buffer binding point. More... | |
void | BindRange (IndexedTarget target, GLuint index, BufferSize offset, BufferSize size) const |
Binds a range in this buffer to the specified indexed target . More... | |
void | InvalidateData (void) |
Invalidate the buffer data. More... | |
void | InvalidateSubData (BufferSize offset, BufferSize size) |
Invalidate a subrange of the buffer data. More... | |
Static Public Member Functions | |
static void | CopySubData (BufferName readbuffer, BufferName writebuffer, BufferSize readoffset, BufferSize writeoffset, BufferSize size) |
Copy data between buffers. More... | |
static void | Bind (Target target, BufferName buffer) |
Binds the specified buffer to the specified target . More... | |
static void | BindBase (IndexedTarget target, GLuint index, BufferName buffer) |
Bind the specified buffer to the specified indexed target . More... | |
static void | BindBase (BufferIndexedTarget target, GLuint first, const Sequence< BufferName > &buffers) |
Sequentially binds buffers to target starting at first index. More... | |
static void | BindRange (IndexedTarget target, GLuint index, BufferName buffer, BufferSize offset, BufferSize size) |
Bind a range the specified buffer to the specified indexed target . More... | |
static BufferName | Binding (Target target) |
Returns the current Buffer bound to specified target . More... | |
static BufferName | Binding (IndexedTarget target, GLuint idx) |
Returns the current Buffer bound to specified indexed target . More... | |
Class wrapping buffer-related functionality with direct state access.
Bitfield<BufferMapAccess> oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Access | ( | void | ) | const |
Returns the buffer usage.
GL_BUFFER_ACCESS
Error |
|
staticinherited |
Binds the specified buffer
to the specified target
.
References oglplus::GetGLName().
|
inherited |
Binds this buffer to the specified target
.
|
staticinherited |
Bind the specified buffer
to the specified indexed target
.
Error |
References oglplus::GetGLName().
|
staticinherited |
Sequentially binds buffers
to target
starting at first
index.
References oglplus::GetGLNames(), and oglplus::Sequence< ObjName >::size().
|
inherited |
Binds this buffer to the specified indexed target
.
|
inherited |
Bind this buffer to the specified atomic counter buffer binding point.
Error | Requires OpenGL 4.2 or the GL_ARB_shader_atomic_counters extension. |
References oglplus::AtomicCounter.
|
inherited |
Bind this buffer to the specified shader storage buffer binding point.
Error | Requires OpenGL 4.3 or the GL_ARB_shader_storage_buffer_object extension. |
References oglplus::ShaderStorage.
|
inherited |
Bind this buffer to the specified TFB buffer binding point.
Error | Requires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension. |
References oglplus::TransformFeedback.
|
inherited |
Bind this buffer to the specified uniform buffer binding point.
Error | Requires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension. |
References oglplus::Uniform.
|
staticinherited |
Returns the current Buffer bound to specified target
.
|
staticinherited |
Returns the current Buffer bound to specified indexed target
.
|
staticinherited |
Bind a range the specified buffer to the specified indexed target
.
Error |
References oglplus::BufferSize::Get(), and oglplus::GetGLName().
|
inherited |
Binds a range in this buffer to the specified indexed target
.
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::ClearData | ( | PixelDataInternalFormat | internal_format, |
PixelDataFormat | format, | ||
const GLtype * | data | ||
) | const |
Clear the buffer data.
Error | Requires OpenGL 4.3. |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::ClearSubData | ( | PixelDataInternalFormat | internal_format, |
BufferSize | offset, | ||
BufferSize | size, | ||
PixelDataFormat | format, | ||
const GLtype * | data | ||
) | const |
Clear a subrange of the buffer data.
Error | Requires OpenGL 4.3. |
References oglplus::BufferSize::Get().
|
static |
Copy data between buffers.
Error | Requires OpenGL 3.1 or the GL_ARB_copy_buffer extension. |
References oglplus::BufferSize::Get(), and oglplus::GetGLName().
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Data | ( | const BufferData & | data, |
BufferUsage | usage = BufferUsage::StaticDraw |
||
) | const |
Uploads (sets) the buffer data.
This member function uploads the specified to this buffer using the usage
as hint.
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Data | ( | GLsizei | count, |
const GLtype * | data, | ||
BufferUsage | usage = BufferUsage::StaticDraw |
||
) | const |
Uploads (sets) the buffer data.
This member function uploads count
units of sizeof(GLtype)
from the location pointed to by data
to this buffer using the usage
as hint.
Error |
BufferGPUAddress oglplus::ObjectOps< tag::DirectState, tag::Buffer >::GPUAddress | ( | void | ) | const |
Returns the GPU address of this buffer.
Requires the GL_NV_shader_buffer_load extension.
GL_BUFFER_GPU_ADDRESS_NV
Error |
|
inherited |
Invalidate the buffer data.
Error | Requires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension. |
|
inherited |
Invalidate a subrange of the buffer data.
Error | Requires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension. |
References oglplus::BufferSize::Get().
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::MakeNonResident | ( | void | ) | const |
Makes this buffer inaccessible to GLSL shaders.
Requires the GL_NV_shader_buffer_load extension.
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::MakeResident | ( | AccessSpecifier | access | ) | const |
Makes this buffer accessible to GLSL shaders.
Requires the GL_NV_shader_buffer_load extension.
Error |
bool oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Mapped | ( | void | ) | const |
Returns true if the buffer is mapped.
GL_BUFFER_MAPPED
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::RawData | ( | BufferSize | size, |
const GLvoid * | data, | ||
BufferUsage | usage = BufferUsage::StaticDraw |
||
) | const |
Uploads (sets) the buffer data.
This member function uploads size
bytes from the location pointed to by data
to this buffer using the usage
as hint.
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Resize | ( | BufferSize | size, |
BufferUsage | usage = BufferUsage::StaticDraw |
||
) |
Allocates buffer storage to the specified size without any data.
This member function allows to (re-)allocate the buffer storage to the specifies size
, without uploading any data.
Error |
References oglplus::BufferSize::Get().
GLsizei oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Size | ( | void | ) | const |
Returns the buffer size.
GL_BUFFER_SIZE
Error |
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::SubData | ( | BufferSize | offset, |
const BufferData & | data | ||
) | const |
Uploads (sets) a subrange of the buffer data.
Error |
References oglplus::BufferSize::Get().
void oglplus::ObjectOps< tag::DirectState, tag::Buffer >::SubData | ( | BufferSize | offset, |
GLsizei | count, | ||
GLtype * | data | ||
) | const |
BufferUsage oglplus::ObjectOps< tag::DirectState, tag::Buffer >::Usage | ( | void | ) | const |
Returns the buffer usage.
GL_BUFFER_USAGE
Error |