GL_CONSTANT_DATA_SUNX(3gl)GL_CONSTANT_DATA_SUNX(3gl)NAME
GL_CONSTANT_DATA_SUNX - allows the pixel data specified by the applica‐
tion to be used internally without making a second copy
DESCRIPTION
This extension allows the pixel data specified by the application to be
used internally without making a second copy. This extension affects
how the pixel data in client memory is interpreted and therefore
affects glDrawPixels, glBitmap, glPolygonStipple, glTexImage1D, glTex‐
Image2D, glTexImage3DEXT.
When glTexImage1D, glTexImage2D or glTexImage3DEXT is called, specify‐
ing glPixelStore with pname GL_UNPACK_CONSTANT_DATA_SUNX set to GL_TRUE
will allow the implementation to use the application provided data
pointer internally thereby avoiding a second copy. If pixel transfer is
enabled when using this pixel store mode or if the constant directive
cannot be honored , then the constant directive will be ignored and a
copy will be made internally. Thus, specifying "constant" data direc‐
tive does not prohibit the implementation from making a copy, rather it
is treated as a hint by the implementation to avoid making a second
copy if possible. Note that if GL_UNPACK_CONSTANT_DATA_SUNX is set to
GL_TRUE, and all the pixel store values are not default values then the
constant hint will not be honored.
A glTexSubImage will always make a copy of the existing texture image
before updating the subimage except when the scenario given below is
true.
If a glTexSubImage1D, glTexSubImage2D, glTexSubImage3DEXT is called
with glPixelStore pname GL_UNPACK_CONSTANT_DATA_SUNX set to GL_TRUE on
a constant texture, then the address of the start of the texture image
is computed using the specified xoffset, yoffset, zoffset. If this com‐
puted address matches the start address of the currently used constant
texture then no action is taken. If the addresses do not match then a
copy is first made of the entire texture and then the subimage is
updated in this copy. A texture is a "constant texture" if at the time
of the specification of the texture no copy was made. This attribute
can be queried as described later.
Before an application changes a part or all of the texture image that
has been specified as a constant texture image, it is necessary to call
glFinishTextureSUNX to ensure that the library has completed all its
processing with the currently specified constant texture image before
the changes are applied to this constant texture image by the applica‐
tion.
If a glCopyTexImage or glCopyTexSubImage is made and the existing tex‐
ture image is constant, then a copy is made internally before executing
the call.
In immediate mode, for glDrawPixels and glBitmap, specifying constant
data is not meaningful since data does not have a life beyond the call
itself.
A texture image/raster image or bitmap could be specified as constant
at the time of the creation of the display list. If pixelmap/pixel
transfer is enabled before calling the display list, then a copy is
made internally and the data is no longer constant.
The pixel store value for the constant data that has been set can be
inquired using Get with pname set to GL_UNPACK_CONSTANT_DATA_SUNX.
When glTexImage is executed with target GL_PROXY_TEXTURE_*D then the
state value of GL_TEXTURE_CONSTANT_DATA_SUNX will be set to 0 if the
texture data cannot be stored as constant, otherwise the value will be
1.
The constant nature of the texture data can be inquired using glGet‐
TexLevelParameter with pname GL_TEXTURE_CONSTANT_DATA_SUNX and target
GL_PROXY_TEXTURE_*D . If the target is GL_TEXTURE*D and pname is
GL_TEXTURE_CONSTANT_DATA_SUNX, then the value returned is GL_TRUE if
the the texture image defined at this level is currently constant.
Note that a texture image may become non-constant (that is an internal
copy may be made) at the time when the texture is used rather than at a
time when the texture is specified. If interested, an application could
inquire the constant nature of the texture data after the texture has
been used for rendering.
NOTES
GL_CONSTANT_DATA_SUNX extension should be defined for the new function‐
ality to work
If a texture image is defined as constant during display list creation,
then the contents of the texture image should remain unchanged for the
life of the display list. Changing this constant texture image will
result in unpredictable results.
If a subimage computed address matches the start address of the cur‐
rently used constant texture and glTexSubImage data changes the data,
use glTexImage1D, glTexImage2D, or glTexImage3D to redefine the new
image.
ERRORS
GL_INVALID_OPERATION is generated if texture subimage is specified as
constant in a display list.
ASSOCIATED GETS
glGet with argument GL_UNPACK_CONSTANT_DATA_SUNX
pwd glGetTexLevelParameter with pname argument GL_TEXTURE_CON‐
STANT_DATA_SUNX
SEE ALSO
glTexImage1D, glTexImage2D, glTexImage3DEXT, glPixelStore, glFinishTex‐
tureSUNX
15 Mar 97 GL_CONSTANT_DATA_SUNX(3gl)