Class EXTShaderImageLoadStore
This extension provides GLSL built-in functions allowing shaders to load from, store to, and perform atomic read-modify-write operations to a single level of a texture object from any shader stage. These built-in functions are named imageLoad(), imageStore(), and imageAtomic*(), respectively, and accept integer texel coordinates to identify the texel accessed. The extension adds the notion of "image units" to the OpenGL API, to which texture levels are bound for access by the GLSL built-in functions. To allow shaders to specify the image unit to access, GLSL provides a new set of data types ("image*") similar to samplers. Each image variable is assigned an integer value to identify an image unit to access, which is specified using Uniform*() APIs in a manner similar to samplers. For implementations supporting the NV_gpu_program5 extensions, assembly language instructions to perform image loads, stores, and atomics are also provided.
This extension also provides the capability to explicitly enable "early" per-fragment tests, where operations like depth and stencil testing are performed prior to fragment shader execution. In unextended OpenGL, fragment shaders never have any side effects and implementations can sometimes perform per-fragment tests and discard some fragments prior to executing the fragment shader. Since this extension allows fragment shaders to write to texture and buffer object memory using the built-in image functions, such optimizations could lead to non-deterministic results. To avoid this, implementations supporting this extension may not perform such optimizations on shaders having such side effects. However, enabling early per-fragment tests guarantees that such tests will be performed prior to fragment shader execution, and ensures that image stores and atomics will not be performed by fragment shader invocations where these per-fragment tests fail.
Finally, this extension provides both a GLSL built-in function and an OpenGL API function allowing applications some control over the ordering of image loads, stores, and atomics relative to other OpenGL pipeline operations accessing the same memory. Because the extension provides the ability to perform random accesses to texture or buffer object memory, such accesses are not easily tracked by the OpenGL driver. To avoid the need for heavy-handed synchronization at the driver level, this extension requires manual synchronization. The MemoryBarrierEXT() OpenGL API function allows applications to specify a bitfield indicating the set of OpenGL API operations to synchronize relative to shader memory access. The memoryBarrier() GLSL built-in function provides a synchronization point within a given shader invocation to ensure that all memory accesses performed prior to the synchronization point complete prior to any started after the synchronization point.
Requires OpenGL 3.0
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Accepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Returned by thetype
parameter of GetActiveUniform.static final int
Accepted by thebarriers
parameter of MemoryBarrierEXT. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
glBindImageTextureEXT
(int index, int texture, int level, boolean layered, int layer, int access, int format) static void
glMemoryBarrierEXT
(int barriers)
-
Field Details
-
GL_MAX_IMAGE_UNITS_EXT
public static final int GL_MAX_IMAGE_UNITS_EXTAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT
public static final int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXTAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_MAX_IMAGE_SAMPLES_EXT
public static final int GL_MAX_IMAGE_SAMPLES_EXTAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev.- See Also:
-
GL_IMAGE_BINDING_NAME_EXT
public static final int GL_IMAGE_BINDING_NAME_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_IMAGE_BINDING_LEVEL_EXT
public static final int GL_IMAGE_BINDING_LEVEL_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_IMAGE_BINDING_LAYERED_EXT
public static final int GL_IMAGE_BINDING_LAYERED_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_IMAGE_BINDING_LAYER_EXT
public static final int GL_IMAGE_BINDING_LAYER_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_IMAGE_BINDING_ACCESS_EXT
public static final int GL_IMAGE_BINDING_ACCESS_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_IMAGE_BINDING_FORMAT_EXT
public static final int GL_IMAGE_BINDING_FORMAT_EXTAccepted by thetarget
parameter of GetIntegeri_v and GetBooleani_v.- See Also:
-
GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT
public static final int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_ELEMENT_ARRAY_BARRIER_BIT_EXT
public static final int GL_ELEMENT_ARRAY_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_UNIFORM_BARRIER_BIT_EXT
public static final int GL_UNIFORM_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_TEXTURE_FETCH_BARRIER_BIT_EXT
public static final int GL_TEXTURE_FETCH_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT
public static final int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_COMMAND_BARRIER_BIT_EXT
public static final int GL_COMMAND_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_PIXEL_BUFFER_BARRIER_BIT_EXT
public static final int GL_PIXEL_BUFFER_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_TEXTURE_UPDATE_BARRIER_BIT_EXT
public static final int GL_TEXTURE_UPDATE_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_BUFFER_UPDATE_BARRIER_BIT_EXT
public static final int GL_BUFFER_UPDATE_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_FRAMEBUFFER_BARRIER_BIT_EXT
public static final int GL_FRAMEBUFFER_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT
public static final int GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_ATOMIC_COUNTER_BARRIER_BIT_EXT
public static final int GL_ATOMIC_COUNTER_BARRIER_BIT_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_ALL_BARRIER_BITS_EXT
public static final int GL_ALL_BARRIER_BITS_EXTAccepted by thebarriers
parameter of MemoryBarrierEXT.- See Also:
-
GL_IMAGE_1D_EXT
public static final int GL_IMAGE_1D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_2D_EXT
public static final int GL_IMAGE_2D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_3D_EXT
public static final int GL_IMAGE_3D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_2D_RECT_EXT
public static final int GL_IMAGE_2D_RECT_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_CUBE_EXT
public static final int GL_IMAGE_CUBE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_BUFFER_EXT
public static final int GL_IMAGE_BUFFER_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_1D_ARRAY_EXT
public static final int GL_IMAGE_1D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_2D_ARRAY_EXT
public static final int GL_IMAGE_2D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_CUBE_MAP_ARRAY_EXT
public static final int GL_IMAGE_CUBE_MAP_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_2D_MULTISAMPLE_EXT
public static final int GL_IMAGE_2D_MULTISAMPLE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT
public static final int GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_1D_EXT
public static final int GL_INT_IMAGE_1D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_2D_EXT
public static final int GL_INT_IMAGE_2D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_3D_EXT
public static final int GL_INT_IMAGE_3D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_2D_RECT_EXT
public static final int GL_INT_IMAGE_2D_RECT_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_CUBE_EXT
public static final int GL_INT_IMAGE_CUBE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_BUFFER_EXT
public static final int GL_INT_IMAGE_BUFFER_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_1D_ARRAY_EXT
public static final int GL_INT_IMAGE_1D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_2D_ARRAY_EXT
public static final int GL_INT_IMAGE_2D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT
public static final int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_2D_MULTISAMPLE_EXT
public static final int GL_INT_IMAGE_2D_MULTISAMPLE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT
public static final int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_1D_EXT
public static final int GL_UNSIGNED_INT_IMAGE_1D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_2D_EXT
public static final int GL_UNSIGNED_INT_IMAGE_2D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_3D_EXT
public static final int GL_UNSIGNED_INT_IMAGE_3D_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT
public static final int GL_UNSIGNED_INT_IMAGE_2D_RECT_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_CUBE_EXT
public static final int GL_UNSIGNED_INT_IMAGE_CUBE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_BUFFER_EXT
public static final int GL_UNSIGNED_INT_IMAGE_BUFFER_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT
public static final int GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT
public static final int GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT
public static final int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT
public static final int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT
public static final int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXTReturned by thetype
parameter of GetActiveUniform.- See Also:
-
-
Method Details
-
glBindImageTextureEXT
public static void glBindImageTextureEXT(int index, int texture, int level, boolean layered, int layer, int access, int format) -
glMemoryBarrierEXT
public static void glMemoryBarrierEXT(int barriers)
-