Name NV_texture_compression_s3tc_update Name Strings GL_NV_texture_compression_s3tc_update Contact Musawir Shah, NVIDIA Corporation (mshah 'at' nvidia.com) Contributors Nicholas Haemel, NVIDIA Corporation Acorn Pooley, NVIDIA Corporation Antti Rasmus, NVIDIA Corporation Musawir Shah, NVIDIA Corporation Ian Stewart, NVIDIA Corporation Status Complete. Version Last Modified Date: April 6, 2011 NVIDIA Revision: 1.0 Number OpenGL ES Extension #95 Dependencies 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. IP Status NVIDIA Proprietary New Procedures and Functions None New Tokens 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 , which must match except when is TEXTURE_2D and 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 RGB and RGBA formats are supported during texture image processing. values other than RBA or RGBA will result in the INVALID_OPERATION error. In all other cases where does not match , 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. 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 that is not one of the above values generates the error INVALID_VALUE. When a compressed 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 or are not multiples of 4 an INVALID_OPERATION error is generated. If is not a multiple of 4 and + is less than or equal to the width of the LOD then an INVALID_OPERATION error is generated. If is not a multiple of 4 and + is less than or equal to 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 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 is not RGB or RGBA. If or are not multiples of 4 an INVALID_OPERATION error is generated. If is not a multiple of 4 and + is less than or equal to the width of the LOD then an INVALID_OPERATION error is generated. If is not a multiple of 4 and + is less than or equal to 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. Revision History Rev. Date Author Changes ---- -------- --------- ------------------------------------- 1 04/06/11 mshah First revision.