Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBShaderStorageBufferObject

extends Object
Class Inheritance
Imports
org.lwjgl.system.*

Native bindings to the ARB_shader_storage_buffer_object extension.

This extension provides the ability for OpenGL shaders to perform random access reads, writes, and atomic memory operations on variables stored in a buffer object. Application shader code can declare sets of variables (referred to as "buffer variables") arranged into interface blocks in a manner similar to that done with uniform blocks in OpenGL 3.1. In both cases, the values of the variables declared in a given interface block are taken from a buffer object bound to a binding point associated with the block. Buffer objects used in this extension are referred to as "shader storage buffers".

While the capability provided by this extension is similar to that provided by OpenGL 3.1 and ARB_uniform_buffer_object, there are several significant differences. Most importantly, shader code is allowed to write to shader storage buffers, while uniform buffers are always read-only. Shader storage buffers have a separate set of binding points, with different counts and size limits. The maximum usable size for shader storage buffers is implementation-dependent, but its minimum value is substantially larger than the minimum for uniform buffers.

The ability to write to buffer objects creates the potential for multiple independent shader invocations to read and write the same underlying memory. The same issue exists with the ARB_shader_image_load_store extension provided in OpenGL 4.2, which can write to texture objects and buffers. In both cases, the specification makes few guarantees related to the relative order of memory reads and writes performed by the shader invocations. For ARB_shader_image_load_store, the OpenGL API and shading language do provide some control over memory transactions; those mechanisms also affect reads and writes of shader storage buffers. In the OpenGL API, the MemoryBarrier call can be used to ensure that certain memory operations related to commands issued prior the barrier complete before other operations related to commands issued after the barrier. Additionally, the shading language provides the memoryBarrier() function to control the relative order of memory accesses within individual shader invocations and provides various memory qualifiers controlling how the memory corresponding to individual variables is accessed.

Requires OpenGL 4.0 and OpenGL 4.3 or ARB_program_interface_query. Promoted to core in OpenGL 4.3.

Field Summary

Modifier and TypeField and Description
public static final int
GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES

Also, add a new alias for the existing token MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS.

public static final int
GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_SHADER_STORAGE_BLOCK_SIZE

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_SHADER_STORAGE_BARRIER_BIT

Accepted in the barriers bitfield in glMemoryBarrier.

public static final int
GL_SHADER_STORAGE_BUFFER

Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv.

public static final int
GL_SHADER_STORAGE_BUFFER_BINDING

Accepted by the pname parameter of GetIntegerv, GetIntegeri_v, GetBooleanv, GetInteger64v, GetFloatv, GetDoublev, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

public static final int
GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_SHADER_STORAGE_BUFFER_SIZE

Accepted by the pname parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

public static final int
GL_SHADER_STORAGE_BUFFER_START

Accepted by the pname parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glShaderStorageBlockBinding(int
the name of the program containing the block whose binding to change
program
,
int
the index storage block within the program
storageBlockIndex
,
int
the index storage block binding to associate with the specified storage block
storageBlockBinding
)

Changes an active shader storage block binding.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCESback to summary
public static final int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES

Also, add a new alias for the existing token MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS.

GL_MAX_COMBINED_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_SHADER_STORAGE_BLOCK_SIZEback to summary
public static final int GL_MAX_SHADER_STORAGE_BLOCK_SIZE

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_SHADER_STORAGE_BUFFER_BINDINGSback to summary
public static final int GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_MAX_VERTEX_SHADER_STORAGE_BLOCKSback to summary
public static final int GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_SHADER_STORAGE_BARRIER_BITback to summary
public static final int GL_SHADER_STORAGE_BARRIER_BIT

Accepted in the barriers bitfield in glMemoryBarrier.

GL_SHADER_STORAGE_BUFFERback to summary
public static final int GL_SHADER_STORAGE_BUFFER

Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv.

GL_SHADER_STORAGE_BUFFER_BINDINGback to summary
public static final int GL_SHADER_STORAGE_BUFFER_BINDING

Accepted by the pname parameter of GetIntegerv, GetIntegeri_v, GetBooleanv, GetInteger64v, GetFloatv, GetDoublev, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENTback to summary
public static final int GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT

Accepted by the pname parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev.

GL_SHADER_STORAGE_BUFFER_SIZEback to summary
public static final int GL_SHADER_STORAGE_BUFFER_SIZE

Accepted by the pname parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

GL_SHADER_STORAGE_BUFFER_STARTback to summary
public static final int GL_SHADER_STORAGE_BUFFER_START

Accepted by the pname parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.

Constructor Detail

ARBShaderStorageBufferObjectback to summary
protected ARBShaderStorageBufferObject()

Method Detail

glShaderStorageBlockBindingback to summary
public static void glShaderStorageBlockBinding(int program, int storageBlockIndex, int storageBlockBinding)

Changes an active shader storage block binding.

Parameters
program:int

the name of the program containing the block whose binding to change

storageBlockIndex:int

the index storage block within the program

storageBlockBinding:int

the index storage block binding to associate with the specified storage block