Name
GL_NV_texture_compression_s3tc_update
Name Strings
GL_NV_texture_compression_s3tc_update
Contributors
Nicholas Haemel, NVIDIA
Acorn Pooley, NVIDIA
Antti Rasmus, NVIDIA
Musawir Shah, NVIDIA
Contact
Musawir Shah, NVIDIA Corporation (mshah 'at' nvidia.com)
Notice
Copyright NVIDIA Corporation, 20XX - 20XX
Status
NVIDIA Proprietary
Version
Last Modified: 2011/04/06
NVIDIA Revision: 0.1
Number
XXXX Unassigned XXXX
Dependencies
Requires OpenGL ES 1.1
This specification is written against the OpenGL ES 2.0.25 specification.
Depends on the GL_NV_texture_compression_s3tc extension.
Overview
This extension allows for full or partial image updates to a compressed 2D
texture from an uncompressed texel data buffer using TexImage2D and
TexSubImage2D. Consquently, if a compressed internal format is used, all
the restrictions associated with compressed textures will apply. These
include sub-image updates aligned to 4x4 pixel blocks and the restriction
on usage as render targets.
New Procedures and Functions
None.
Additions to Chapter 3 of the OpenGL ES 2.0.25 Specification (Rasterization)
Modify Section 3.7.1, Texture Image Specification
(change last paragraph on Page 67 as follows)
Components are then selected from the resulting R, G, B, or A values to obtain
a texture with the base internal format specified by <internalformat>, which must
match <format> except when <target> is TEXTURE_2D and <internalformat> is one of
the following compressed formats: COMPRESSED_RGB_S3TC_DXT1_EXT,
COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT,
COMPRESSED_RGBA_S3TC_DXT5_EXT. In this case, conversion from only RGBA format is
supported during texture image processing. <format> values other than RGBA will
result in the INVALID_OPERATION error. In all other cases where <internalformat>
does not match <format>, the error INVALID_OPERATION is generated. Table 3.8
summarizes the mapping of R, G, B, and A values to texture components, as a
function of the base internal format of the texture image. <internalformat>
may be one of the five internal format symbolic constants listed in table 3.8 or
the four compressed formats: COMPRESSED_RGB_S3TC_DXT1_EXT,
COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT,
COMPRESSED_RGBA_S3TC_DXT5_EXT. Specifying a value for <internalformat> that is not
one of the above values generates the error INVALID_VALUE. When a compressed
<internalformat> is specified, a compressed texture is created and all the
associated restrictions mentioned in Section 3.7.3 are imposed.
Modify Section 3.7.2, Alternate Texture Image Specification Commands
(add to the end of section)
When the internal format of the texture object is COMPRESSED_RGB_S3TC_DXT1_EXT,
COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT,
or COMPRESSED_RGBA_S3TC_DXT5_EXT, the update region specified in TexSubImage2D
must be aligned to 4x4 pixel blocks. If <xoffset> or <yoffset> are not multiples
of 4 an INVALID_OPERATION error is generated. If <width> is not a multiple of 4
and <xoffset> + <width> is less than the width of the LOD then an INVALID_OPERATION
error is generated. If <height> is not a multiple of 4 and <yoffset> + <height> is
less than the height of the LOD then an INVALID_OPERATION error is generated.
Additions to Chapter 4 of the OpenGL ES 2.0.25 Specification (Per-Fragment
Operations and the Framebuffer)
Modify Section 4.4.3, Attaching Texture Images to a Framebuffer
(add after last paragraph on Page 113)
If <texture> is not zero and the internal format of the corresponding texture
object is a compressed format, an INVALID_OPERATION error is generated.
Errors
INVALID_OPERATION is generated by TexImage2D and TexSubImage2D if TEXTURE_INTERNAL_FORMAT
is COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
COMPRESSED_RGBA_S3TC_DXT3_EXT, or COMPRESSED_RGBA_S3TC_DXT5_EXT and <format> is not RGBA.
If <xoffset> or <yoffset> are not multiples of 4 an INVALID_OPERATION error is generated.
If <width> is not a multiple of 4 and <xoffset> + <width> is less than the width of the
LOD then an INVALID_OPERATION error is generated.
If <height> is not a multiple of 4 and <yoffset> + <height> is less than the height of
the LOD then an INVALID_OPERATION error is generated.
Issues
1) Should sub-image updates be aligned to 4x4 pixel blocks?
RESOLUTION: Yes. Relaxing this restriction would otherwise require CPU read-back of pixels
at the 4x4 compression block boundary.
2) Should we support binding of compressed textures as render targets?
RESOLUTION: No. Writing to directly to compressed formats not possible using hardware.
Supporting this feature would involve read-back of the texture and re-compression on the
CPU, which would be prohibitively slow.
3) Should we support mip map generation?
RESOLUTION: No. Mip map generation is not supported for compressed textures. However,
uploading to specific mip level is supported.