The names returned in Ids are marked as used, for the purposes of gl:genFramebuffers only, but they acquire state and type only when they are first bound.
See external documentation.
checkFramebufferStatus(Target) -> enum()
Types
Check the completeness status of a framebuffer
gl:checkFramebufferStatus queries the completeness status of the framebuffer object currently bound to Target . Target must be ?GL_DRAW_FRAMEBUFFER, ?GL_READ_FRAMEBUFFER or ?GL_FRAMEBUFFER. ?GL_FRAMEBUFFER is equivalent to ?GL_DRAW_FRAMEBUFFER .
The return value is ?GL_FRAMEBUFFER_COMPLETE if the framebuffer bound to Target is complete. Otherwise, the return value is determined as follows:
?GL_FRAMEBUFFER_UNDEFINED is returned if Target is the default framebuffer, but the default framebuffer does not exist.
?GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT is returned if any of the framebuffer attachment points are framebuffer incomplete.
?GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT is returned if the framebuffer does not have at least one image attached to it.
?GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER is returned if the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is ?GL_NONE for any color attachment point(s) named by ?GL_DRAWBUFFERi.
?GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER is returned if ?GL_READ_BUFFER is not ?GL_NONE and the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is ?GL_NONE for the color attachment point named by ?GL_READ_BUFFER.
?GL_FRAMEBUFFER_UNSUPPORTED is returned if the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.
?GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is returned if the value of ?GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; if the value of ?GL_TEXTURE_SAMPLES is the not same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of ?GL_RENDERBUFFER_SAMPLES does not match the value of ?GL_TEXTURE_SAMPLES .
?GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is also returned if the value of ?GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not the same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of ?GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not ?GL_TRUE for all attached textures.
?GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS is returned if any framebuffer attachment is layered, and any populated attachment is not layered, or if all populated color attachments are not from textures of the same target.
Additionally, if an error occurs, zero is returned.
See external documentation.
framebufferTexture1D(Target, Attachment, Textarget, Texture, Level) -> ok
framebufferTexture2D(Target, Attachment, Textarget, Texture, Level) -> ok
framebufferTexture3D(Target, Attachment, Textarget, Texture, Level, Zoffset) -> ok
Types
framebufferRenderbuffer(Target, Attachment, Renderbuffertarget, Renderbuffer) -> ok
Attach a renderbuffer as a logical buffer to the currently bound framebuffer object
gl:framebufferRenderbuffer attaches a renderbuffer as one of the logical buffers of the currently bound framebuffer object. Renderbuffer is the name of the renderbuffer object to attach and must be either zero, or the name of an existing renderbuffer object of type Renderbuffertarget . If Renderbuffer is not zero and if gl:framebufferRenderbuffer is successful, then the renderbuffer name Renderbuffer will be used as the logical buffer identified by Attachment of the framebuffer currently bound to Target .
The value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for the specified attachment point is set to ?GL_RENDERBUFFER and the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is set to Renderbuffer . All other state values of the attachment point specified by Attachment are set to their default values. No change is made to the state of the renderbuuffer object and any previous attachment to the Attachment logical buffer of the framebuffer Target is broken.
Calling gl:framebufferRenderbuffer with the renderbuffer name zero will detach the image, if any, identified by Attachment , in the framebuffer currently bound to Target . All state values of the attachment point specified by attachment in the object bound to target are set to their default values.
Setting Attachment to the value ?GL_DEPTH_STENCIL_ATTACHMENT is a special case causing both the depth and stencil attachments of the framebuffer object to be set to Renderbuffer , which should have the base internal format ?GL_DEPTH_STENCIL .
See external documentation.
getFramebufferAttachmentParameteriv(Target, Attachment, Pname) -> integer()
Retrieve information about attachments of a bound framebuffer object
gl:getFramebufferAttachmentParameter returns information about attachments of a bound framebuffer object. Target specifies the framebuffer binding point and must be ?GL_DRAW_FRAMEBUFFER, ?GL_READ_FRAMEBUFFER or ?GL_FRAMEBUFFER. ?GL_FRAMEBUFFER is equivalent to ?GL_DRAW_FRAMEBUFFER.
If the default framebuffer is bound to Target then Attachment must be one of ?GL_FRONT_LEFT, ?GL_FRONT_RIGHT, ?GL_BACK_LEFT, or ?GL_BACK_RIGHT , identifying a color buffer, ?GL_DEPTH, identifying the depth buffer, or ?GL_STENCIL , identifying the stencil buffer.
If a framebuffer object is bound, then Attachment must be one of ?GL_COLOR_ATTACHMENT i, ?GL_DEPTH_ATTACHMENT, ?GL_STENCIL_ATTACHMENT, or ?GL_DEPTH_STENCIL_ATTACHMENT . i in ?GL_COLOR_ATTACHMENTi must be in the range zero to the value of ?GL_MAX_COLOR_ATTACHMENTS - 1.
If Attachment is ?GL_DEPTH_STENCIL_ATTACHMENT and different objects are bound to the depth and stencil attachment points of Target the query will fail. If the same object is bound to both attachment points, information about that object will be returned.
Upon successful return from gl:getFramebufferAttachmentParameteriv, if Pname is ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then Params will contain one of ?GL_NONE , ?GL_FRAMEBUFFER_DEFAULT, ?GL_TEXTURE, or ?GL_RENDERBUFFER, identifying the type of object which contains the attached image. Other values accepted for Pname depend on the type of object, as described below.
If the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is ?GL_NONE, no framebuffer is bound to Target . In this case querying Pname ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate an error.
If the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is not ?GL_NONE, these queries apply to all other framebuffer types:
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, ?GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE , ?GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, ?GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE , ?GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, or ?GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE , then Params will contain the number of bits in the corresponding red, green, blue, alpha, depth, or stencil component of the specified attachment. Zero is returned if the requested component is not present in Attachment .
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, Params will contain the format of components of the specified attachment, one of ?GL_FLOAT, GL_INT , GL_UNSIGNED_INT , GL_SIGNED_NORMALIZED , or GL_UNSIGNED_NORMALIZED for floating-point, signed integer, unsigned integer, signed normalized fixed-point, or unsigned normalized fixed-point components respectively. Only color buffers may have integer components.
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, Param will contain the encoding of components of the specified attachment, one of ?GL_LINEAR or ?GL_SRGB for linear or sRGB-encoded components, respectively. Only color buffer components may be sRGB-encoded; such components are treated as described in sections 4.1.7 and 4.1.8. For the default framebuffer, color encoding is determined by the implementation. For framebuffer objects, components are sRGB-encoded if the internal format of a color attachment is one of the color-renderable SRGB formats.
If the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is ?GL_RENDERBUFFER, then:
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, Params will contain the name of the renderbuffer object which contains the attached image.
If the value of ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is ?GL_TEXTURE, then:
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, then Params will contain the name of the texture object which contains the attached image.
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, then Params will contain the mipmap level of the texture object which contains the attached image.
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE and the texture object named ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a cube map texture, then Params will contain the cube map face of the cubemap texture object which contains the attached image. Otherwise Params will contain the value zero.
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER and the texture object named ?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a layer of a three-dimensional texture or a one-or two-dimensional array texture, then Params will contain the number of the texture layer which contains the attached image. Otherwise Params will contain the value zero.
If Pname is ?GL_FRAMEBUFFER_ATTACHMENT_LAYERED, then Params will contain ?GL_TRUE if an entire level of a three-dimesional texture, cube map texture, or one-or two-dimensional array texture is attached. Otherwise, Params will contain ?GL_FALSE.
Any combinations of framebuffer type and Pname not described above will generate an error.
See external documentation.
Types
Generate mipmaps for a specified texture target
gl:generateMipmap generates mipmaps for the texture attached to Target of the active texture unit. For cube map textures, a ?GL_INVALID_OPERATION error is generated if the texture attached to Target is not cube complete.
Mipmap generation replaces texel array levels level base+1 through q with arrays derived from the level base array, regardless of their previous contents. All other mimap arrays, including the level base array, are left unchanged by this computation.
The internal formats of the derived mipmap arrays all match those of the level base array. The contents of the derived arrays are computed by repeated, filtered reduction of the level base array. For one- and two-dimensional texture arrays, each layer is filtered independently.
See external documentation.
blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter) -> ok
Types
Copy a block of pixels from the read framebuffer to the draw framebuffer
gl:blitFramebuffer transfers a rectangle of pixel values from one region of the read framebuffer to another region in the draw framebuffer. Mask is the bitwise OR of a number of values indicating which buffers are to be copied. The values are ?GL_COLOR_BUFFER_BIT , ?GL_DEPTH_BUFFER_BIT, and ?GL_STENCIL_BUFFER_BIT. The pixels corresponding to these buffers are copied from the source rectangle bounded by the locations ( SrcX0 ; SrcY0 ) and ( SrcX1 ; SrcY1 ) to the destination rectangle bounded by the locations ( DstX0 ; DstY0 ) and ( DstX1 ; DstY1 ). The lower bounds of the rectangle are inclusive, while the upper bounds are exclusive.
The actual region taken from the read framebuffer is limited to the intersection of the source buffers being transferred, which may include the color buffer selected by the read buffer, the depth buffer, and/or the stencil buffer depending on mask. The actual region written to the draw framebuffer is limited to the intersection of the destination buffers being written, which may include multiple draw buffers, the depth buffer, and/or the stencil buffer depending on mask. Whether or not the source or destination regions are altered due to these limits, the scaling and offset applied to pixels being transferred is performed as though no such limits were present.
If the sizes of the source and destination rectangles are not equal, Filter specifies the interpolation method that will be applied to resize the source image , and must be ?GL_NEAREST or ?GL_LINEAR. ?GL_LINEAR is only a valid interpolation method for the color buffer. If Filter is not ?GL_NEAREST and Mask includes ?GL_DEPTH_BUFFER_BIT or ?GL_STENCIL_BUFFER_BIT, no data is transferred and a ?GL_INVALID_OPERATION error is generated.
If Filter is ?GL_LINEAR and the source rectangle would require sampling outside the bounds of the source framebuffer, values are read as if the ?GL_CLAMP_TO_EDGE texture wrapping mode were applied.
When the color buffer is transferred, values are taken from the read buffer of the read framebuffer and written to each of the draw buffers of the draw framebuffer.
If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation is undefined.
See external documentation.
renderbufferStorageMultisample(Target, Samples, Internalformat, Width, Height) -> ok
Types
Establish data storage, format, dimensions and sample count of a renderbuffer object's image
gl:renderbufferStorageMultisample establishes the data storage, format, dimensions and number of samples of a renderbuffer object's image.
The target of the operation, specified by Target must be ?GL_RENDERBUFFER. Internalformat specifies the internal format to be used for the renderbuffer object's storage and must be a color-renderable, depth-renderable, or stencil-renderable format. Width and Height are the dimensions, in pixels, of the renderbuffer. Both Width and Height must be less than or equal to the value of ?GL_MAX_RENDERBUFFER_SIZE . Samples specifies the number of samples to be used for the renderbuffer object's image, and must be less than or equal to the value of ?GL_MAX_SAMPLES. If Internalformat is a signed or unsigned integer format then Samples must be less than or equal to the value of ?GL_MAX_INTEGER_SAMPLES.
Upon success, gl:renderbufferStorageMultisample deletes any existing data store for the renderbuffer image and the contents of the data store after calling gl:renderbufferStorageMultisample are undefined.
See external documentation.
framebufferTextureLayer(Target, Attachment, Texture, Level, Layer) -> ok
framebufferTextureFaceARB(Target, Attachment, Texture, Level, Face) -> ok
flushMappedBufferRange(Target, Offset, Length) -> ok
Indicate modifications to a range of a mapped buffer
gl:flushMappedBufferRange indicates that modifications have been made to a range of a mapped buffer. The buffer must previously have been mapped with the ?GL_MAP_FLUSH_EXPLICIT flag. Offset and Length indicate the modified subrange of the mapping, in basic units. The specified subrange to flush is relative to the start of the currently mapped range of the buffer. gl:flushMappedBufferRange may be called multiple times to indicate distinct subranges of the mapping which require flushing.
See external documentation.
Types
Bind a vertex array object
gl:bindVertexArray binds the vertex array object with name Array . Array is the name of a vertex array object previously returned from a call to gl:genVertexArrays/1 , or zero to break the existing vertex array object binding.
If no vertex array object with name Array exists, one is created when Array is first bound. If the bind is successful no change is made to the state of the vertex array object, and any previous vertex array object binding is broken.
See external documentation.
deleteVertexArrays(Arrays) -> ok
Types
Delete vertex array objects
gl:deleteVertexArrays deletes N vertex array objects whose names are stored in the array addressed by Arrays . Once a vertex array object is deleted it has no contents and its name is again unused. If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero and the default vertex array becomes current. Unused names in Arrays are silently ignored, as is the value zero.
See external documentation.
genVertexArrays(N) -> [integer()]
Types
Generate vertex array object names
gl:genVertexArrays returns N vertex array object names in Arrays . There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genVertexArrays .
Vertex array object names returned by a call to gl:genVertexArrays are not returned by subsequent calls, unless they are first deleted with gl:deleteVertexArrays/1 .
The names returned in Arrays are marked as used, for the purposes of gl:genVertexArrays only, but they acquire state and type only when they are first bound.
See external documentation.
Types
Determine if a name corresponds to a vertex array object
gl:isVertexArray returns ?GL_TRUE if Array is currently the name of a renderbuffer object. If Renderbuffer is zero, or if Array is not the name of a renderbuffer object, or if an error occurs, gl:isVertexArray returns ?GL_FALSE . If Array is a name returned by gl:genVertexArrays/1 , by that has not yet been bound through a call to gl:bindVertexArray/1 , then the name is not a vertex array object and gl:isVertexArray returns ?GL_FALSE.
See external documentation.
getUniformIndices(Program, UniformNames) -> [integer()]
Types
Retrieve the index of a named uniform block
gl:getUniformIndices retrieves the indices of a number of uniforms within Program .
Program must be the name of a program object for which the command gl:linkProgram/1 must have been called in the past, although it is not required that gl:linkProgram/1 must have succeeded. The link could have failed because the number of active uniforms exceeded the limit.
UniformCount indicates both the number of elements in the array of names UniformNames and the number of indices that may be written to UniformIndices .
UniformNames contains a list of UniformCount name strings identifying the uniform names to be queried for indices. For each name string in UniformNames , the index assigned to the active uniform of that name will be written to the corresponding element of UniformIndices . If a string in UniformNames is not the name of an active uniform, the special value ?GL_INVALID_INDEX will be written to the corresponding element of UniformIndices .
If an error occurs, nothing is written to UniformIndices .
See external documentation.
getActiveUniformsiv(Program, UniformIndices, Pname) -> [integer()]
getActiveUniformName(Program, UniformIndex, BufSize) -> string()
Types
Query the name of an active uniform
gl:getActiveUniformName returns the name of the active uniform at UniformIndex within Program . If UniformName is not NULL, up to BufSize characters (including a nul-terminator) will be written into the array whose address is specified by UniformName . If Length is not NULL, the number of characters that were (or would have been) written into UniformName (not including the nul-terminator) will be placed in the variable whose address is specified in Length . If Length is NULL, no length is returned. The length of the longest uniform name in Program is given by the value of ?GL_ACTIVE_UNIFORM_MAX_LENGTH, which can be queried with gl:getProgramiv/2 .
If gl:getActiveUniformName is not successful, nothing is written to Length or UniformName .
Program must be the name of a program for which the command gl:linkProgram/1 has been issued in the past. It is not necessary for Program to have been linked successfully. The link could have failed because the number of active uniforms exceeded the limit.
UniformIndex must be an active uniform index of the program Program , in the range zero to ?GL_ACTIVE_UNIFORMS - 1. The value of ?GL_ACTIVE_UNIFORMS can be queried with gl:getProgramiv/2 .
See external documentation.
getUniformBlockIndex(Program, UniformBlockName) -> integer()
Types
Retrieve the index of a named uniform block
gl:getUniformBlockIndex retrieves the index of a uniform block within Program .
Program must be the name of a program object for which the command gl:linkProgram/1 must have been called in the past, although it is not required that gl:linkProgram/1 must have succeeded. The link could have failed because the number of active uniforms exceeded the limit.
UniformBlockName must contain a nul-terminated string specifying the name of the uniform block.
gl:getUniformBlockIndex returns the uniform block index for the uniform block named UniformBlockName of Program . If UniformBlockName does not identify an active uniform block of Program , gl:getUniformBlockIndex returns the special identifier, ?GL_INVALID_INDEX. Indices of the active uniform blocks of a program are assigned in consecutive order, beginning with zero.
See external documentation.
getActiveUniformBlockiv(Program, UniformBlockIndex, Pname, Params) -> ok
Query information about an active uniform block
gl:getActiveUniformBlockiv retrieves information about an active uniform block within Program .
Program must be the name of a program object for which the command gl:linkProgram/1 must have been called in the past, although it is not required that gl:linkProgram/1 must have succeeded. The link could have failed because the number of active uniforms exceeded the limit.
UniformBlockIndex is an active uniform block index of Program , and must be less than the value of ?GL_ACTIVE_UNIFORM_BLOCKS.
Upon success, the uniform block parameter(s) specified by Pname are returned in Params . If an error occurs, nothing will be written to Params .
If Pname is ?GL_UNIFORM_BLOCK_BINDING, then the index of the uniform buffer binding point last selected by the uniform block specified by UniformBlockIndex for Program is returned. If no uniform block has been previously specified, zero is returned.
If Pname is ?GL_UNIFORM_BLOCK_DATA_SIZE, then the implementation-dependent minimum total buffer object size, in basic machine units, required to hold all active uniforms in the uniform block identified by UniformBlockIndex is returned. It is neither guaranteed nor expected that a given implementation will arrange uniform values as tightly packed in a buffer object. The exception to this is the std140 uniform block layout , which guarantees specific packing behavior and does not require the application to query for offsets and strides. In this case the minimum size may still be queried, even though it is determined in advance based only on the uniform block declaration.
If Pname is ?GL_UNIFORM_BLOCK_NAME_LENGTH, then the total length (including the nul terminator) of the name of the uniform block identified by UniformBlockIndex is returned.
If Pname is ?GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, then the number of active uniforms in the uniform block identified by UniformBlockIndex is returned.
If Pname is ?GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, then a list of the active uniform indices for the uniform block identified by UniformBlockIndex is returned. The number of elements that will be written to Params is the value of ?GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS for UniformBlockIndex .
If Pname is ?GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, ?GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER , or ?GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, then a boolean value indicating whether the uniform block identified by UniformBlockIndex is referenced by the vertex, geometry, or fragment programming stages of program, respectively, is returned.
See external documentation.
getActiveUniformBlockName(Program, UniformBlockIndex, BufSize) -> string()
Types
Retrieve the name of an active uniform block
gl:getActiveUniformBlockName retrieves the name of the active uniform block at UniformBlockIndex within Program .
Program must be the name of a program object for which the command gl:linkProgram/1 must have been called in the past, although it is not required that gl:linkProgram/1 must have succeeded. The link could have failed because the number of active uniforms exceeded the limit.
UniformBlockIndex is an active uniform block index of Program , and must be less than the value of ?GL_ACTIVE_UNIFORM_BLOCKS.
Upon success, the name of the uniform block identified by UnifomBlockIndex is returned into UniformBlockName . The name is nul-terminated. The actual number of characters written into UniformBlockName , excluding the nul terminator, is returned in Length . If Length is NULL, no length is returned.
BufSize contains the maximum number of characters (including the nul terminator) that will be written into UniformBlockName .
If an error occurs, nothing will be written to UniformBlockName or Length .
See external documentation.
uniformBlockBinding(Program, UniformBlockIndex, UniformBlockBinding) -> ok
Types
Assign a binding point to an active uniform block
Binding points for active uniform blocks are assigned using gl:uniformBlockBinding. Each of a program's active uniform blocks has a corresponding uniform buffer binding point. Program is the name of a program object for which the command gl:linkProgram/1 has been issued in the past.
If successful, gl:uniformBlockBinding specifies that Program will use the data store of the buffer object bound to the binding point UniformBlockBinding to extract the values of the uniforms in the uniform block identified by UniformBlockIndex .
When a program object is linked or re-linked, the uniform buffer object binding point assigned to each of its active uniform blocks is reset to zero.
See external documentation.
copyBufferSubData(ReadTarget, WriteTarget, ReadOffset, WriteOffset, Size) -> ok
Types
Copy part of the data store of a buffer object to the data store of another buffer object
gl:copyBufferSubData copies part of the data store attached to Readtarget to the data store attached to Writetarget . The number of basic machine units indicated by Size is copied from the source, at offset Readoffset to the destination at Writeoffset , also in basic machine units.
Readtarget and Writetarget must be ?GL_ARRAY_BUFFER, ?GL_COPY_READ_BUFFER , ?GL_COPY_WRITE_BUFFER, ?GL_ELEMENT_ARRAY_BUFFER, ?GL_PIXEL_PACK_BUFFER , ?GL_PIXEL_UNPACK_BUFFER, ?GL_TEXTURE_BUFFER, ?GL_TRANSFORM_FEEDBACK_BUFFER or ?GL_UNIFORM_BUFFER. Any of these targets may be used, although the targets ?GL_COPY_READ_BUFFER and ?GL_COPY_WRITE_BUFFER are provided specifically to allow copies between buffers without disturbing other GL state.
Readoffset , Writeoffset and Size must all be greater than or equal to zero. Furthermore, Readoffset + Size must not exceeed the size of the buffer object bound to Readtarget , and Readoffset + Size must not exceeed the size of the buffer bound to Writetarget . If the same buffer object is bound to both Readtarget and Writetarget , then the ranges specified by Readoffset , Writeoffset and Size must not overlap.
See external documentation.
drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex) -> ok
Render primitives from array data with a per-element offset
gl:drawElementsBaseVertex behaves identically to gl:drawElements/4 except that the ith element transferred by the corresponding draw call will be taken from element Indices [i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type , it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.
See external documentation.
drawRangeElementsBaseVertex(Mode, Start, End, Count, Type, Indices, Basevertex) -> ok
Types
Render primitives from array data with a per-element offset
gl:drawRangeElementsBaseVertex is a restricted form of gl:drawElementsBaseVertex/5 . Mode , Start , End , Count and Basevertex match the corresponding arguments to gl:drawElementsBaseVertex/5 , with the additional constraint that all values in the array Indices must lie between Start and End , inclusive, prior to adding Basevertex . Index values lying outside the range [ Start , End ] are treated in the same way as gl:drawElementsBaseVertex/5 . The i th element transferred by the corresponding draw call will be taken from element Indices [i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type , it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.
See external documentation.
drawElementsInstancedBaseVertex(Mode, Count, Type, Indices, Primcount, Basevertex) -> ok
Render multiple instances of a set of primitives from array data with a per-element offset
gl:drawElementsInstancedBaseVertex behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices [i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type , it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative.
See external documentation.
Types
Specifiy the vertex to be used as the source of data for flat shaded varyings
Flatshading a vertex shader varying output means to assign all vetices of the primitive the same value for that output. The vertex from which these values is derived is known as the provoking vertex and gl:provokingVertex specifies which vertex is to be used as the source of data for flat shaded varyings.
ProvokeMode must be either ?GL_FIRST_VERTEX_CONVENTION or ?GL_LAST_VERTEX_CONVENTION , and controls the selection of the vertex whose values are assigned to flatshaded varying outputs. The interpretation of these values for the supported primitive types is:
Primitive Type of PolygoniFirst Vertex Convention Last Vertex Conventionpoint i i
independent line 2i - 1 2i
line loop i
i + 1, if i < n
1, if i = nline strip ii + 1
independent triangle 3i - 2 3i
triangle strip ii + 2
triangle fan i + 1 i + 2
line adjacency 4i - 2 4i - 1
line strip adjacency i + 1 i + 2
triangle adjacency 6i - 5 6i - 1
triangle strip adjacency 2i - 1 2i + 3
If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded by using the flat qualifier when declaring the output.
See external documentation.
fenceSync(Condition, Flags) -> integer()
Create a new sync object and insert it into the GL command stream
gl:fenceSync creates a new fence sync object, inserts a fence command into the GL command stream and associates it with that sync object, and returns a non-zero name corresponding to the sync object.
When the specified Condition of the sync object is satisfied by the fence command, the sync object is signaled by the GL, causing any gl:waitSync/3 , gl:clientWaitSync/3 commands blocking in Sync to unblock. No other state is affected by gl:fenceSync or by the execution of the associated fence command.
Condition must be ?GL_SYNC_GPU_COMMANDS_COMPLETE. This condition is satisfied by completion of the fence command corresponding to the sync object and all preceding commands in the same command stream. The sync object will not be signaled until all effects from these commands on GL client and server state and the framebuffer are fully realized. Note that completion of the fence command occurs once the state of the corresponding sync object has been changed, but commands waiting on that sync object may not be unblocked until after the fence command completes.
See external documentation.
Types
Determine if a name corresponds to a sync object
gl:isSync returns ?GL_TRUE if Sync is currently the name of a sync object. If Sync is not the name of a sync object, or if an error occurs, gl:isSync returns ?GL_FALSE. Note that zero is not the name of a sync object.
See external documentation.
Types
Delete a sync object
gl:deleteSync deletes the sync object specified by Sync . If the fence command corresponding to the specified sync object has completed, or if no gl:waitSync/3 or gl:clientWaitSync/3 commands are blocking on Sync , the object is deleted immediately. Otherwise, Sync is flagged for deletion and will be deleted when it is no longer associated with any fence command and is no longer blocking any gl:waitSync/3 or gl:clientWaitSync/3 command. In either case, after gl:deleteSync returns, the name Sync is invalid and can no longer be used to refer to the sync object.
gl:deleteSync will silently ignore a Sync value of zero.
See external documentation.
clientWaitSync(Sync, Flags, Timeout) -> enum()
Types
Block and wait for a sync object to become signaled
gl:clientWaitSync causes the client to block and wait for the sync object specified by Sync to become signaled. If Sync is signaled when gl:clientWaitSync is called, gl:clientWaitSync returns immediately, otherwise it will block and wait for up to Timeout nanoseconds for Sync to become signaled.
The return value is one of four status values:
?GL_ALREADY_SIGNALED indicates that Sync was signaled at the time that gl:clientWaitSync was called.
?GL_TIMEOUT_EXPIRED indicates that at least Timeout nanoseconds passed and Sync did not become signaled.
?GL_CONDITION_SATISFIED indicates that Sync was signaled before the timeout expired.
?GL_WAIT_FAILED indicates that an error occurred. Additionally, an OpenGL error will be generated.
See external documentation.
waitSync(Sync, Flags, Timeout) -> ok
Types
Instruct the GL server to block until the specified sync object becomes signaled
gl:waitSync causes the GL server to block and wait until Sync becomes signaled. Sync is the name of an existing sync object upon which to wait. Flags and Timeout are currently not used and must be set to zero and the special value ?GL_TIMEOUT_IGNORED , respectively
Flags and Timeout are placeholders for anticipated future extensions of sync object capabilities. They must have these reserved values in order that existing code calling gl:waitSync operate properly in the presence of such extensions.. gl:waitSync will always wait no longer than an implementation-dependent timeout. The duration of this timeout in nanoseconds may be queried by calling gl:getBooleanv/1 with the parameter ?GL_MAX_SERVER_WAIT_TIMEOUT . There is currently no way to determine whether gl:waitSync unblocked because the timeout expired or because the sync object being waited on was signaled.
If an error occurs, gl:waitSync does not cause the GL server to block.
See external documentation.
getInteger64v(Pname) -> [integer()]
Types
See getBooleanv/1
getSynciv(Sync, Pname, BufSize) -> [integer()]
Query the properties of a sync object
gl:getSynciv retrieves properties of a sync object. Sync specifies the name of the sync object whose properties to retrieve.
On success, gl:getSynciv replaces up to BufSize integers in Values with the corresponding property values of the object being queried. The actual number of integers replaced is returned in the variable whose address is specified in Length . If Length is NULL, no length is returned.
If Pname is ?GL_OBJECT_TYPE, a single value representing the specific type of the sync object is placed in Values . The only type supported is ?GL_SYNC_FENCE .
If Pname is ?GL_SYNC_STATUS, a single value representing the status of the sync object (?GL_SIGNALED or ?GL_UNSIGNALED) is placed in Values .
If Pname is ?GL_SYNC_CONDITION, a single value representing the condition of the sync object is placed in Values . The only condition supported is ?GL_SYNC_GPU_COMMANDS_COMPLETE .
If Pname is ?GL_SYNC_FLAGS, a single value representing the flags with which the sync object was created is placed in Values . No flags are currently supported
Flags is expected to be used in future extensions to the sync objects..
If an error occurs, nothing will be written to Values or Length .
See external documentation.
texImage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations) -> ok
Types
Establish the data storage, format, dimensions, and number of samples of a multisample texture's image
gl:texImage2DMultisample establishes the data storage, format, dimensions and number of samples of a multisample texture's image.
Target must be ?GL_TEXTURE_2D_MULTISAMPLE or ?GL_PROXY_TEXTURE_2D_MULTISAMPLE . Width and Height are the dimensions in texels of the texture, and must be in the range zero to ?GL_MAX_TEXTURE_SIZE - 1. Samples specifies the number of samples in the image and must be in the range zero to ?GL_MAX_SAMPLES - 1.
Internalformat must be a color-renderable, depth-renderable, or stencil-renderable format.
If Fixedsamplelocations is ?GL_TRUE, the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or size of the image.
When a multisample texture is accessed in a shader, the access takes one vector of integers describing which texel to fetch and an integer corresponding to the sample numbers describing which sample within the texel to fetch. No standard sampling instructions are allowed on the multisample texture targets.
See external documentation.
texImage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations) -> ok
Types
Establish the data storage, format, dimensions, and number of samples of a multisample texture's image
gl:texImage3DMultisample establishes the data storage, format, dimensions and number of samples of a multisample texture's image.
Target must be ?GL_TEXTURE_2D_MULTISAMPLE_ARRAY or ?GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY . Width and Height are the dimensions in texels of the texture, and must be in the range zero to ?GL_MAX_TEXTURE_SIZE - 1. Depth is the number of array slices in the array texture's image. Samples specifies the number of samples in the image and must be in the range zero to ?GL_MAX_SAMPLES - 1.
Internalformat must be a color-renderable, depth-renderable, or stencil-renderable format.
If Fixedsamplelocations is ?GL_TRUE, the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or size of the image.
When a multisample texture is accessed in a shader, the access takes one vector of integers describing which texel to fetch and an integer corresponding to the sample numbers describing which sample within the texel to fetch. No standard sampling instructions are allowed on the multisample texture targets.
See external documentation.
getMultisamplefv(Pname, Index) -> {float(), float()}
Retrieve the location of a sample
gl:getMultisamplefv queries the location of a given sample. Pname specifies the sample parameter to retrieve and must be ?GL_SAMPLE_POSITION. Index corresponds to the sample for which the location should be returned. The sample location is returned as two floating-point values in Val[0] and Val[1] , each between 0 and 1, corresponding to the X and Y locations respectively in the GL pixel space of that sample. (0.5, 0.5) this corresponds to the pixel center. Index must be between zero and the value of ?GL_SAMPLES - 1.
If the multisample mode does not have fixed sample locations, the returned values may only reflect the locations of samples within some pixels.
See external documentation.
sampleMaski(Index, Mask) -> ok
Types
Set the value of a sub-word of the sample mask
gl:sampleMaski sets one 32-bit sub-word of the multi-word sample mask, ?GL_SAMPLE_MASK_VALUE .
MaskIndex specifies which 32-bit sub-word of the sample mask to update, and Mask specifies the new value to use for that sub-word. MaskIndex must be less than the value of ?GL_MAX_SAMPLE_MASK_WORDS. Bit B of mask word M corresponds to sample 32 x M + B.
See external documentation.
namedStringARB(Type, Name, String) -> ok
deleteNamedStringARB(Name) -> ok
Types
compileShaderIncludeARB(Shader, Path) -> ok
Types
isNamedStringARB(Name) -> 0 | 1
Types
getNamedStringARB(Name, BufSize) -> string()
Types
getNamedStringivARB(Name, Pname) -> integer()
bindFragDataLocationIndexed(Program, ColorNumber, Index, Name) -> ok
Types
getFragDataIndex(Program, Name) -> integer()
Types
Query the bindings of color indices to user-defined varying out variables
gl:getFragDataIndex returns the index of the fragment color to which the variable Name was bound when the program object Program was last linked. If Name is not a varying out variable of Program , or if an error occurs, -1 will be returned.
See external documentation.
genSamplers(Count) -> [integer()]
Types
Generate sampler object names
gl:genSamplers returns N sampler object names in Samplers . There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to gl:genSamplers .
Sampler object names returned by a call to gl:genSamplers are not returned by subsequent calls, unless they are first deleted with gl:deleteSamplers/1 .
The names returned in Samplers are marked as used, for the purposes of gl:genSamplers only, but they acquire state and type only when they are first bound.
See external documentation.
deleteSamplers(Samplers) -> ok
Types
Delete named sampler objects
gl:deleteSamplers deletes N sampler objects named by the elements of the array Ids . After a sampler object is deleted, its name is again unused. If a sampler object that is currently bound to a sampler unit is deleted, it is as though gl:bindSampler/2 is called with unit set to the unit the sampler is bound to and sampler zero. Unused names in samplers are silently ignored, as is the reserved name zero.
See external documentation.
Types
Determine if a name corresponds to a sampler object
gl:isSampler returns ?GL_TRUE if Id is currently the name of a sampler object. If Id is zero, or is a non-zero value that is not currently the name of a sampler object, or if an error occurs, gl:isSampler returns ?GL_FALSE.
A name returned by gl:genSamplers/1 , is the name of a sampler object.
See external documentation.
bindSampler(Unit, Sampler) -> ok
Types
Bind a named sampler to a texturing target
gl:bindSampler binds Sampler to the texture unit at index Unit . Sampler must be zero or the name of a sampler object previously returned from a call to gl:genSamplers/1 . Unit must be less than the value of ?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS.
When a sampler object is bound to a texture unit, its state supersedes that of the texture object bound to that texture unit. If the sampler name zero is bound to a texture unit, the currently bound texture's sampler state becomes active. A single sampler object may be bound to multiple texture units simultaneously.
See external documentation.
samplerParameteri(Sampler, Pname, Param) -> ok
Set sampler parameters
gl:samplerParameter assigns the value or values in Params to the sampler parameter specified as Pname . Sampler specifies the sampler object to be modified, and must be the name of a sampler object previously returned from a call to gl:genSamplers/1 . The following symbols are accepted in Pname :
?GL_TEXTURE_MIN_FILTER: The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps.
A mipmap is an ordered set of arrays representing the same image at progressively lower resolutions. If the texture has dimensions 2 n×2 m, there are max(n m)+1 mipmaps. The first mipmap is the original texture, with dimensions 2 n×2 m. Each subsequent mipmap has dimensions 2(k-1)×2(l-1), where 2 k×2 l are the dimensions of the previous mipmap, until either k=0 or l=0. At that point, subsequent mipmaps have dimension 1×2(l-1) or 2(k-1)×1 until the final mipmap, which has dimension 1×1. To define the mipmaps, call gl:texImage1D/8 , gl:texImage2D/9 , gl:texImage3D/10 , gl:copyTexImage1D/7 , or gl:copyTexImage2D/8 with the level argument indicating the order of the mipmaps. Level 0 is the original texture; level max(n m) is the final 1×1 mipmap.
Params supplies a function for minifying the texture as one of the following:
?GL_NEAREST: Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
?GL_LINEAR: Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of ?GL_TEXTURE_WRAP_S and ?GL_TEXTURE_WRAP_T, and on the exact mapping.
?GL_NEAREST_MIPMAP_NEAREST: Chooses the mipmap that most closely matches the size of the pixel being textured and uses the ?GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value.
?GL_LINEAR_MIPMAP_NEAREST: Chooses the mipmap that most closely matches the size of the pixel being textured and uses the ?GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
?GL_NEAREST_MIPMAP_LINEAR: Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the ?GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
?GL_LINEAR_MIPMAP_LINEAR: Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the ?GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
As more texture elements are sampled in the minification process, fewer aliasing artifacts will be apparent. While the ?GL_NEAREST and ?GL_LINEAR minification functions can be faster than the other four, they sample only one or four texture elements to determine the texture value of the pixel being rendered and can produce moire patterns or ragged transitions. The initial value of ?GL_TEXTURE_MIN_FILTER is ?GL_NEAREST_MIPMAP_LINEAR .
?GL_TEXTURE_MAG_FILTER: The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either ?GL_NEAREST or ?GL_LINEAR (see below). ?GL_NEAREST is generally faster than ?GL_LINEAR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth. The initial value of ?GL_TEXTURE_MAG_FILTER is ?GL_LINEAR.
?GL_NEAREST: Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
?GL_LINEAR: Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of ?GL_TEXTURE_WRAP_S and ?GL_TEXTURE_WRAP_T, and on the exact mapping.
?GL_TEXTURE_MIN_LOD: Sets the minimum level-of-detail parameter. This floating-point value limits the selection of highest resolution mipmap (lowest mipmap level). The initial value is -1000.
?GL_TEXTURE_MAX_LOD: Sets the maximum level-of-detail parameter. This floating-point value limits the selection of the lowest resolution mipmap (highest mipmap level). The initial value is 1000.
?GL_TEXTURE_WRAP_S: Sets the wrap parameter for texture coordinate s to either ?GL_CLAMP_TO_EDGE , ?GL_MIRRORED_REPEAT, or ?GL_REPEAT. ?GL_CLAMP_TO_BORDER causes the s coordinate to be clamped to the range [(-1 2/N) 1+(1 2/N)], where N is the size of the texture in the direction of clamping.?GL_CLAMP_TO_EDGE causes s coordinates to be clamped to the range [(1 2/N) 1-(1 2/N)], where N is the size of the texture in the direction of clamping. ?GL_REPEAT causes the integer part of the s coordinate to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. ?GL_MIRRORED_REPEAT causes the s coordinate to be set to the fractional part of the texture coordinate if the integer part of s is even; if the integer part of s is odd, then the s texture coordinate is set to 1-frac(s), where frac(s) represents the fractional part of s. Initially, ?GL_TEXTURE_WRAP_S is set to ?GL_REPEAT.
?GL_TEXTURE_WRAP_T: Sets the wrap parameter for texture coordinate t to either ?GL_CLAMP_TO_EDGE , ?GL_MIRRORED_REPEAT, or ?GL_REPEAT. See the discussion under ?GL_TEXTURE_WRAP_S . Initially, ?GL_TEXTURE_WRAP_T is set to ?GL_REPEAT.
?GL_TEXTURE_WRAP_R: Sets the wrap parameter for texture coordinate r to either ?GL_CLAMP_TO_EDGE , ?GL_MIRRORED_REPEAT, or ?GL_REPEAT. See the discussion under ?GL_TEXTURE_WRAP_S . Initially, ?GL_TEXTURE_WRAP_R is set to ?GL_REPEAT.
?GL_TEXTURE_BORDER_COLOR: The data in Params specifies four values that define the border values that should be used for border texels. If a texel is sampled from the border of the texture, the values of ?GL_TEXTURE_BORDER_COLOR are interpreted as an RGBA color to match the texture's internal format and substituted for the non-existent texel data. If the texture contains depth components, the first component of ?GL_TEXTURE_BORDER_COLOR is interpreted as a depth value. The initial value is (0.0, 0.0, 0.0, 0.0).
?GL_TEXTURE_COMPARE_MODE: Specifies the texture comparison mode for currently bound textures. That is, a texture whose internal format is ?GL_DEPTH_COMPONENT_*; see gl:texImage2D/9 ) Permissible values are:
?GL_COMPARE_REF_TO_TEXTURE: Specifies that the interpolated and clamped r texture coordinate should be compared to the value in the currently bound texture. See the discussion of ?GL_TEXTURE_COMPARE_FUNC for details of how the comparison is evaluated. The result of the comparison is assigned to the red channel.
?GL_NONE: Specifies that the red channel should be assigned the appropriate value from the currently bound texture.
?GL_TEXTURE_COMPARE_FUNC: Specifies the comparison operator used when ?GL_TEXTURE_COMPARE_MODE is set to ?GL_COMPARE_REF_TO_TEXTURE. Permissible values are:
Texture Comparison FunctionComputed result?GL_LEQUAL result={1.0 0.0 r<=(D t) r>(D t))
?GL_GEQUAL result={1.0 0.0 r>=(D t) r<(D t))
?GL_LESS result={1.0 0.0 r<(D t) r>=(D t))
?GL_GREATER result={1.0 0.0 r>(D t) r<=(D t))
?GL_EQUAL result={1.0 0.0 r=(D t) r≠ (D t))
?GL_NOTEQUAL result={1.0 0.0 r≠(D t) r=(D t))
?GL_ALWAYS result=1.0
?GL_NEVER result=0.0
where r is the current interpolated texture coordinate, and D t is the texture value sampled from the currently bound texture. result is assigned to R t.
See external documentation.
samplerParameteriv(Sampler, Pname, Param) -> ok
samplerParameterf(Sampler, Pname, Param) -> ok
samplerParameterfv(Sampler, Pname, Param) -> ok
samplerParameterIiv(Sampler, Pname, Param) -> ok
samplerParameterIuiv(Sampler, Pname, Param) -> ok
getSamplerParameteriv(Sampler, Pname) -> [integer()]
Return sampler parameter values
gl:getSamplerParameter returns in Params the value or values of the sampler parameter specified as Pname . Sampler defines the target sampler, and must be the name of an existing sampler object, returned from a previous call to gl:genSamplers/1 . Pname accepts the same symbols as gl:samplerParameteri/3 , with the same interpretations:
?GL_TEXTURE_MAG_FILTER: Returns the single-valued texture magnification filter, a symbolic constant. The initial value is ?GL_LINEAR.
?GL_TEXTURE_MIN_FILTER: Returns the single-valued texture minification filter, a symbolic constant. The initial value is ?GL_NEAREST_MIPMAP_LINEAR.
?GL_TEXTURE_MIN_LOD: Returns the single-valued texture minimum level-of-detail value. The initial value is -1000.
?GL_TEXTURE_MAX_LOD: Returns the single-valued texture maximum level-of-detail value. The initial value is 1000.
?GL_TEXTURE_WRAP_S: Returns the single-valued wrapping function for texture coordinate s, a symbolic constant. The initial value is ?GL_REPEAT.
?GL_TEXTURE_WRAP_T: Returns the single-valued wrapping function for texture coordinate t, a symbolic constant. The initial value is ?GL_REPEAT.
?GL_TEXTURE_WRAP_R: Returns the single-valued wrapping function for texture coordinate r, a symbolic constant. The initial value is ?GL_REPEAT.
?GL_TEXTURE_BORDER_COLOR: Returns four integer or floating-point numbers that comprise the RGBA color of the texture border. Floating-point values are returned in the range [0 1]. Integer values are returned as a linear mapping of the internal floating-point representation such that 1.0 maps to the most positive representable integer and -1.0 maps to the most negative representable integer. The initial value is (0, 0, 0, 0).
?GL_TEXTURE_COMPARE_MODE: Returns a single-valued texture comparison mode, a symbolic constant. The initial value is ?GL_NONE. See gl:samplerParameteri/3 .
?GL_TEXTURE_COMPARE_FUNC: Returns a single-valued texture comparison function, a symbolic constant. The initial value is ?GL_LEQUAL. See gl:samplerParameteri/3 .
See external documentation.
getSamplerParameterIiv(Sampler, Pname) -> [integer()]
getSamplerParameterfv(Sampler, Pname) -> [float()]
getSamplerParameterIuiv(Sampler, Pname) -> [integer()]
queryCounter(Id, Target) -> ok
Record the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed.
gl:queryCounter causes the GL to record the current time into the query object named Id . Target must be ?GL_TIMESTAMP. The time is recorded after all previous commands on the GL client and server state and the framebuffer have been fully realized. When the time is recorded, the query result for that object is marked available. gl:queryCounter timer queries can be used within a gl:beginQuery/2 / gl:beginQuery/2 block where the target is ?GL_TIME_ELAPSED and it does not affect the result of that query object.
See external documentation.
getQueryObjecti64v(Id, Pname) -> integer()
getQueryObjectui64v(Id, Pname) -> integer()
drawArraysIndirect(Mode, Indirect) -> ok
Render primitives from array data, taking parameters from memory
gl:drawArraysIndirect specifies multiple geometric primitives with very few subroutine calls. gl:drawArraysIndirect behaves similarly to gl:drawArraysInstancedBaseInstance/5 , execept that the parameters to gl:drawArraysInstancedBaseInstance/5 are stored in memory at the address given by Indirect .
The parameters addressed by Indirect are packed into a structure that takes the form (in C): typedef struct { uint count; uint primCount; uint first; uint baseInstance; } DrawArraysIndirectCommand; const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect; glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
If a buffer is bound to the ?GL_DRAW_INDIRECT_BUFFER binding at the time of a call to gl:drawArraysIndirect, Indirect is interpreted as an offset, in basic machine units, into that buffer and the parameter data is read from the buffer rather than from client memory.
In contrast to gl:drawArraysInstancedBaseInstance/5 , the first member of the parameter structure is unsigned, and out-of-range indices do not generate an error.
Vertex attributes that are modified by gl:drawArraysIndirect have an unspecified value after gl:drawArraysIndirect returns. Attributes that aren't modified remain well defined.
See external documentation.
drawElementsIndirect(Mode, Type, Indirect) -> ok
Render indexed primitives from array data, taking parameters from memory
gl:drawElementsIndirect specifies multiple indexed geometric primitives with very few subroutine calls. gl:drawElementsIndirect behaves similarly to gl:drawElementsInstancedBaseVertexBaseInstance/7 , execpt that the parameters to gl:drawElementsInstancedBaseVertexBaseInstance/7 are stored in memory at the address given by Indirect .
The parameters addressed by Indirect are packed into a structure that takes the form (in C): typedef struct { uint count; uint primCount; uint firstIndex; uint baseVertex; uint baseInstance; } DrawElementsIndirectCommand;
gl:drawElementsIndirect is equivalent to: void glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect) { const DrawElementsIndirectCommand *cmd = (const DrawElementsIndirectCommand *)indirect; glDrawElementsInstancedBaseVertexBaseInstance(mode, cmd->count, type, cmd->firstIndex + size-of-type, cmd->primCount, cmd->baseVertex, cmd->baseInstance); }
If a buffer is bound to the ?GL_DRAW_INDIRECT_BUFFER binding at the time of a call to gl:drawElementsIndirect, Indirect is interpreted as an offset, in basic machine units, into that buffer and the parameter data is read from the buffer rather than from client memory.
Note that indices stored in client memory are not supported. If no buffer is bound to the ?GL_ELEMENT_ARRAY_BUFFER binding, an error will be generated.
The results of the operation are undefined if the reservedMustBeZero member of the parameter structure is non-zero. However, no error is generated in this case.
Vertex attributes that are modified by gl:drawElementsIndirect have an unspecified value after gl:drawElementsIndirect returns. Attributes that aren't modified remain well defined.
See external documentation.
Types
See uniform1f/2
uniform2d(Location, X, Y) -> ok
Types
See uniform1f/2
uniform3d(Location, X, Y, Z) -> ok
Types
See uniform1f/2
uniform4d(Location, X, Y, Z, W) -> ok
Types
See uniform1f/2
uniform1dv(Location, Value) -> ok
Types
See uniform1f/2
uniform2dv(Location, Value) -> ok
Types
See uniform1f/2
uniform3dv(Location, Value) -> ok
Types
See uniform1f/2
uniform4dv(Location, Value) -> ok
Types
See uniform1f/2
uniformMatrix2dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix2x3dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix2x4dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3x2dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix3x4dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4x2dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
uniformMatrix4x3dv(Location, Transpose, Value) -> ok
Types
See uniform1f/2
getUniformdv(Program, Location) -> matrix()
Types
See getUniformfv/2
getSubroutineUniformLocation(Program, Shadertype, Name) -> integer()
Retrieve the location of a subroutine uniform of a given shader stage within a program
gl:getSubroutineUniformLocation returns the location of the subroutine uniform variable Name in the shader stage of type Shadertype attached to Program , with behavior otherwise identical to gl:getUniformLocation/2 .
If Name is not the name of a subroutine uniform in the shader stage, -1 is returned, but no error is generated. If Name is the name of a subroutine uniform in the shader stage, a value between zero and the value of ?GL_ACTIVE_SUBROUTINE_LOCATIONS minus one will be returned. Subroutine locations are assigned using consecutive integers in the range from zero to the value of ?GL_ACTIVE_SUBROUTINE_LOCATIONS minus one for the shader stage. For active subroutine uniforms declared as arrays, the declared array elements are assigned consecutive locations.
See external documentation.
getSubroutineIndex(Program, Shadertype, Name) -> integer()
Retrieve the index of a subroutine uniform of a given shader stage within a program
gl:getSubroutineIndex returns the index of a subroutine uniform within a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query shader subroutine index. Name contains the null-terminated name of the subroutine uniform whose name to query.
If Name is not the name of a subroutine uniform in the shader stage, ?GL_INVALID_INDEX is returned, but no error is generated. If Name is the name of a subroutine uniform in the shader stage, a value between zero and the value of ?GL_ACTIVE_SUBROUTINES minus one will be returned. Subroutine indices are assigned using consecutive integers in the range from zero to the value of ?GL_ACTIVE_SUBROUTINES minus one for the shader stage.
See external documentation.
getActiveSubroutineUniformName(Program, Shadertype, Index, Bufsize) -> string()
Query the name of an active shader subroutine uniform
gl:getActiveSubroutineUniformName retrieves the name of an active shader subroutine uniform. Program contains the name of the program containing the uniform. Shadertype specifies the stage for which which the uniform location, given by Index , is valid. Index must be between zero and the value of ?GL_ACTIVE_SUBROUTINE_UNIFORMS minus one for the shader stage.
The uniform name is returned as a null-terminated string in Name . The actual number of characters written into Name , excluding the null terminator is returned in Length . If Length is ?NULL, no length is returned. The maximum number of characters that may be written into Name , including the null terminator, is specified by Bufsize . The length of the longest subroutine uniform name in Program and Shadertype is given by the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH, which can be queried with gl:getProgramStageiv/3 .
See external documentation.
getActiveSubroutineName(Program, Shadertype, Index, Bufsize) -> string()
Query the name of an active shader subroutine
gl:getActiveSubroutineName queries the name of an active shader subroutine uniform from the program object given in Program . Index specifies the index of the shader subroutine uniform within the shader stage given by Stage , and must between zero and the value of ?GL_ACTIVE_SUBROUTINES minus one for the shader stage.
The name of the selected subroutine is returned as a null-terminated string in Name . The actual number of characters written into Name , not including the null-terminator, is is returned in Length . If Length is ?NULL, no length is returned. The maximum number of characters that may be written into Name , including the null-terminator, is given in Bufsize .
See external documentation.
uniformSubroutinesuiv(Shadertype, Indices) -> ok
Load active subroutine uniforms
gl:uniformSubroutines loads all active subroutine uniforms for shader stage Shadertype of the current program with subroutine indices from Indices , storing Indices[i] into the uniform at location I . Count must be equal to the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the program currently in use at shader stage Shadertype . Furthermore, all values in Indices must be less than the value of ?GL_ACTIVE_SUBROUTINES for the shader stage.
See external documentation.
getUniformSubroutineuiv(Shadertype, Location) -> {integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()}
Retrieve the value of a subroutine uniform of a given shader stage of the current program
gl:getUniformSubroutine retrieves the value of the subroutine uniform at location Location for shader stage Shadertype of the current program. Location must be less than the value of ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the shader currently in use at shader stage Shadertype . The value of the subroutine uniform is returned in Values .
See external documentation.
getProgramStageiv(Program, Shadertype, Pname) -> integer()
Retrieve properties of a program object corresponding to a specified shader stage
gl:getProgramStage queries a parameter of a shader stage attached to a program object. Program contains the name of the program to which the shader is attached. Shadertype specifies the stage from which to query the parameter. Pname specifies which parameter should be queried. The value or values of the parameter to be queried is returned in the variable whose address is given in Values .
If Pname is ?GL_ACTIVE_SUBROUTINE_UNIFORMS, the number of active subroutine variables in the stage is returned in Values .
If Pname is ?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS, the number of active subroutine variable locations in the stage is returned in Values .
If Pname is ?GL_ACTIVE_SUBROUTINES, the number of active subroutines in the stage is returned in Values .
If Pname is ?GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH, the length of the longest subroutine uniform for the stage is returned in Values .
If Pname is ?GL_ACTIVE_SUBROUTINE_MAX_LENGTH, the length of the longest subroutine name for the stage is returned in Values . The returned name length includes space for the null-terminator.
If there is no shader present of type Shadertype , the returned value will be consistent with a shader containing no subroutines or subroutine uniforms.
See external documentation.
patchParameteri(Pname, Value) -> ok
Specifies the parameters for patch primitives
gl:patchParameter specifies the parameters that will be used for patch primitives. Pname specifies the parameter to modify and must be either ?GL_PATCH_VERTICES, ?GL_PATCH_DEFAULT_OUTER_LEVEL or ?GL_PATCH_DEFAULT_INNER_LEVEL. For gl:patchParameteri, Value specifies the new value for the parameter specified by Pname . For gl:patchParameterfv, Values specifies the address of an array containing the new values for the parameter specified by Pname .
When Pname is ?GL_PATCH_VERTICES, Value specifies the number of vertices that will be used to make up a single patch primitive. Patch primitives are consumed by the tessellation control shader (if present) and subsequently used for tessellation. When primitives are specified using gl:drawArrays/3 or a similar function, each patch will be made from Parameter control points, each represented by a vertex taken from the enabeld vertex arrays. Parameter must be greater than zero, and less than or equal to the value of ?GL_MAX_PATCH_VERTICES.
When Pname is ?GL_PATCH_DEFAULT_OUTER_LEVEL or ?GL_PATCH_DEFAULT_INNER_LEVEL , Values contains the address of an array contiaining the default outer or inner tessellation levels, respectively, to be used when no tessellation control shader is present.
See external documentation.
patchParameterfv(Pname, Values) -> ok
bindTransformFeedback(Target, Id) -> ok
Bind a transform feedback object
gl:bindTransformFeedback binds the transform feedback object with name Id to the current GL state. Id must be a name previously returned from a call to gl:genTransformFeedbacks/1 . If Id has not previously been bound, a new transform feedback object with name Id and initialized with with the default transform state vector is created.
In the initial state, a default transform feedback object is bound and treated as a transform feedback object with a name of zero. If the name zero is subsequently bound, the default transform feedback object is again bound to the GL state.
While a transform feedback buffer object is bound, GL operations on the target to which it is bound affect the bound transform feedback object, and queries of the target to which a transform feedback object is bound return state from the bound object. When buffer objects are bound for transform feedback, they are attached to the currently bound transform feedback object. Buffer objects are used for trans- form feedback only if they are attached to the currently bound transform feedback object.
See external documentation.
deleteTransformFeedbacks(Ids) -> ok
Types
Delete transform feedback objects
gl:deleteTransformFeedbacks deletes the N transform feedback objects whose names are stored in the array Ids . Unused names in Ids are ignored, as is the name zero. After a transform feedback object is deleted, its name is again unused and it has no contents. If an active transform feedback object is deleted, its name immediately becomes unused, but the underlying object is not deleted until it is no longer active.
See external documentation.
genTransformFeedbacks(N) -> [integer()]
Types
Reserve transform feedback object names
gl:genTransformFeedbacks returns N previously unused transform feedback object names in Ids . These names are marked as used, for the purposes of gl:genTransformFeedbacks only, but they acquire transform feedback state only when they are first bound.
See external documentation.
isTransformFeedback(Id) -> 0 | 1
Types
Determine if a name corresponds to a transform feedback object
gl:isTransformFeedback returns ?GL_TRUE if Id is currently the name of a transform feedback object. If Id is zero, or if ?id is not the name of a transform feedback object, or if an error occurs, gl:isTransformFeedback returns ?GL_FALSE. If Id is a name returned by gl:genTransformFeedbacks/1 , but that has not yet been bound through a call to gl:bindTransformFeedback/2 , then the name is not a transform feedback object and gl:isTransformFeedback returns ?GL_FALSE .
See external documentation.
pauseTransformFeedback() -> ok
Pause transform feedback operations
gl:pauseTransformFeedback pauses transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.
See external documentation.
resumeTransformFeedback() -> ok
Resume transform feedback operations
gl:resumeTransformFeedback resumes transform feedback operations on the currently active transform feedback object. When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the object results in an error. However, a new transform feedback object may be bound while transform feedback is paused.
See external documentation.
drawTransformFeedback(Mode, Id) -> ok
Render primitives using a count derived from a transform feedback object
gl:drawTransformFeedback draws primitives of a type specified by Mode using a count retrieved from the transform feedback specified by Id . Calling gl:drawTransformFeedback is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by Id .
See external documentation.
drawTransformFeedbackStream(Mode, Id, Stream) -> ok
Render primitives using a count derived from a specifed stream of a transform feedback object
gl:drawTransformFeedbackStream draws primitives of a type specified by Mode using a count retrieved from the transform feedback stream specified by Stream of the transform feedback object specified by Id . Calling gl:drawTransformFeedbackStream is equivalent to calling gl:drawArrays/3 with Mode as specified, First set to zero, and Count set to the number of vertices captured on vertex stream Stream the last time transform feedback was active on the transform feedback object named by Id .
Calling gl:drawTransformFeedback/2 is equivalent to calling gl:drawTransformFeedbackStream with Stream set to zero.
See external documentation.
beginQueryIndexed(Target, Index, Id) -> ok
endQueryIndexed(Target, Index) -> ok
Delimit the boundaries of a query object on an indexed target
gl:beginQueryIndexed and gl:endQueryIndexed/2 delimit the boundaries of a query object. Query must be a name previously returned from a call to gl:genQueries/1 . If a query object with name Id does not yet exist it is created with the type determined by Target . Target must be one of ?GL_SAMPLES_PASSED, ?GL_ANY_SAMPLES_PASSED , ?GL_PRIMITIVES_GENERATED, ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or ?GL_TIME_ELAPSED . The behavior of the query object depends on its type and is as follows.
Index specifies the index of the query target and must be between a Target -specific maximum.
If Target is ?GL_SAMPLES_PASSED, Id must be an unused name, or the name of an existing occlusion query object. When gl:beginQueryIndexed is executed, the query object's samples-passed counter is reset to 0. Subsequent rendering will increment the counter for every sample that passes the depth test. If the value of ?GL_SAMPLE_BUFFERS is 0, then the samples-passed count is incremented by 1 for each fragment. If the value of ?GL_SAMPLE_BUFFERS is 1, then the samples-passed count is incremented by the number of samples whose coverage bit is set. However, implementations, at their discression may instead increase the samples-passed count by the value of ?GL_SAMPLES if any sample in the fragment is covered. When gl:endQueryIndexed is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT. When Target is ?GL_SAMPLES_PASSED, Index must be zero.
If Target is ?GL_ANY_SAMPLES_PASSED, Id must be an unused name, or the name of an existing boolean occlusion query object. When gl:beginQueryIndexed is executed, the query object's samples-passed flag is reset to ?GL_FALSE. Subsequent rendering causes the flag to be set to ?GL_TRUE if any sample passes the depth test. When gl:endQueryIndexed is executed, the samples-passed flag is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT. When Target is ?GL_ANY_SAMPLES_PASSED , Index must be zero.
If Target is ?GL_PRIMITIVES_GENERATED, Id must be an unused name, or the name of an existing primitive query object previously bound to the ?GL_PRIMITIVES_GENERATED query binding. When gl:beginQueryIndexed is executed, the query object's primitives-generated counter is reset to 0. Subsequent rendering will increment the counter once for every vertex that is emitted from the geometry shader to the stream given by Index , or from the vertex shader if Index is zero and no geometry shader is present. When gl:endQueryIndexed is executed, the primitives-generated counter for stream Index is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT. When Target is ?GL_PRIMITIVES_GENERATED , Index must be less than the value of ?GL_MAX_VERTEX_STREAMS.
If Target is ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, Id must be an unused name, or the name of an existing primitive query object previously bound to the ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN query binding. When gl:beginQueryIndexed is executed, the query object's primitives-written counter for the stream specified by Index is reset to 0. Subsequent rendering will increment the counter once for every vertex that is written into the bound transform feedback buffer(s) for stream Index . If transform feedback mode is not activated between the call to gl:beginQueryIndexed and gl:endQueryIndexed, the counter will not be incremented. When gl:endQueryIndexed is executed, the primitives-written counter for stream Index is assigned to the query object's result value. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT. When Target is ?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN , Index must be less than the value of ?GL_MAX_VERTEX_STREAMS.
If Target is ?GL_TIME_ELAPSED, Id must be an unused name, or the name of an existing timer query object previously bound to the ?GL_TIME_ELAPSED query binding. When gl:beginQueryIndexed is executed, the query object's time counter is reset to 0. When gl:endQueryIndexed is executed, the elapsed server time that has passed since the call to gl:beginQueryIndexed is written into the query object's time counter. This value can be queried by calling gl:getQueryObjectiv/2 with Pname ?GL_QUERY_RESULT. When Target is ?GL_TIME_ELAPSED, Index must be zero.
Querying the ?GL_QUERY_RESULT implicitly flushes the GL pipeline until the rendering delimited by the query object has completed and the result is available. ?GL_QUERY_RESULT_AVAILABLE can be queried to determine if the result is immediately available or if the rendering is not yet complete.
See external documentation.
getQueryIndexediv(Target, Index, Pname) -> integer()
Return parameters of an indexed query object target
gl:getQueryIndexediv returns in Params a selected parameter of the indexed query object target specified by Target and Index . Index specifies the index of the query object target and must be between zero and a target-specific maxiumum.
Pname names a specific query object target parameter. When Pname is ?GL_CURRENT_QUERY , the name of the currently active query for the specified Index of Target , or zero if no query is active, will be placed in Params . If Pname is ?GL_QUERY_COUNTER_BITS , the implementation-dependent number of bits used to hold the result of queries for Target is returned in Params .
See external documentation.
Release resources consumed by the implementation's shader compiler
gl:releaseShaderCompiler provides a hint to the implementation that it may free internal resources associated with its shader compiler. gl:compileShader/1 may subsequently be called and the implementation may at that time reallocate resources previously freed by the call to gl:releaseShaderCompiler.
See external documentation.
shaderBinary(Shaders, Binaryformat, Binary) -> ok
Load pre-compiled shader binaries
gl:shaderBinary loads pre-compiled shader binary code into the Count shader objects whose handles are given in Shaders . Binary points to Length bytes of binary shader code stored in client memory. BinaryFormat specifies the format of the pre-compiled code.
The binary image contained in Binary will be decoded according to the extension specification defining the specified BinaryFormat token. OpenGL does not define any specific binary formats, but it does provide a mechanism to obtain token vaues for such formats provided by such extensions.
Depending on the types of the shader objects in Shaders , gl:shaderBinary will individually load binary vertex or fragment shaders, or load an executable binary that contains an optimized pair of vertex and fragment shaders stored in the same binary.
See external documentation.
getShaderPrecisionFormat(Shadertype, Precisiontype) -> {Range::{integer(), integer()}, Precision::integer()}
Retrieve the range and precision for numeric formats supported by the shader compiler
gl:getShaderPrecisionFormat retrieves the numeric range and precision for the implementation's representation of quantities in different numeric formats in specified shader type. ShaderType specifies the type of shader for which the numeric precision and range is to be retrieved and must be one of ?GL_VERTEX_SHADER or ?GL_FRAGMENT_SHADER. PrecisionType specifies the numeric format to query and must be one of ?GL_LOW_FLOAT, ?GL_MEDIUM_FLOAT ?GL_HIGH_FLOAT, ?GL_LOW_INT, ?GL_MEDIUM_INT, or ?GL_HIGH_INT.
Range points to an array of two integers into which the format's numeric range will be returned. If min and max are the smallest values representable in the format, then the values returned are defined to be: Range [0] = floor(log2(|min|)) and Range [1] = floor(log2(|max|)).
Precision specifies the address of an integer into which will be written the log2 value of the number of bits of precision of the format. If the smallest representable value greater than 1 is 1 + eps, then the integer addressed by Precision will contain floor(-log2(eps)).
See external documentation.
See depthRange/2
Types
getProgramBinary(Program, BufSize) -> {BinaryFormat::enum(), Binary::binary()}
Types
Return a binary representation of a program object's compiled and linked executable source
gl:getProgramBinary returns a binary representation of the compiled and linked executable for Program into the array of bytes whose address is specified in Binary . The maximum number of bytes that may be written into Binary is specified by BufSize . If the program binary is greater in size than BufSize bytes, then an error is generated, otherwise the actual number of bytes written into Binary is returned in the variable whose address is given by Length . If Length is ?NULL, then no length is returned.
The format of the program binary written into Binary is returned in the variable whose address is given by BinaryFormat , and may be implementation dependent. The binary produced by the GL may subsequently be returned to the GL by calling gl:programBinary/3 , with BinaryFormat and Length set to the values returned by gl:getProgramBinary , and passing the returned binary data in the Binary parameter.
See external documentation.
programBinary(Program, BinaryFormat, Binary) -> ok
Load a program object with a program binary
gl:programBinary loads a program object with a program binary previously returned from gl:getProgramBinary/2 . BinaryFormat and Binary must be those returned by a previous call to gl:getProgramBinary/2 , and Length must be the length returned by gl:getProgramBinary/2 , or by gl:getProgramiv/2 when called with Pname set to ?GL_PROGRAM_BINARY_LENGTH. If these conditions are not met, loading the program binary will fail and Program 's ?GL_LINK_STATUS will be set to ?GL_FALSE.
A program object's program binary is replaced by calls to gl:linkProgram/1 or gl:programBinary . When linking success or failure is concerned, gl:programBinary can be considered to perform an implicit linking operation. gl:linkProgram/1 and gl:programBinary both set the program object's ?GL_LINK_STATUS to ?GL_TRUE or ?GL_FALSE .
A successful call to gl:programBinary will reset all uniform variables to their initial values. The initial value is either the value of the variable's initializer as specified in the original shader source, or zero if no initializer was present. Additionally, all vertex shader input and fragment shader output assignments that were in effect when the program was linked before saving are restored with gl:programBinary is called.
See external documentation.
programParameteri(Program, Pname, Value) -> ok
Specify a parameter for a program object
gl:programParameter specifies a new value for the parameter nameed by Pname for the program object Program .
If Pname is ?GL_PROGRAM_BINARY_RETRIEVABLE_HINT, Value should be ?GL_FALSE or ?GL_TRUE to indicate to the implementation the intention of the application to retrieve the program's binary representation with gl:getProgramBinary/2 . The implementation may use this information to store information that may be useful for a future query of the program's binary. It is recommended to set ?GL_PROGRAM_BINARY_RETRIEVABLE_HINT for the program to ?GL_TRUE before calling gl:linkProgram/1 , and using the program at run-time if the binary is to be retrieved later.
If Pname is ?GL_PROGRAM_SEPARABLE, Value must be ?GL_TRUE or ?GL_FALSE and indicates whether Program can be bound to individual pipeline stages via gl:useProgramStages/3 . A program's ?GL_PROGRAM_SEPARABLE parameter must be set to ?GL_TRUEbefore gl:linkProgram/1 is called in order for it to be usable with a program pipeline object. The initial state of ?GL_PROGRAM_SEPARABLE is ?GL_FALSE.
See external documentation.
useProgramStages(Pipeline, Stages, Program) -> ok
Types
Bind stages of a program object to a program pipeline
gl:useProgramStages binds executables from a program object associated with a specified set of shader stages to the program pipeline object given by Pipeline . Pipeline specifies the program pipeline object to which to bind the executables. Stages contains a logical combination of bits indicating the shader stages to use within Program with the program pipeline object Pipeline . Stages must be a logical combination of ?GL_VERTEX_SHADER_BIT, ?GL_TESS_CONTROL_SHADER_BIT, ?GL_TESS_EVALUATION_SHADER_BIT , ?GL_GEOMETRY_SHADER_BIT, and ?GL_FRAGMENT_SHADER_BIT. Additionally, the special value ?GL_ALL_SHADER_BITS may be specified to indicate that all executables contained in Program should be installed in Pipeline .
If Program refers to a program object with a valid shader attached for an indicated shader stage, gl:useProgramStages installs the executable code for that stage in the indicated program pipeline object Pipeline . If Program is zero, or refers to a program object with no valid shader executable for a given stage, it is as if the pipeline object has no programmable stage configured for the indicated shader stages. If Stages contains bits other than those listed above, and is not equal to ?GL_ALL_SHADER_BITS , an error is generated.
See external documentation.
activeShaderProgram(Pipeline, Program) -> ok
Types
Set the active program object for a program pipeline object
gl:activeShaderProgram sets the linked program named by Program to be the active program for the program pipeline object Pipeline . The active program in the active program pipeline object is the target of calls to gl:uniform1f/2 when no program has been made current through a call to gl:useProgram/1 .
See external documentation.
createShaderProgramv(Type, Strings) -> integer()
bindProgramPipeline(Pipeline) -> ok
Types
Bind a program pipeline to the current context
gl:bindProgramPipeline binds a program pipeline object to the current context. Pipeline must be a name previously returned from a call to gl:genProgramPipelines/1 . If no program pipeline exists with name Pipeline then a new pipeline object is created with that name and initialized to the default state vector.
When a program pipeline object is bound using gl:bindProgramPipeline, any previous binding is broken and is replaced with a binding to the specified pipeline object. If Pipeline is zero, the previous binding is broken and is not replaced, leaving no pipeline object bound. If no current program object has been established by gl:useProgram/1 , the program objects used for each stage and for uniform updates are taken from the bound program pipeline object, if any. If there is a current program object established by gl:useProgram/1 , the bound program pipeline object has no effect on rendering or uniform updates. When a bound program pipeline object is used for rendering, individual shader executables are taken from its program objects.
See external documentation.
deleteProgramPipelines(Pipelines) -> ok
Types
Delete program pipeline objects
gl:deleteProgramPipelines deletes the N program pipeline objects whose names are stored in the array Pipelines . Unused names in Pipelines are ignored, as is the name zero. After a program pipeline object is deleted, its name is again unused and it has no contents. If program pipeline object that is currently bound is deleted, the binding for that object reverts to zero and no program pipeline object becomes current.
See external documentation.
genProgramPipelines(N) -> [integer()]
Types
Reserve program pipeline object names
gl:genProgramPipelines returns N previously unused program pipeline object names in Pipelines . These names are marked as used, for the purposes of gl:genProgramPipelines only, but they acquire program pipeline state only when they are first bound.
See external documentation.
isProgramPipeline(Pipeline) -> 0 | 1
Types
Determine if a name corresponds to a program pipeline object
gl:isProgramPipeline returns ?GL_TRUE if Pipeline is currently the name of a program pipeline object. If Pipeline is zero, or if ?pipeline is not the name of a program pipeline object, or if an error occurs, gl:isProgramPipeline returns ?GL_FALSE. If Pipeline is a name returned by gl:genProgramPipelines/1 , but that has not yet been bound through a call to gl:bindProgramPipeline/1 , then the name is not a program pipeline object and gl:isProgramPipeline returns ?GL_FALSE .
See external documentation.
getProgramPipelineiv(Pipeline, Pname) -> integer()
Retrieve properties of a program pipeline object
gl:getProgramPipelineiv retrieves the value of a property of the program pipeline object Pipeline . Pname specifies the name of the parameter whose value to retrieve. The value of the parameter is written to the variable whose address is given by Params .
If Pname is ?GL_ACTIVE_PROGRAM, the name of the active program object of the program pipeline object is returned in Params .
If Pname is ?GL_VERTEX_SHADER, the name of the current program object for the vertex shader type of the program pipeline object is returned in Params .
If Pname is ?GL_TESS_CONTROL_SHADER, the name of the current program object for the tessellation control shader type of the program pipeline object is returned in Params .
If Pname is ?GL_TESS_EVALUATION_SHADER, the name of the current program object for the tessellation evaluation shader type of the program pipeline object is returned in Params .
If Pname is ?GL_GEOMETRY_SHADER, the name of the current program object for the geometry shader type of the program pipeline object is returned in Params .
If Pname is ?GL_FRAGMENT_SHADER, the name of the current program object for the fragment shader type of the program pipeline object is returned in Params .
If Pname is ?GL_INFO_LOG_LENGTH, the length of the info log, including the null terminator, is returned in Params . If there is no info log, zero is returned.
See external documentation.
programUniform1i(Program, Location, V0) -> ok
Types
Specify the value of a uniform variable for a specified program object
gl:programUniform modifies the value of a uniform variable or a uniform variable array. The location of the uniform variable to be modified is specified by Location , which should be a value returned by gl:getUniformLocation/2 . gl:programUniform operates on the program object specified by Program .
The commands gl:programUniform{1|2|3|4}{f|i|ui} are used to change the value of the uniform variable specified by Location using the values passed as arguments. The number specified in the command should match the number of components in the data type of the specified uniform variable (e.g., 1 for float, int, unsigned int, bool; 2 for vec2, ivec2, uvec2, bvec2, etc.). The suffix f indicates that floating-point values are being passed; the suffix i indicates that integer values are being passed; the suffix ui indicates that unsigned integer values are being passed, and this type should also match the data type of the specified uniform variable. The i variants of this function should be used to provide values for uniform variables defined as int, ivec2 , ivec3, ivec4, or arrays of these. The ui variants of this function should be used to provide values for uniform variables defined as unsigned int, uvec2, uvec3, uvec4, or arrays of these. The f variants should be used to provide values for uniform variables of type float, vec2, vec3, vec4, or arrays of these. Either the i, ui or f variants may be used to provide values for uniform variables of type bool, bvec2 , bvec3, bvec4, or arrays of these. The uniform variable will be set to false if the input value is 0 or 0.0f, and it will be set to true otherwise.
All active uniform variables defined in a program object are initialized to 0 when the program object is linked successfully. They retain the values assigned to them by a call to gl:programUniform until the next successful link operation occurs on the program object, when they are once again initialized to 0.
The commands gl:programUniform{1|2|3|4}{f|i|ui}v can be used to modify a single uniform variable or a uniform variable array. These commands pass a count and a pointer to the values to be loaded into a uniform variable or a uniform variable array. A count of 1 should be used if modifying the value of a single uniform variable, and a count of 1 or greater can be used to modify an entire array or part of an array. When loading n elements starting at an arbitrary position m in a uniform variable array, elements m + n - 1 in the array will be replaced with the new values. If M + N - 1 is larger than the size of the uniform variable array, values for all array elements beyond the end of the array will be ignored. The number specified in the name of the command indicates the number of components for each element in Value , and it should match the number of components in the data type of the specified uniform variable (e.g., 1 for float, int, bool; 2 for vec2, ivec2, bvec2, etc.). The data type specified in the name of the command must match the data type for the specified uniform variable as described previously for gl:programUniform{1|2|3|4}{f|i|ui}.
For uniform variable arrays, each element of the array is considered to be of the type indicated in the name of the command (e.g., gl:programUniform3f or gl:programUniform3fv can be used to load a uniform variable array of type vec3). The number of elements of the uniform variable array to be modified is specified by Count
The commands gl:programUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv are used to modify a matrix or an array of matrices. The numbers in the command name are interpreted as the dimensionality of the matrix. The number 2 indicates a 2 × 2 matrix (i.e., 4 values), the number 3 indicates a 3 × 3 matrix (i.e., 9 values), and the number 4 indicates a 4 × 4 matrix (i.e., 16 values). Non-square matrix dimensionality is explicit, with the first number representing the number of columns and the second number representing the number of rows. For example, 2x4 indicates a 2 × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If Transpose is ?GL_FALSE, each matrix is assumed to be supplied in column major order. If Transpose is ?GL_TRUE, each matrix is assumed to be supplied in row major order. The Count argument indicates the number of matrices to be passed. A count of 1 should be used if modifying the value of a single matrix, and a count greater than 1 can be used to modify an array of matrices.
See external documentation.
programUniform1iv(Program, Location, Value) -> ok
Types
programUniform1f(Program, Location, V0) -> ok
Types
programUniform1fv(Program, Location, Value) -> ok
Types
programUniform1d(Program, Location, V0) -> ok
Types
programUniform1dv(Program, Location, Value) -> ok
Types
programUniform1ui(Program, Location, V0) -> ok
Types
programUniform1uiv(Program, Location, Value) -> ok
Types
programUniform2i(Program, Location, V0, V1) -> ok
Types
programUniform2iv(Program, Location, Value) -> ok
Types
programUniform2f(Program, Location, V0, V1) -> ok
Types
programUniform2fv(Program, Location, Value) -> ok
Types
programUniform2d(Program, Location, V0, V1) -> ok
Types
programUniform2dv(Program, Location, Value) -> ok
Types
programUniform2ui(Program, Location, V0, V1) -> ok
Types
programUniform2uiv(Program, Location, Value) -> ok
Types
programUniform3i(Program, Location, V0, V1, V2) -> ok
Types
programUniform3iv(Program, Location, Value) -> ok
Types
programUniform3f(Program, Location, V0, V1, V2) -> ok
Types
programUniform3fv(Program, Location, Value) -> ok
Types
programUniform3d(Program, Location, V0, V1, V2) -> ok
Types
programUniform3dv(Program, Location, Value) -> ok
Types
programUniform3ui(Program, Location, V0, V1, V2) -> ok
Types
programUniform3uiv(Program, Location, Value) -> ok
Types
programUniform4i(Program, Location, V0, V1, V2, V3) -> ok
Types
programUniform4iv(Program, Location, Value) -> ok
Types
programUniform4f(Program, Location, V0, V1, V2, V3) -> ok
Types
programUniform4fv(Program, Location, Value) -> ok
Types
programUniform4d(Program, Location, V0, V1, V2, V3) -> ok
Types
programUniform4dv(Program, Location, Value) -> ok
Types
programUniform4ui(Program, Location, V0, V1, V2, V3) -> ok
Types
programUniform4uiv(Program, Location, Value) -> ok
Types
programUniformMatrix2fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix2dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix2x3fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3x2fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix2x4fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4x2fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3x4fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4x3fv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix2x3dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3x2dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix2x4dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4x2dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix3x4dv(Program, Location, Transpose, Value) -> ok
Types
programUniformMatrix4x3dv(Program, Location, Transpose, Value) -> ok
Types
validateProgramPipeline(Pipeline) -> ok
Types
Validate a program pipeline object against current GL state
gl:validateProgramPipeline instructs the implementation to validate the shader executables contained in Pipeline against the current GL state. The implementation may use this as an opportunity to perform any internal shader modifications that may be required to ensure correct operation of the installed shaders given the current GL state.
After a program pipeline has been validated, its validation status is set to ?GL_TRUE . The validation status of a program pipeline object may be queried by calling gl:getProgramPipelineiv/2 with parameter ?GL_VALIDATE_STATUS.
If Pipeline is a name previously returned from a call to gl:genProgramPipelines/1 but that has not yet been bound by a call to gl:bindProgramPipeline/1 , a new program pipeline object is created with name Pipeline and the default state vector.
See external documentation.
getProgramPipelineInfoLog(Pipeline, BufSize) -> string()
Types
Retrieve the info log string from a program pipeline object
gl:getProgramPipelineInfoLog retrieves the info log for the program pipeline object Pipeline . The info log, including its null terminator, is written into the array of characters whose address is given by InfoLog . The maximum number of characters that may be written into InfoLog is given by BufSize , and the actual number of characters written into InfoLog is returned in the integer whose address is given by Length . If Length is ?NULL, no length is returned.
The actual length of the info log for the program pipeline may be determined by calling gl:getProgramPipelineiv/2 with Pname set to ?GL_INFO_LOG_LENGTH.
See external documentation.
vertexAttribL1d(Index, X) -> ok
Types
vertexAttribL2d(Index, X, Y) -> ok
Types
vertexAttribL3d(Index, X, Y, Z) -> ok
Types
vertexAttribL4d(Index, X, Y, Z, W) -> ok
Types
vertexAttribL1dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribL1d(Index, X).
vertexAttribL2dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribL2d(Index, X, Y).
vertexAttribL3dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribL3d(Index, X, Y, Z).
vertexAttribL4dv(Index::integer(), V) -> ok
Types
Equivalent to vertexAttribL4d(Index, X, Y, Z, W).
vertexAttribLPointer(Index, Size, Type, Stride, Pointer) -> ok
getVertexAttribLdv(Index, Pname) -> {float(), float(), float(), float()}
viewportArrayv(First, V) -> ok
Types
viewportIndexedf(Index, X, Y, W, H) -> ok
Types
Set a specified viewport
gl:viewportIndexedf and gl:viewportIndexedfv specify the parameters for a single viewport. Index specifies the index of the viewport to modify. Index must be less than the value of ?GL_MAX_VIEWPORTS. For gl:viewportIndexedf, X , Y , W , and H specify the left, bottom, width and height of the viewport in pixels, respectively. For gl:viewportIndexedfv, V contains the address of an array of floating point values specifying the left ( x), bottom ( y), width ( w), and height ( h) of each viewport, in that order. x and y give the location of the viewport's lower left corner, and w and h give the width and height of the viewport, respectively. The viewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window coordinates (x w y w) are computed as follows:
x w=(x nd+1) (width/2)+x
y w=(y nd+1) (height/2)+y
The location of the viewport's bottom left corner, given by ( x, y) is clamped to be within the implementaiton-dependent viewport bounds range. The viewport bounds range [ min, max] can be determined by calling gl:getBooleanv/1 with argument ?GL_VIEWPORT_BOUNDS_RANGE . Viewport width and height are silently clamped to a range that depends on the implementation. To query this range, call gl:getBooleanv/1 with argument ?GL_MAX_VIEWPORT_DIMS.
The precision with which the GL interprets the floating point viewport bounds is implementation-dependent and may be determined by querying the impementation-defined constant ?GL_VIEWPORT_SUBPIXEL_BITS .
Calling gl:viewportIndexedfv is equivalent to calling see glViewportArray with First set to Index , Count set to 1 and V passsed directly. gl:viewportIndexedf is equivalent to: void glViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) { const float v[4] = { x, y, w, h }; glViewportArrayv(index, 1, v); }
See external documentation.
viewportIndexedfv(Index, V) -> ok
Types
Types
scissorIndexed(Index, Left, Bottom, Width, Height) -> ok
Types
scissorIndexedv(Index, V) -> ok
Types
depthRangeArrayv(First, V) -> ok
depthRangeIndexed(Index, N, F) -> ok
getFloati_v(Target, Index) -> [float()]
See getBooleanv/1
getDoublei_v(Target, Index) -> [float()]
See getBooleanv/1
debugMessageControlARB(Source, Type, Severity, Ids, Enabled) -> ok
debugMessageInsertARB(Source, Type, Id, Severity, Buf) -> ok
getDebugMessageLogARB(Count, Bufsize) -> {integer(), Sources::[enum()], Types::[enum()], Ids::[integer()], Severities::[enum()], MessageLog::[string()]}
Types
getGraphicsResetStatusARB() -> enum()
drawArraysInstancedBaseInstance(Mode, First, Count, Primcount, Baseinstance) -> ok
Types
Draw multiple instances of a range of elements with offset applied to instanced attributes
gl:drawArraysInstancedBaseInstance behaves identically to gl:drawArrays/3 except that Primcount instances of the range of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID .
gl:drawArraysInstancedBaseInstance has the same effect as: if ( mode or count is invalid ) generate appropriate error else { for (int i = 0; i < primcount ; i++) { instanceID = i; glDrawArrays(mode, first, count); } instanceID = 0; }
Specific vertex attributes may be classified as instanced through the use of gl:vertexAttribDivisor/2 . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated as: |gl_ InstanceID/divisor|+ baseInstance. Note that Baseinstance does not affect the shader-visible value of ?gl_InstanceID.
See external documentation.
drawElementsInstancedBaseInstance(Mode, Count, Type, Indices, Primcount, Baseinstance) -> ok
Draw multiple instances of a set of elements with offset applied to instanced attributes
gl:drawElementsInstancedBaseInstance behaves identically to gl:drawElements/4 except that Primcount instances of the set of elements are executed and the value of the internal counter InstanceID advances for each iteration. InstanceID is an internal 32-bit integer counter that may be read by a vertex shader as ?gl_InstanceID .
gl:drawElementsInstancedBaseInstance has the same effect as: if (mode, count, or type is invalid ) generate appropriate error else { for (int i = 0; i < primcount ; i++) { instanceID = i; glDrawElements(mode, count, type, indices); } instanceID = 0; }
Specific vertex attributes may be classified as instanced through the use of gl:vertexAttribDivisor/2 . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated as |gl_ InstanceID/divisor|+ baseInstance. Note that Baseinstance does not affect the shader-visible value of ?gl_InstanceID.
See external documentation.
drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type, Indices, Primcount, Basevertex, Baseinstance) -> ok
Types
Render multiple instances of a set of primitives from array data with a per-element offset
gl:drawElementsInstancedBaseVertexBaseInstance behaves identically to gl:drawElementsInstanced/5 except that the ith element transferred by the corresponding draw call will be taken from element Indices [i] + Basevertex of each enabled array. If the resulting value is larger than the maximum value representable by Type , it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative. The Basevertex has no effect on the shader-visible value of ?gl_VertexID.
Specific vertex attributes may be classified as instanced through the use of gl:vertexAttribDivisor/2 . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated as |gl_ InstanceID/divisor|+ baseInstance. Note that Baseinstance does not affect the shader-visible value of ?gl_InstanceID.
See external documentation.
drawTransformFeedbackInstanced(Mode, Id, Primcount) -> ok
drawTransformFeedbackStreamInstanced(Mode, Id, Stream, Primcount) -> ok
getInternalformativ(Target, Internalformat, Pname, BufSize) -> [integer()]
bindImageTexture(Unit, Texture, Level, Layered, Layer, Access, Format) -> ok
Types
Bind a level of a texture to an image unit
gl:bindImageTexture binds a single level of a texture to an image unit for the purpose of reading and writing it from shaders. Unit specifies the zero-based index of the image unit to which to bind the texture level. Texture specifies the name of an existing texture object to bind to the image unit. If Texture is zero, then any existing binding to the image unit is broken. Level specifies the level of the texture to bind to the image unit.
If Texture is the name of a one-, two-, or three-dimensional array texture, a cube map or cube map array texture, or a two-dimensional multisample array texture, then it is possible to bind either the entire array, or only a single layer of the array to the image unit. In such cases, if Layered is ?GL_TRUE, the entire array is attached to the image unit and Layer is ignored. However, if Layered is ?GL_FALSE then Layer specifies the layer of the array to attach to the image unit.
Access specifies the access types to be performed by shaders and may be set to ?GL_READ_ONLY , ?GL_WRITE_ONLY, or ?GL_READ_WRITE to indicate read-only, write-only or read-write access, respectively. Violation of the access type specified in Access (for example, if a shader writes to an image bound with Access set to ?GL_READ_ONLY ) will lead to undefined results, possibly including program termination.
Format specifies the format that is to be used when performing formatted stores into the image from shaders. Format must be compatible with the texture's internal format and must be one of the formats listed in the following table.
Image Unit FormatFormat Qualifier?GL_RGBA32Frgba32f
?GL_RGBA16F rgba16f
?GL_RG32Frg32f
?GL_RG16F rg16f
?GL_R11F_G11F_B10Fr11f_g11f_b10f
?GL_R32Fr32f
?GL_R16Fr16f
?GL_RGBA32UIrgba32ui
?GL_RGBA16UI rgba16ui
?GL_RGB10_A2UIrgb10_a2ui
?GL_RGBA8UI rgba8ui
?GL_RG32UIrg32ui
?GL_RG16UI rg16ui
?GL_RG8UIrg8ui
?GL_R32UI r32ui
?GL_R16UIr16ui
?GL_R8UI r8ui
?GL_RGBA32Irgba32i
?GL_RGBA16I rgba16i
?GL_RGBA8Irgba8i
?GL_RG32I rg32i
?GL_RG16Irg16i
?GL_RG8I rg8i
?GL_R32Ir32i
?GL_R16I r16i
?GL_R8Ir8i
?GL_RGBA16 rgba16
?GL_RGB10_A2rgb10_a2
?GL_RGBA8 rgba8
?GL_RG16rg16
?GL_RG8 rg8
?GL_R16r16
?GL_R8 r8
?GL_RGBA16_SNORMrgba16_snorm
?GL_RGBA8_SNORM rgba8_snorm
?GL_RG16_SNORMrg16_snorm
?GL_RG8_SNORMrg8_snorm
?GL_R16_SNORMr16_snorm
?GL_R8_SNORMr8_snorm
When a texture is bound to an image unit, the Format parameter for the image unit need not exactly match the texture internal format as long as the formats are considered compatible as defined in the OpenGL Specification. The matching criterion used for a given texture may be determined by calling gl:getTexParameterfv/2 with Value set to ?GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, with return values of ?GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE and ?GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS, specifying matches by size and class, respectively.
See external documentation.
Types
Defines a barrier ordering memory transactions
gl:memoryBarrier defines a barrier ordering the memory transactions issued prior to the command relative to those issued after the barrier. For the purposes of this ordering, memory transactions performed by shaders are considered to be issued by the rendering command that triggered the execution of the shader. Barriers is a bitfield indicating the set of operations that are synchronized with shader stores; the bits used in Barriers are as follows:
?GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT: If set, vertex data sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier. The set of buffer objects affected by this bit is derived from the buffer object bindings used for generic vertex attributes derived from the ?GL_VERTEX_ATTRIB_ARRAY_BUFFER bindings.
?GL_ELEMENT_ARRAY_BARRIER_BIT: If set, vertex array indices sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier. The buffer objects affected by this bit are derived from the ?GL_ELEMENT_ARRAY_BUFFER binding.
?GL_UNIFORM_BARRIER_BIT: Shader uniforms sourced from buffer objects after the barrier will reflect data written by shaders prior to the barrier.
?GL_TEXTURE_FETCH_BARRIER_BIT: Texture fetches from shaders, including fetches from buffer object memory via buffer textures, after the barrier will reflect data written by shaders prior to the barrier.
?GL_SHADER_IMAGE_ACCESS_BARRIER_BIT: Memory accesses using shader image load, store, and atomic built-in functions issued after the barrier will reflect data written by shaders prior to the barrier. Additionally, image stores and atomics issued after the barrier will not execute until all memory accesses (e.g., loads, stores, texture fetches, vertex fetches) initiated prior to the barrier complete.
?GL_COMMAND_BARRIER_BIT: Command data sourced from buffer objects by Draw*Indirect commands after the barrier will reflect data written by shaders prior to the barrier. The buffer objects affected by this bit are derived from the ?GL_DRAW_INDIRECT_BUFFER binding.
?GL_PIXEL_BUFFER_BARRIER_BIT: Reads and writes of buffer objects via the ?GL_PIXEL_PACK_BUFFER and ?GL_PIXEL_UNPACK_BUFFER bindings (via gl:readPixels/7 , gl:texSubImage1D/7 , etc.) after the barrier will reflect data written by shaders prior to the barrier. Additionally, buffer object writes issued after the barrier will wait on the completion of all shader writes initiated prior to the barrier.
?GL_TEXTURE_UPDATE_BARRIER_BIT: Writes to a texture via gl:tex(Sub)Image*, gl:copyTex(Sub)Image* , gl:compressedTex(Sub)Image*, and reads via gl:getTexImage/5 after the barrier will reflect data written by shaders prior to the barrier. Additionally, texture writes from these commands issued after the barrier will not execute until all shader writes initiated prior to the barrier complete.
?GL_BUFFER_UPDATE_BARRIER_BIT: Reads or writes via gl:bufferSubData/4 , gl:copyBufferSubData/5 , or gl:getBufferSubData/4 , or to buffer object memory mapped by see glMapBuffer or see glMapBufferRange after the barrier will reflect data written by shaders prior to the barrier. Additionally, writes via these commands issued after the barrier will wait on the completion of any shader writes to the same memory initiated prior to the barrier.
?GL_FRAMEBUFFER_BARRIER_BIT: Reads and writes via framebuffer object attachments after the barrier will reflect data written by shaders prior to the barrier. Additionally, framebuffer writes issued after the barrier will wait on the completion of all shader writes issued prior to the barrier.
?GL_TRANSFORM_FEEDBACK_BARRIER_BIT: Writes via transform feedback bindings after the barrier will reflect data written by shaders prior to the barrier. Additionally, transform feedback writes issued after the barrier will wait on the completion of all shader writes issued prior to the barrier.
?GL_ATOMIC_COUNTER_BARRIER_BIT: Accesses to atomic counters after the barrier will reflect writes prior to the barrier.
If Barriers is ?GL_ALL_BARRIER_BITS, shader memory accesses will be synchronized relative to all the operations described above.
Implementations may cache buffer object and texture image memory that could be written by shaders in multiple caches; for example, there may be separate caches for texture, vertex fetching, and one or more caches for shader memory accesses. Implementations are not required to keep these caches coherent with shader memory writes. Stores issued by one invocation may not be immediately observable by other pipeline stages or other shader invocations because the value stored may remain in a cache local to the processor executing the store, or because data overwritten by the store is still in a cache elsewhere in the system. When gl:memoryBarrier is called, the GL flushes and/or invalidates any caches relevant to the operations specified by the Barriers parameter to ensure consistent ordering of operations across the barrier.
To allow for independent shader invocations to communicate by reads and writes to a common memory address, image variables in the OpenGL Shading Language may be declared as "coherent". Buffer object or texture image memory accessed through such variables may be cached only if caches are automatically updated due to stores issued by any other shader invocation. If the same address is accessed using both coherent and non-coherent variables, the accesses using variables declared as coherent will observe the results stored using coherent variables in other invocations. Using variables declared as "coherent" guarantees only that the results of stores will be immediately visible to shader invocations using similarly-declared variables; calling gl:memoryBarrier is required to ensure that the stores are visible to other operations.
The following guidelines may be helpful in choosing when to use coherent memory accesses and when to use barriers.
Data that are read-only or constant may be accessed without using coherent variables or calling MemoryBarrier(). Updates to the read-only data via API calls such as BufferSubData will invalidate shader caches implicitly as required.
Data that are shared between shader invocations at a fine granularity (e.g., written by one invocation, consumed by another invocation) should use coherent variables to read and write the shared data.
Data written by one shader invocation and consumed by other shader invocations launched as a result of its execution ("dependent invocations") should use coherent variables in the producing shader invocation and call memoryBarrier() after the last write. The consuming shader invocation should also use coherent variables.
Data written to image variables in one rendering pass and read by the shader in a later pass need not use coherent variables or memoryBarrier(). Calling MemoryBarrier() with the SHADER_IMAGE_ACCESS_BARRIER_BIT set in Barriers between passes is necessary.
Data written by the shader in one rendering pass and read by another mechanism (e.g., vertex or index buffer pulling) in a later pass need not use coherent variables or memoryBarrier(). Calling gl:memoryBarrier with the appropriate bits set in Barriers between passes is necessary.
See external documentation.
texStorage1D(Target, Levels, Internalformat, Width) -> ok
Simultaneously specify storage for all levels of a one-dimensional texture
gl:texStorage1D specifies the storage requirements for all levels of a one-dimensional texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.
Calling gl:texStorage1D is equivalent, assuming no errors are generated, to executing the following pseudo-code: for (i = 0; i < levels; i++) { glTexImage1D(target, i, internalformat, width, 0, format, type, NULL); width = max(1, (width / 2)); }
Since no texture data is actually provided, the values used in the pseudo-code for Format and Type are irrelevant and may be considered to be any values that are legal for the chosen Internalformat enumerant. Internalformat must be one of the sized internal formats given in Table 1 below, one of the sized depth-component formats ?GL_DEPTH_COMPONENT32F , ?GL_DEPTH_COMPONENT24, or ?GL_DEPTH_COMPONENT16, or one of the combined depth-stencil formats, ?GL_DEPTH32F_STENCIL8, or ?GL_DEPTH24_STENCIL8. Upon success, the value of ?GL_TEXTURE_IMMUTABLE_FORMAT becomes ?GL_TRUE. The value of ?GL_TEXTURE_IMMUTABLE_FORMAT may be discovered by calling gl:getTexParameterfv/2 with Pname set to ?GL_TEXTURE_IMMUTABLE_FORMAT. No further changes to the dimensions or format of the texture object may be made. Using any command that might alter the dimensions or format of the texture object (such as gl:texImage1D/8 or another call to gl:texStorage1D) will result in the generation of a ?GL_INVALID_OPERATION error, even if it would not, in fact, alter the dimensions or format of the object.
See external documentation.
texStorage2D(Target, Levels, Internalformat, Width, Height) -> ok
Types
Simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture
gl:texStorage2D specifies the storage requirements for all levels of a two-dimensional texture or one-dimensional texture array simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.
The behavior of gl:texStorage2D depends on the Target parameter. When Target is ?GL_TEXTURE_2D, ?GL_PROXY_TEXTURE_2D, ?GL_TEXTURE_RECTANGLE, ?GL_PROXY_TEXTURE_RECTANGLE or ?GL_PROXY_TEXTURE_CUBE_MAP, calling gl:texStorage2D is equivalent, assuming no errors are generated, to executing the following pseudo-code: for (i = 0; i < levels; i++) { glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL); width = max(1, (width / 2)); height = max(1, (height / 2)); }
When Target is ?GL_TEXTURE_CUBE_MAP, gl:texStorage2D is equivalent to: for (i = 0; i < levels; i++) { for (face in (+X, -X, +Y, -Y, +Z, -Z)) { glTexImage2D(face, i, internalformat, width, height, 0, format, type, NULL); } width = max(1, (width / 2)); height = max(1, (height / 2)); }
When Target is ?GL_TEXTURE_1D or ?GL_TEXTURE_1D_ARRAY, gl:texStorage2D is equivalent to: for (i = 0; i < levels; i++) { glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL); width = max(1, (width / 2)); }
Since no texture data is actually provided, the values used in the pseudo-code for Format and Type are irrelevant and may be considered to be any values that are legal for the chosen Internalformat enumerant. Internalformat must be one of the sized internal formats given in Table 1 below, one of the sized depth-component formats ?GL_DEPTH_COMPONENT32F , ?GL_DEPTH_COMPONENT24, or ?GL_DEPTH_COMPONENT16, or one of the combined depth-stencil formats, ?GL_DEPTH32F_STENCIL8, or ?GL_DEPTH24_STENCIL8. Upon success, the value of ?GL_TEXTURE_IMMUTABLE_FORMAT becomes ?GL_TRUE. The value of ?GL_TEXTURE_IMMUTABLE_FORMAT may be discovered by calling gl:getTexParameterfv/2 with Pname set to ?GL_TEXTURE_IMMUTABLE_FORMAT. No further changes to the dimensions or format of the texture object may be made. Using any command that might alter the dimensions or format of the texture object (such as gl:texImage2D/9 or another call to gl:texStorage2D) will result in the generation of a ?GL_INVALID_OPERATION error, even if it would not, in fact, alter the dimensions or format of the object.
See external documentation.
texStorage3D(Target, Levels, Internalformat, Width, Height, Depth) -> ok
Types
Simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture
gl:texStorage3D specifies the storage requirements for all levels of a three-dimensional, two-dimensional array or cube-map array texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.
The behavior of gl:texStorage3D depends on the Target parameter. When Target is ?GL_TEXTURE_3D, or ?GL_PROXY_TEXTURE_3D, calling gl:texStorage3D is equivalent, assuming no errors are generated, to executing the following pseudo-code: for (i = 0; i < levels; i++) { glTexImage3D(target, i, internalformat, width, height, depth, 0, format, type, NULL); width = max(1, (width / 2)); height = max(1, (height / 2)); depth = max(1, (depth / 2)); }
When Target is ?GL_TEXTURE_2D_ARRAY, ?GL_PROXY_TEXTURE_2D_ARRAY, ?GL_TEXTURE_CUBE_MAP_ARRAY , or ?GL_PROXY_TEXTURE_CUBE_MAP_ARRAY, gl:texStorage3D is equivalent to: for (i = 0; i < levels; i++) { glTexImage3D(target, i, internalformat, width, height, depth, 0, format, type, NULL); width = max(1, (width / 2)); height = max(1, (height / 2)); }
Since no texture data is actually provided, the values used in the pseudo-code for Format and Type are irrelevant and may be considered to be any values that are legal for the chosen Internalformat enumerant. Internalformat must be one of the sized internal formats given in Table 1 below, one of the sized depth-component formats ?GL_DEPTH_COMPONENT32F , ?GL_DEPTH_COMPONENT24, or ?GL_DEPTH_COMPONENT16, or one of the combined depth-stencil formats, ?GL_DEPTH32F_STENCIL8, or ?GL_DEPTH24_STENCIL8. Upon success, the value of ?GL_TEXTURE_IMMUTABLE_FORMAT becomes ?GL_TRUE. The value of ?GL_TEXTURE_IMMUTABLE_FORMAT may be discovered by calling gl:getTexParameterfv/2 with Pname set to ?GL_TEXTURE_IMMUTABLE_FORMAT. No further changes to the dimensions or format of the texture object may be made. Using any command that might alter the dimensions or format of the texture object (such as gl:texImage3D/10 or another call to gl:texStorage3D) will result in the generation of a ?GL_INVALID_OPERATION error, even if it would not, in fact, alter the dimensions or format of the object.
See external documentation.
depthBoundsEXT(Zmin, Zmax) -> ok
stencilClearTagEXT(StencilTagBits, StencilClearTag) -> ok