Wrapper for OpenGL buffer operations. More...
#include </home/chochlik/devel/oglplus/include/oglplus/buffer.hpp>
Classes | |
struct | Property |
Types related to Buffer. More... | |
Public Types | |
typedef BufferTarget | Target |
Buffer bind targets. | |
typedef BufferIndexedTarget | IndexedTarget |
Buffer indexed bind targets. | |
typedef BufferTypedMap< GLubyte > | Map |
Mapping of the buffer to the client address space. | |
Public Member Functions | |
void | Bind (Target target) const |
Bind this buffer to the specified target. More... | |
void | Bind (IndexedTarget target, GLuint index) const |
Bind this buffer to the specified indexed target. More... | |
void | BindBase (IndexedTarget target, GLuint index) const |
Bind 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, GLintptr offset, GLsizeiptr size) const |
Bind a range in this buffer to the specified indexed target. More... | |
void | InvalidateData (void) |
Invalidate the buffer data. More... | |
void | InvalidateSubData (GLintptr offset, GLsizeiptr size) |
Invalidate a subrange of the buffer data. More... | |
Static Public Member Functions | |
static bool | Mapped (Target target) |
Returns true if the buffer is mapped. More... | |
static void | Unbind (Target target) |
Unbind the current buffer from the specified target. More... | |
static void | UnbindBase (IndexedTarget target, GLuint index) |
Unbind the current buffer from the specified indexed target. More... | |
template<typename GLtype > | |
static void | Data (Target target, GLsizei count, const GLtype *data, BufferUsage usage=BufferUsage::StaticDraw) |
Uploads (sets) the buffer data. More... | |
template<typename GLtype > | |
static void | Data (Target target, const std::vector< GLtype > &data, BufferUsage usage=BufferUsage::StaticDraw) |
Uploads (sets) the buffer data. More... | |
template<typename GLtype , std::size_t N> | |
static void | Data (Target target, const std::vector< Vector< GLtype, N > > &data, BufferUsage usage=BufferUsage::StaticDraw) |
Uploads (sets) the buffer data. More... | |
template<typename GLtype > | |
static void | SubData (Target target, GLintptr offset, GLsizei count, const GLtype *data) |
Uploads (sets) a subrange of the buffer data. More... | |
template<typename GLtype > | |
static void | SubData (Target target, GLintptr offset, const std::vector< GLtype > &data) |
Uploads (sets) a subrange of the buffer data. More... | |
static void | CopySubData (BufferOps::Target readtarget, BufferOps::Target writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) |
Copy data between buffers. More... | |
template<typename GLtype > | |
static void | ClearData (Target target, PixelDataInternalFormat internal_format, PixelDataFormat format, const GLtype *data) |
Clear the buffer data. More... | |
template<typename GLtype > | |
static void | ClearSubData (Target target, PixelDataInternalFormat internal_format, GLintptr offset, GLsizeiptr size, PixelDataFormat format, const GLtype *data) |
Clear a subrange of the buffer data. More... | |
template<typename GLtype > | |
static void | Storage (Target target, GLsizeiptr size, const void *data, Bitfield< BufferStorageBit > flags) |
Creates a data store for a buffer object. More... | |
static bool | ImmutableStorage (Target target) |
Returns true if the buffer storage is immutable. More... | |
static Bitfield< BufferStorageBit > | StorageFlags (Target target) |
Returns the buffer storage flags. More... | |
static GLsizei | Size (Target target) |
Returns the buffer size. More... | |
static BufferUsage | Usage (Target target) |
Returns the buffer usage. More... | |
static Bitfield< BufferMapAccess > | Access (Target target) |
Returns the buffer usage. More... | |
static void | MakeResident (Target target, AccessSpecifier access) |
Makes buffer currently bound to target accessible to GLSL shaders. More... | |
static void | MakeNonResident (Target target) |
Makes buffer currently bound to target inaccessible to GLSL shaders. More... | |
static BufferGPUAddress | GPUAddress (Target target) |
Returns the GPU address of the buffer currently bound to target. More... | |
Wrapper for OpenGL buffer operations.
|
static |
Returns the buffer usage.
GL_BUFFER_ACCESS
Error |
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Access().
void oglplus::BufferOps::Bind | ( | Target | target) | const |
Bind this buffer to the specified target.
Error |
void oglplus::BufferOps::Bind | ( | IndexedTarget | target, |
GLuint | index | ||
) | const |
void oglplus::BufferOps::BindBase | ( | IndexedTarget | target, |
GLuint | index | ||
) | const |
Bind this buffer to the specified indexed target.
Error |
References oglplus::EnumValueName(), and OGLPLUS_VERIFY.
Referenced by Bind(), BindBaseAtomicCounter(), BindBaseShaderStorage(), BindBaseTransformFeedback(), and BindBaseUniform().
void oglplus::BufferOps::BindBaseAtomicCounter | ( | AtomicCounterBufferBindingPoint | index) | const |
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, and BindBase().
void oglplus::BufferOps::BindBaseShaderStorage | ( | ShaderStorageBufferBindingPoint | index) | const |
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 BindBase(), and oglplus::ShaderStorage.
void oglplus::BufferOps::BindBaseTransformFeedback | ( | TransformFeedbackBufferBindingPoint | index) | const |
Bind this buffer to the specified TFB buffer binding point.
Error | Requires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension. |
References BindBase(), and oglplus::TransformFeedback.
void oglplus::BufferOps::BindBaseUniform | ( | UniformBufferBindingPoint | index) | const |
Bind this buffer to the specified uniform buffer binding point.
Error | Requires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension. |
References BindBase(), and oglplus::Uniform.
void oglplus::BufferOps::BindRange | ( | IndexedTarget | target, |
GLuint | index, | ||
GLintptr | offset, | ||
GLsizeiptr | size | ||
) | const |
Bind a range in this buffer to the specified indexed target.
Error |
References oglplus::EnumValueName(), and OGLPLUS_VERIFY.
|
static |
Clear the buffer data.
Error | Requires OpenGL 4.3. |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::ClearData().
|
static |
Clear a subrange of the buffer data.
Error | Requires OpenGL 4.3. |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::ClearSubData().
|
static |
Copy data between buffers.
Error | Requires OpenGL 3.1 or the GL_ARB_copy_buffer extension. |
References OGLPLUS_CHECK.
|
static |
Uploads (sets) the buffer data.
This member function uploads count
units of sizeof(GLtype)
from the location pointed to by data
to the buffer bound to the specified target
using the usage
as hint.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Data().
|
static |
Uploads (sets) the buffer data.
This member function uploads data.size()
units of sizeof(GLtype)
from the location pointed to by data.data()
to the buffer bound to the specified target
using the usage
as hint.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
|
static |
Uploads (sets) the buffer data.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
|
static |
Returns the GPU address of the buffer currently bound to target.
Requires the GL_NV_shader_buffer_load extension.
GL_BUFFER_GPU_ADDRESS_NV
Error |
References OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::GPUAddress().
|
static |
Returns true if the buffer storage is immutable.
Error | Requires OpenGL 4.4 or the GL_ARB_buffer_storage extension. |
GL_BUFFER_IMMUTABLE_STORAGE
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::ImmutableStorage().
void oglplus::BufferOps::InvalidateData | ( | void | ) |
Invalidate the buffer data.
Error | Requires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension. |
References OGLPLUS_CHECK.
void oglplus::BufferOps::InvalidateSubData | ( | GLintptr | offset, |
GLsizeiptr | size | ||
) |
Invalidate a subrange of the buffer data.
Error | Requires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension. |
References OGLPLUS_CHECK.
|
static |
Makes buffer currently bound to target inaccessible to GLSL shaders.
Requires the GL_NV_shader_buffer_load extension.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::MakeNonResident().
|
static |
Makes buffer currently bound to target accessible to GLSL shaders.
Requires the GL_NV_shader_buffer_load extension.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::MakeResident().
|
static |
Returns true if the buffer is mapped.
GL_BUFFER_MAPPED
Error |
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Mapped().
|
static |
Returns the buffer size.
GL_BUFFER_SIZE
Error |
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Size().
|
static |
Creates a data store for a buffer object.
Error | Requires OpenGL 4.4 or the GL_ARB_buffer_storage extension. |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Storage().
|
static |
Returns the buffer storage flags.
Error | Requires OpenGL 4.4 or the GL_ARB_buffer_storage extension. |
GL_BUFFER_STORAGE_FLAGS
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::StorageFlags().
|
static |
Uploads (sets) a subrange of the buffer data.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::SubData().
|
static |
Uploads (sets) a subrange of the buffer data.
Error |
References oglplus::EnumValueName(), and OGLPLUS_CHECK.
|
static |
Unbind the current buffer from the specified target.
This function binds the name 0 to the specified target
.
Error |
References oglplus::EnumValueName(), and OGLPLUS_VERIFY.
|
static |
Unbind the current buffer from the specified indexed target.
Error |
References OGLPLUS_VERIFY.
|
static |
Returns the buffer usage.
GL_BUFFER_USAGE
Error |
Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Usage().