![]() |
CUGL 4.0
Cornell University Game Library
|
#include <CUUniformBuffer.h>
Public Member Functions | |
| UniformBuffer () | |
| ~UniformBuffer () | |
| void | dispose () |
| bool | init (size_t capacity, bool stream=true) |
| bool | init (size_t capacity, Uint32 blocks, bool stream=true) |
| BufferData * | getImplementation () |
| void | setName (std::string name) |
| const std::string | getName () const |
| bool | isStream () const |
| Uint32 | getBlockCount () const |
| size_t | getBlockSize () const |
| size_t | getBlockStride () const |
| void | setOffset (const std::string name, size_t offset) |
| size_t | getOffset (const std::string name) const |
| std::vector< std::string > | getOffsets () const |
| size_t | loadData (const std::byte *data, size_t amt) |
| template<typename T > | |
| bool | loadData (const T &data) |
| size_t | loadBlock (Uint32 block, const std::byte *data, size_t amt) |
| template<typename T > | |
| bool | loadBlock (Uint32 block, const T &data) |
| void | flush () |
| void | pushInt (Sint64 block, const std::string name, Sint32 value) |
| void | pushInt (Sint64 block, size_t offset, Sint32 value) |
| void | pushUInt (Sint64 block, const std::string name, Uint32 value) |
| void | pushUInt (Sint64 block, size_t offset, Uint32 value) |
| void | pushFloat (Sint64 block, const std::string name, float value) |
| void | pushFloat (Sint64 block, size_t offset, float value) |
| void | pushVec2 (Sint64 block, const std::string name, const Vec2 &vec) |
| void | pushVec2 (Sint64 block, size_t offset, const Vec2 &vec) |
| void | pushVec2 (Sint64 block, const std::string name, float x, float y) |
| void | pushVec2 (Sint64 block, size_t offset, float x, float y) |
| void | pushVec3 (Sint64 block, const std::string name, const Vec3 &vec) |
| void | pushVec3 (Sint64 block, size_t offset, const Vec3 &vec) |
| void | pushVec3 (Sint64 block, const std::string name, float x, float y, float z) |
| void | pushVec3 (Sint64 block, size_t offset, float x, float y, float z) |
| void | pushVec4 (Sint64 block, const std::string name, const Vec4 &vec) |
| void | pushVec4 (Sint64 block, size_t offset, const Vec4 &vec) |
| void | pushVec4 (Sint64 block, const std::string name, const Quaternion &quat) |
| void | pushVec4 (Sint64 block, size_t offset, const Quaternion &quat) |
| void | pushVec4 (Sint64 block, const std::string name, float x, float y, float z, float w) |
| void | pushVec4 (Sint64 block, size_t offset, float x, float y, float z, float w) |
| void | pushIVec2 (Sint64 block, const std::string name, Sint32 x, Sint32 y) |
| void | pushIVec2 (Sint64 block, size_t offset, Sint32 x, Sint32 y) |
| void | pushIVec3 (Sint64 block, const std::string name, Sint32 x, Sint32 y, Sint32 z) |
| void | pushIVec3 (Sint64 block, size_t offset, Sint32 x, Sint32 y, Sint32 z) |
| void | pushIVec4 (Sint64 block, const std::string name, Sint32 x, Sint32 y, Sint32 z, Sint32 w) |
| void | pushIVec4 (Sint64 block, size_t offset, Sint32 x, Sint32 y, Sint32 z, Sint32 w) |
| void | pushUVec2 (Sint64 block, const std::string name, Uint32 x, Uint32 y) |
| void | pushUVec2 (Sint64 block, size_t offset, Uint32 x, Uint32 y) |
| void | pushUVec3 (Sint64 block, const std::string name, Uint32 x, Uint32 y, Uint32 z) |
| void | pushUVec3 (Sint64 block, size_t offset, Uint32 x, Uint32 y, Uint32 z) |
| void | pushUVec4 (Sint64 block, const std::string name, Uint32 x, Uint32 y, Uint32 z, Uint32 w) |
| void | pushUVec4 (Sint64 block, size_t offset, Uint32 x, Uint32 y, Uint32 z, Uint32 w) |
| void | pushColor4f (Sint64 block, const std::string name, const Color4f &color) |
| void | pushColor4f (Sint64 block, size_t offset, const Color4f &color) |
| void | pushColor4f (Sint64 block, const std::string name, float red, float green, float blue, float alpha) |
| void | pushColor4f (Sint64 block, size_t offset, float red, float green, float blue, float alpha) |
| void | pushColor4 (Sint64 block, const std::string name, const Color4 color) |
| void | pushColor4 (Sint64 block, size_t offset, const Color4 color) |
| void | pushColor4 (Sint64 block, const std::string name, Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha) |
| void | pushColor4 (Sint64 block, size_t offset, Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha) |
| void | pushMat2 (Sint64 block, const std::string name, const Affine2 &mat) |
| void | pushMat2 (Sint64 block, size_t offset, const Affine2 &mat) |
| void | pushMat2 (Sint64 block, const std::string name, const float *array) |
| void | pushMat2 (Sint64 block, size_t offset, const float *array) |
| void | pushMat3 (Sint64 block, const std::string name, const Affine2 &mat) |
| void | pushMat3 (Sint64 block, size_t offset, const Affine2 &mat) |
| void | pushMat3 (Sint64 block, const std::string name, const float *array) |
| void | pushMat3 (Sint64 block, size_t offset, const float *array) |
| void | pushMat4 (Sint64 block, const std::string name, const Mat4 &mat) |
| void | pushMat4 (Sint64 block, size_t offset, const Mat4 &mat) |
| void | pushMat4 (Sint64 block, const std::string name, const float *array) |
| void | pushMat4 (Sint64 block, size_t offset, const float *array) |
| void | pushBytes (Sint64 block, size_t offset, const Uint8 *data, size_t amt) |
Static Public Member Functions | |
| static std::shared_ptr< UniformBuffer > | alloc (size_t capacity, bool stream=true) |
| static std::shared_ptr< UniformBuffer > | alloc (size_t capacity, Uint32 blocks, bool stream=true) |
Static Public Attributes | |
| static const size_t | INVALID_OFFSET |
This class defines a uniform buffer for a GraphicsShader.
Technically, a shader is associated with a uniform block, not a uniform buffer, since a uniform buffer may have multiple blocks. In the case of a uniform buffer with multiple blocks, the current block is managed through the shader (either GraphicsShader or ComputeShader).
Uniform buffers are required for Vulkan. However, CUGL uses them extensively in OpenGL as well. They ideal in two use cases. First of all, they are great for uniforms that are shared across multiple shaders. But it is also worthwhile to have a buffer for a single shader if (1) that shader has a large number of uniforms and (2) those uniforms change semi-frequently through out a render pass. In that case, the uniform buffer should be allocated with enough blocks so that all of the possible uniform values can be assigned at the start of the render pass, each to a different block. Once the shader starts to receive vertices, the uniforms should be managed via the GraphicsShader#setBlock method.
Note that we do not support BufferAccess types in uniform buffers. That is because is makes very little sense to allow compute access to a uniform buffer. Uniform buffers use std140, but any output buffer to a compute shader must use std430. This is conversion is complicated enough that we elected not to support it in CUGL.
| cugl::graphics::UniformBuffer::UniformBuffer | ( | ) |
Creates an uninitialized uniform buffer.
You must initialize the uniform buffer to allocate memory.
|
inline |
Deletes this uniform buffer, disposing all resources.
|
inlinestatic |
Returns a new uniform block to support a block of the given capacity.
This uniform buffer will only support a single block. The block capacity is measured in bytes. In std140 format, all scalars are 4 bytes, vectors are 8 or 16 bytes, and matrices are treated as an array of 8 or 16 byte column vectors.
Typically uniform buffers supports streaming, meaning that their values updated every frame or so. If stream is false, then this buffer can only be set once (typically at the start of the frame), and later calls to either flush or loadData will fail.
| capacity | The block capacity in bytes |
| stream | Whether data can be streamed to the buffer |
|
inlinestatic |
Returns a new uniform buffer to support multiple blocks of the given capacity.
The block capacity is measured in bytes. In std140 format, all scalars are 4 bytes, vectors are 8 or 16 bytes, and matrices are treated as an array of 8 or 16 byte column vectors.
Keep in mind that uniform buffer blocks must be aligned, and so this may take significantly more memory than the number of blocks times the capacity. If the graphics card cannot support that many blocks, this method will return false.
Typically uniform buffers supports streaming, meaning that their values updated every frame or so. If stream is false, then this buffer can only be set once (typically at the start of the frame), and later calls to either flush or loadData will fail.
| capacity | The block capacity in bytes |
| blocks | The number of blocks to support |
| stream | Whether data can be streamed to the buffer |
| void cugl::graphics::UniformBuffer::dispose | ( | ) |
Deletes the uniform buffer, freeing all resources.
You must reinitialize the uniform buffer to use it.
| void cugl::graphics::UniformBuffer::flush | ( | ) |
Flushes any changes to the graphics card.
For any method other than loadData, changes to this uniform buffer are only applied to a backing buffer in CPU memory, and are not reflected on the graphics card. This method synchronizes these two memory regions.
|
inline |
Returns the number of blocks supported by this buffer.
A uniform buffer can support multiple uniform blocks at once.
|
inline |
Returns the capacity of a single block in this uniform buffer.
The block size is the amount of data necessary to populate the uniforms for a single block. It is measured in bytes.
|
inline |
Returns the stride of a single block in this uniform buffer.
The stride measures the alignment (in bytes) of a block. It is at least as large as the block capacity, but may be more.
|
inline |
Returns the platform-specific implementation for this buffer
The value returned is an opaque type encapsulating the information for either OpenGL or Vulkan.
|
inline |
Returns the name of this uniform buffer.
A name is a user-defined way of identifying a buffer. It is typically the appropriate shader variable name, but this is not necessary for it to function properly.
| size_t cugl::graphics::UniformBuffer::getOffset | ( | const std::string | name | ) | const |
Returns the byte offset for the given name.
This method requires that name be previously associated with an offset via setOffset. If it has not been associated with an offset, then this method will return INVALID_OFFSET instead.
| name | The variable name to query for an offset |
| std::vector< std::string > cugl::graphics::UniformBuffer::getOffsets | ( | ) | const |
Returns the offsets defined for this buffer
The vector returned will include the name of every variable set by the method setOffset.
|
inline |
Initializes this uniform buffer to support a block of the given capacity.
This uniform buffer will only support a single block. The block capacity is measured in bytes. In std140 format, all scalars are 4 bytes, vectors are 8 or 16 bytes, and matrices are treated as an array of 8 or 16 byte column vectors.
Typically uniform buffers supports streaming, meaning that their values updated every frame or so. If stream is false, then this buffer can only be set once (typically at the start of the frame), and later calls to either flush or loadData will fail.
| capacity | The block capacity in bytes |
| stream | Whether data can be streamed to the buffer |
| bool cugl::graphics::UniformBuffer::init | ( | size_t | capacity, |
| Uint32 | blocks, | ||
| bool | stream = true |
||
| ) |
Initializes this uniform buffer to support multiple blocks of the given capacity.
The block capacity is measured in bytes. In std140 format, all scalars are 4 bytes, vectors are 8 or 16 bytes, and matrices are treated as an array of 8 or 16 byte column vectors.
Keep in mind that uniform buffer blocks must be aligned, and so this may take significantly more memory than the number of blocks times the capacity. If the graphics card cannot support that many blocks, this method will return false.
Typically uniform buffers supports streaming, meaning that their values updated every frame or so. If stream is false, then this buffer can only be set once (typically at the start of the frame), and later calls to either flush or loadData will fail.
| capacity | The block capacity in bytes |
| blocks | The number of blocks to support |
| stream | Whether data can be streamed to the buffer |
|
inline |
| size_t cugl::graphics::UniformBuffer::loadBlock | ( | Uint32 | block, |
| const std::byte * | data, | ||
| size_t | amt | ||
| ) |
Loads the given data into the specified block
The value amt must be less than or equal to the size of block. Calling this method will update the CPU memory, but not update it on the GPU. You must call flush to synchronize the buffer.
If there is more than one block, this method will fail on any uniform buffer that is not streaming. If there is only one block, this method can only be called once on non-streaming buffers.
| block | The block to update |
| data | The data to load |
| amt | The data size in bytes |
|
inline |
Loads the given data into the specified block
The type T should be the natural data sizee of the block. Calling this method will update the CPU memory, but not update it on the GPU. You must call flush to synchronize the buffer.
If there is more than one block, this method will fail on any uniform buffer that is not streaming. If there is only one block, this method can only be called once on non-streaming buffers.
| block | The block to update |
| data | The data to load |
| size_t cugl::graphics::UniformBuffer::loadData | ( | const std::byte * | data, |
| size_t | amt | ||
| ) |
Loads the given data in to this buffer
This will load memory into the entire buffer, potentially across multiple blocks. It will call flush when done, committing the changes to the graphics card. If there is more than one block, this method is the only method that can be called for a non-streaming uniform buffer. And in that case, it can only be called once.
Note that if this buffer spans more than one block, each block must align with getBlockSize.
| data | The data to load |
| amt | The data size in bytes |
Loads the given data in to this buffer
This will load the data structure into the uniform buffer. It will call flush when done, committing the changes to the graphics card.
This method is designed for uniform buffers with a single block. It allows the user to specify the block data a structured type. Due to alignment issues, it does not make sense to use this method on a uniform buffer with multiple blocks. Calling this method in that case will fail.
| data | The data to load |
| void cugl::graphics::UniformBuffer::pushBytes | ( | Sint64 | block, |
| size_t | offset, | ||
| const Uint8 * | data, | ||
| size_t | amt | ||
| ) |
Pushes the given data to the specified block at the given offset
This method is intended to stream line the push methods, but is not really intended for general us. The value amt must be less than or equal to the size of block minus the offet.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
This method will fail on any uniform buffer that is not streaming.
| block | The block to update |
| offset | The block offset in bytes |
| data | The data to load |
| amt | The data size in bytes |
| void cugl::graphics::UniformBuffer::pushColor4 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Color4 | color | ||
| ) |
Sets the given uniform variable to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ucolor can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| color | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushColor4 | ( | Sint64 | block, |
| const std::string | name, | ||
| Uint8 | red, | ||
| Uint8 | green, | ||
| Uint8 | blue, | ||
| Uint8 | alpha | ||
| ) |
Sets the given uniform variable to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ucolor can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| red | The uniform red value |
| green | The uniform green value |
| blue | The uniform blue value |
| alpha | The uniform alpha value |
| void cugl::graphics::UniformBuffer::pushColor4 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Color4 | color | ||
| ) |
Sets the given block offset to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ucolor can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| color | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushColor4 | ( | Sint64 | block, |
| size_t | offset, | ||
| Uint8 | red, | ||
| Uint8 | green, | ||
| Uint8 | blue, | ||
| Uint8 | alpha | ||
| ) |
Sets the given block offset to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ucolor can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| red | The uniform red value |
| green | The uniform green value |
| blue | The uniform blue value |
| alpha | The uniform alpha value |
| void cugl::graphics::UniformBuffer::pushColor4f | ( | Sint64 | block, |
| const std::string | name, | ||
| const Color4f & | color | ||
| ) |
Sets the given uniform variable to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL color can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| color | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushColor4f | ( | Sint64 | block, |
| const std::string | name, | ||
| float | red, | ||
| float | green, | ||
| float | blue, | ||
| float | alpha | ||
| ) |
Sets the given uniform variable to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL color can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| red | The uniform red value |
| green | The uniform green value |
| blue | The uniform blue value |
| alpha | The uniform alpha value |
| void cugl::graphics::UniformBuffer::pushColor4f | ( | Sint64 | block, |
| size_t | offset, | ||
| const Color4f & | color | ||
| ) |
Sets the given block offset to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL color can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| color | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushColor4f | ( | Sint64 | block, |
| size_t | offset, | ||
| float | red, | ||
| float | green, | ||
| float | blue, | ||
| float | alpha | ||
| ) |
Sets the given block offset to a color value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL color can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| red | The uniform red value |
| green | The uniform green value |
| blue | The uniform blue value |
| alpha | The uniform alpha value |
| void cugl::graphics::UniformBuffer::pushFloat | ( | Sint64 | block, |
| const std::string | name, | ||
| float | value | ||
| ) |
Sets the given uniform variable to a float value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL float can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushFloat | ( | Sint64 | block, |
| size_t | offset, | ||
| float | value | ||
| ) |
Sets the given block offset to a float value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL float can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushInt | ( | Sint64 | block, |
| const std::string | name, | ||
| Sint32 | value | ||
| ) |
Sets the given uniform variable to a integer value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL int can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushInt | ( | Sint64 | block, |
| size_t | offset, | ||
| Sint32 | value | ||
| ) |
Sets the given block offset to a integer value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL int can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushIVec2 | ( | Sint64 | block, |
| const std::string | name, | ||
| Sint32 | x, | ||
| Sint32 | y | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushIVec2 | ( | Sint64 | block, |
| size_t | offset, | ||
| Sint32 | x, | ||
| Sint32 | y | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushIVec3 | ( | Sint64 | block, |
| const std::string | name, | ||
| Sint32 | x, | ||
| Sint32 | y, | ||
| Sint32 | z | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushIVec3 | ( | Sint64 | block, |
| size_t | offset, | ||
| Sint32 | x, | ||
| Sint32 | y, | ||
| Sint32 | z | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushIVec4 | ( | Sint64 | block, |
| const std::string | name, | ||
| Sint32 | x, | ||
| Sint32 | y, | ||
| Sint32 | z, | ||
| Sint32 | w | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushIVec4 | ( | Sint64 | block, |
| size_t | offset, | ||
| Sint32 | x, | ||
| Sint32 | y, | ||
| Sint32 | z, | ||
| Sint32 | w | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL ivec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushMat2 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Affine2 & | mat | ||
| ) |
Sets the given uniform variable to a 2x2 matrix.
The 2x2 matrix will be the non-translational part of the affine transform.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushMat2 | ( | Sint64 | block, |
| const std::string | name, | ||
| const float * | array | ||
| ) |
Sets the given uniform variable to a 2x2 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat2 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Affine2 & | mat | ||
| ) |
Sets the given block offset to a 2x2 matrix.
The 2x2 matrix will be the non-translational part of the affine transform.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushMat2 | ( | Sint64 | block, |
| size_t | offset, | ||
| const float * | array | ||
| ) |
Sets the given block offset to a 2x2 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat3 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Affine2 & | mat | ||
| ) |
Sets the given uniform variable to a 3x3 matrix.
The 3x3 matrix will be affine transform in homoegenous coordinates.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushMat3 | ( | Sint64 | block, |
| const std::string | name, | ||
| const float * | array | ||
| ) |
Sets the given uniform variable to a 3x3 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat3 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Affine2 & | mat | ||
| ) |
Sets the given block offset to a 3x3 matrix.
The 3x3 matrix will be affine transform in homoegenous coordinates.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushMat3 | ( | Sint64 | block, |
| size_t | offset, | ||
| const float * | array | ||
| ) |
Sets the given block offset to a 3x3 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat4 | ( | Sint64 | block, |
| const std::string | name, | ||
| const float * | array | ||
| ) |
Sets the given uniform variable to a 4x4 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat4 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Mat4 & | mat | ||
| ) |
Sets the given uniform variable to a 4x4 matrix
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushMat4 | ( | Sint64 | block, |
| size_t | offset, | ||
| const float * | array | ||
| ) |
Sets the given block offset to a 4x4 matrix.
The matrix will be read from the array in column major order (not row major).
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| array | The values for the uniform |
| void cugl::graphics::UniformBuffer::pushMat4 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Mat4 & | mat | ||
| ) |
Sets the given block offset to a 4x4 matrix
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL mat4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| mat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushUInt | ( | Sint64 | block, |
| const std::string | name, | ||
| Uint32 | value | ||
| ) |
Sets the given uniform variable to an unsigned integer value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uint can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushUInt | ( | Sint64 | block, |
| size_t | offset, | ||
| Uint32 | value | ||
| ) |
Sets the given block offset to an unsigned integer value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uint can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| value | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushUVec2 | ( | Sint64 | block, |
| const std::string | name, | ||
| Uint32 | x, | ||
| Uint32 | y | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushUVec2 | ( | Sint64 | block, |
| size_t | offset, | ||
| Uint32 | x, | ||
| Uint32 | y | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushUVec3 | ( | Sint64 | block, |
| const std::string | name, | ||
| Uint32 | x, | ||
| Uint32 | y, | ||
| Uint32 | z | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushUVec3 | ( | Sint64 | block, |
| size_t | offset, | ||
| Uint32 | x, | ||
| Uint32 | y, | ||
| Uint32 | z | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushUVec4 | ( | Sint64 | block, |
| const std::string | name, | ||
| Uint32 | x, | ||
| Uint32 | y, | ||
| Uint32 | z, | ||
| Uint32 | w | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushUVec4 | ( | Sint64 | block, |
| size_t | offset, | ||
| Uint32 | x, | ||
| Uint32 | y, | ||
| Uint32 | z, | ||
| Uint32 | w | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL uvec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec2 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Vec2 & | vec | ||
| ) |
Sets the given uniform variable to a Vector2 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec2 | ( | Sint64 | block, |
| const std::string | name, | ||
| float | x, | ||
| float | y | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec2 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Vec2 & | vec | ||
| ) |
Sets the given block offset to a Vector2 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec2 | ( | Sint64 | block, |
| size_t | offset, | ||
| float | x, | ||
| float | y | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec2 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec3 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Vec3 & | vec | ||
| ) |
Sets the given uniform variable to a Vector3 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec3 | ( | Sint64 | block, |
| const std::string | name, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec3 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Vec3 & | vec | ||
| ) |
Sets the given uniform variable to a Vector3 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec3 | ( | Sint64 | block, |
| size_t | offset, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Sets the given block offset to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec3 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Quaternion & | quat | ||
| ) |
Sets the given uniform variable to a quaternion.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| quat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| const std::string | name, | ||
| const Vec4 & | vec | ||
| ) |
Sets the given uniform variable to a Vector4 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| const std::string | name, | ||
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | w | ||
| ) |
Sets the given uniform variable to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| name | The name of the uniform |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Quaternion & | quat | ||
| ) |
Sets the given block offset to a quaternion.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| quat | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| size_t | offset, | ||
| const Vec4 & | vec | ||
| ) |
Sets the given block offset to a Vector4 value.
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| vec | The value for the uniform |
| void cugl::graphics::UniformBuffer::pushVec4 | ( | Sint64 | block, |
| size_t | offset, | ||
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | w | ||
| ) |
Sets the given uniform to the given values
If block is -1, it sets this value in every block in this uniform buffer. Values set by this method will not be sent to the graphics card until a call to flush.
Unlike shaders, uniform buffers do not check for correctness of their variables. Assigning this value to a variable that is not a GLSL vec4 can corrupt the memory.
This method will fail if the buffer is not streaming.
| block | The block in this uniform buffer to access |
| offset | The offset within the block |
| x | The x-value for the vector |
| y | The x-value for the vector |
| z | The z-value for the vector |
| w | The z-value for the vector |
|
inline |
Sets the name of this uniform buffer.
A name is a user-defined way of identifying a buffer. It is typically the appropriate shader variable name, but this is not necessary for it to function properly.
| name | The name of this uniform buffer. |
| void cugl::graphics::UniformBuffer::setOffset | ( | const std::string | name, |
| size_t | offset | ||
| ) |
Defines the byte offset of the given buffer variable.
It is not necessary to call this method to use the uniform buffer. It is always possible to pass data to the uniform block by specifying the byte offset.The shader uses byte offsets to pull data from the uniform buffer and assign it to the appropriate struct variable.
However, this method makes use of the uniform buffer easier to follow. It explicitly assigns a variable name to a byte offset. This variable name can now be used in place of the byte offset with passing data to this uniform block. It is akin to declaring uniforms and attributes before compiling a GraphicsShader.
This method can be called any time, even while the buffer is in use. It has no affect on the underlying data.
| name | The variable name to use for this offset |
| offset | The buffer offset in bytes |
|
static |
The byte position of an invalid offset