15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_texture_compression 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_texture_compression 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Pat Brown, Intel Corporation (patrick.r.brown 'at' intel.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright (c) 2000-2013 The Khronos Group Inc. Copyright terms at 165bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciSpecification Update Policy 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 215bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 225bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 235bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 245bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 255bd8deadSopenharmony_ci described in more detail at 265bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciStatus 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci Complete. Approved by ARB on March 16, 2000 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciVersion 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Last Modified Date: May 23, 2000 355bd8deadSopenharmony_ci Author Revision: 1.03 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciNumber 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci ARB Extension #12 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciDependencies 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci OpenGL 1.1 is required. 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci This extension is written against the OpenGL 1.2.1 Specification. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci This extension is written against the GLX Extensions for OpenGL 485bd8deadSopenharmony_ci Specification (Version 1.3). 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci Depends on GL_ARB_texture_cube_map, as cube maps may be stored in 515bd8deadSopenharmony_ci compressed form. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciOverview 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Compressing texture images can reduce texture memory utilization and 565bd8deadSopenharmony_ci improve performance when rendering textured primitives. This extension 575bd8deadSopenharmony_ci allows OpenGL applications to use compressed texture images by providing: 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci (1) A framework upon which extensions providing specific compressed 605bd8deadSopenharmony_ci image formats can be built. 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci (2) A set of generic compressed internal formats that allow 635bd8deadSopenharmony_ci applications to specify that texture images should be stored in 645bd8deadSopenharmony_ci compressed form without needing to code for specific compression 655bd8deadSopenharmony_ci formats. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci An application can define compressed texture images by providing a texture 685bd8deadSopenharmony_ci image stored in a specific compressed image format. This extension does 695bd8deadSopenharmony_ci not define any specific compressed image formats, but it does provide the 705bd8deadSopenharmony_ci mechanisms necessary to enable other extensions that do. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci An application can also define compressed texture images by providing an 735bd8deadSopenharmony_ci uncompressed texture image but specifying a compressed internal format. 745bd8deadSopenharmony_ci In this case, the GL will automatically compress the texture image using 755bd8deadSopenharmony_ci the appropriate image format. Compressed internal formats can either be 765bd8deadSopenharmony_ci specific (as above) or generic. Generic compressed internal formats are 775bd8deadSopenharmony_ci not actual image formats, but are instead mapped into one of the specific 785bd8deadSopenharmony_ci compressed formats provided by the GL (or to an uncompressed base internal 795bd8deadSopenharmony_ci format if no appropriate compressed format is available). Generic 805bd8deadSopenharmony_ci compressed internal formats allow applications to use texture compression 815bd8deadSopenharmony_ci without needing to code to any particular compression algorithm. Generic 825bd8deadSopenharmony_ci compressed formats allow the use of texture compression across a wide 835bd8deadSopenharmony_ci range of platforms with differing compression algorithms and also allow 845bd8deadSopenharmony_ci future GL implementations to substitute improved compression methods 855bd8deadSopenharmony_ci transparently. 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci Compressed texture images can be obtained from the GL in uncompressed form 885bd8deadSopenharmony_ci by calling GetTexImage and in compressed form by calling 895bd8deadSopenharmony_ci GetCompressedTexImageARB. Queried compressed images can be saved and 905bd8deadSopenharmony_ci later reused by calling CompressedTexImage[123]DARB. Pre-compressed 915bd8deadSopenharmony_ci texture images do not need to be processed by the GL and should 925bd8deadSopenharmony_ci significantly improve texture loading performance relative to uncompressed 935bd8deadSopenharmony_ci images. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci This extension does not define specific compressed image formats (e.g., 965bd8deadSopenharmony_ci S3TC, FXT1), nor does it provide means to encode or decode such images. 975bd8deadSopenharmony_ci To support images in a specific compressed format, a hardware vendor 985bd8deadSopenharmony_ci would: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci (1) Provide a new extension defininig specific compressed 1015bd8deadSopenharmony_ci <internalformat> and <format> tokens for TexImage[123]D, 1025bd8deadSopenharmony_ci TexSubImage[123]D, CopyTexImage[12]D, CompressedTexImage[123]DARB, 1035bd8deadSopenharmony_ci CompressedTexSubImage[123]DARB, and GetCompressedTexImageARB calls. 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci (2) Specify the encoding of compressed images of that specific format. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci (3) Specify a method for deriving the size of compressed images of that 1085bd8deadSopenharmony_ci specific format, using the <internalformat>, <width>, <height>, 1095bd8deadSopenharmony_ci <depth> parameters, and (if necessary) the compressed image itself. 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ciIP Status 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci No known intellectual property issues on this general extension. 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci Specific compression algorithms used to implement this extension (and any 1165bd8deadSopenharmony_ci other specific texture compression extensions) may be protected and 1175bd8deadSopenharmony_ci require licensing agreements. 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ciIssues 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci (1) Should we define additional internal formats that strongly tie an 1225bd8deadSopenharmony_ci underlying compression algorithm to the format? 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci RESOLVED: Not here. Explicit compressed formats will be provided by 1255bd8deadSopenharmony_ci other extensions built on top of this one. 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci (2) Should we provide additional compression state that gives more control 1285bd8deadSopenharmony_ci on the level/quality of compression? If so, how? 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci RESOLVED: Yes, as a hint. Could have also been implemented as a [0.0, 1315bd8deadSopenharmony_ci 1.0] floating-point TexParameter "quality" state variable (such as the 1325bd8deadSopenharmony_ci JPEG quality scale found in many apps). This control will affect only 1335bd8deadSopenharmony_ci the speed (and quality) with which a driver compresses incoming images, 1345bd8deadSopenharmony_ci but will not affect the compressed image format selected by the driver. 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci As the spec is currently formulated, the requirement that quality 1375bd8deadSopenharmony_ci control not affect compression format selection could have been relaxed 1385bd8deadSopenharmony_ci by loosening the invariance requirements (so that the quality control 1395bd8deadSopenharmony_ci can affect the choice of internal format). The risk was the potential 1405bd8deadSopenharmony_ci for subtle mipmap consistency issues if the hint changes. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci (3) Most current compression algorithms handle primarily RGB and RGBA 1435bd8deadSopenharmony_ci images. Does it make sense having generic compressed formats for alpha, 1445bd8deadSopenharmony_ci intensity, luminance, and luminance-alpha? 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci RESOLVED: Yes. It is conceivable that some or all of these formats may 1475bd8deadSopenharmony_ci be compressed. Implementations not having compression algorithms for 1485bd8deadSopenharmony_ci these formats can simply choose not to compress and use the appropriate 1495bd8deadSopenharmony_ci base internal format instead. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci (4) Full GetTexImage support requires that the renderer decompress the 1525bd8deadSopenharmony_ci whole image. Should this extra implementation burden be imposed on the 1535bd8deadSopenharmony_ci renderer? 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci RESOLVED: Yes, returning the uncompressed image is a useful feature for 1565bd8deadSopenharmony_ci evaluating the quality of the compressed image. A decompression engine 1575bd8deadSopenharmony_ci may also be required for a number of other areas, including software 1585bd8deadSopenharmony_ci rasterization. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci (5) Full TexSubImage support may require that the renderer decompress 1615bd8deadSopenharmony_ci portions of the image (or perhaps the whole image), do a merge, and then 1625bd8deadSopenharmony_ci recompress. Even if this were done, portions of the image outside the 1635bd8deadSopenharmony_ci "modified" area may also be modified due to lossy compression. Should this 1645bd8deadSopenharmony_ci extra implementation burden be imposed on the renderer? 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci RESOLVED: No. To avoid the complications involved with modifying a 1675bd8deadSopenharmony_ci compressed texture image, only the lower-left corner may be modified by 1685bd8deadSopenharmony_ci TexSubImage. In addition, after calling TexSubImage, the "unmodified" 1695bd8deadSopenharmony_ci portion of the image is left undefined. An INVALID_OPERATION error 1705bd8deadSopenharmony_ci results from any other TexSubImage calls. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci This behavior allows for the use of compressed images whose dimensions 1735bd8deadSopenharmony_ci are not powers of two, which TexImage will not accept. The recommended 1745bd8deadSopenharmony_ci sequence of calls for defining such images is to first call TexImage 1755bd8deadSopenharmony_ci with a NULL <data> pointer and the image size parameters padded out to 1765bd8deadSopenharmony_ci the next power of two, and then call CompressedTexSubImageARB or 1775bd8deadSopenharmony_ci TexSubImage with <xoffset>, <yoffset>, and <zoffset> parameters of zero 1785bd8deadSopenharmony_ci and the compressed data pointed to by <data>. This behavior also allows 1795bd8deadSopenharmony_ci TexSubImage to be used as a light-weight replacement of TexImage, where 1805bd8deadSopenharmony_ci only the image contents are modified. 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci Certain compressed formats may allow a wider variety of edits -- their 1835bd8deadSopenharmony_ci specifications will document the restrictions under which these edits 1845bd8deadSopenharmony_ci are permitted. it is impossible to document such restrictions for 1855bd8deadSopenharmony_ci unknown generic formats. It is desirable to keep the behavior of 1865bd8deadSopenharmony_ci generic formats and the specific formats they map to as consistent as 1875bd8deadSopenharmony_ci possible. 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci (6) What do the return values of the component sizes (RED_BITS, 1905bd8deadSopenharmony_ci GREEN_BITS, ...) give for compressed textures? Compressed proxy textures? 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci RESOLVED: Some behavior has to be defined. For both normal and proxy 1935bd8deadSopenharmony_ci textures, we return the bit depths of an uncompressed sized image that 1945bd8deadSopenharmony_ci would most closely match the quality of the compression algorithm for an 1955bd8deadSopenharmony_ci "average" texture image. Since compressed image quality is highly data 1965bd8deadSopenharmony_ci dependent, the actual compressed image quality may be better or worse 1975bd8deadSopenharmony_ci than the renderer's best guess at the best matching sized internal 1985bd8deadSopenharmony_ci format. To implement this feature in a driver, it is expected that an 1995bd8deadSopenharmony_ci error analysis would be done on a set of representative images, and the 2005bd8deadSopenharmony_ci resultant "equivalent bit depths" would be hardwired constants. 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci (7) What should GetTexLevelParameter with TEXTURE_COMPRESSED_ 2035bd8deadSopenharmony_ci IMAGE_SIZE_ARB return for existing uncompressed formats? For proxy 2045bd8deadSopenharmony_ci textures? 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci RESOLVED: For both, an INVALID_OPERATION error results. The actual 2075bd8deadSopenharmony_ci image to be compressed is not available for proxies, so actually 2085bd8deadSopenharmony_ci compressing the specified image is not an option. 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci For uncompressed internal formats, we could return the actual amount of 2115bd8deadSopenharmony_ci memory taken by the texture image. Such a mechanism might be useful as 2125bd8deadSopenharmony_ci a metric of "how much space does this texture image take". It's not 2135bd8deadSopenharmony_ci particularly useful for an application based texture management scheme, 2145bd8deadSopenharmony_ci since there is no information available indicating the amount of 2155bd8deadSopenharmony_ci available memory. In addition, because of implementation-dependent 2165bd8deadSopenharmony_ci hardware constraints, the amount of texture memory consumed by a texture 2175bd8deadSopenharmony_ci object is not necessarily equal to the sum of the memory consumed by 2185bd8deadSopenharmony_ci each of its mipmaps. The OpenGL ARB decided against adopting this 2195bd8deadSopenharmony_ci behavior when this specification was approved. 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci (8) What about texture borders? 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci RESOLVED: Not a problem for generic compressed formats since a base 2245bd8deadSopenharmony_ci internal format can be used if borders are not supported in the 2255bd8deadSopenharmony_ci compressed image format. Borders may pose problems for specific 2265bd8deadSopenharmony_ci compression extensions, and compressed textures with borders might well 2275bd8deadSopenharmony_ci be disallowed by those extensions. 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci (9) Should certain pixel operations be disallowed for compressed texture 2305bd8deadSopenharmony_ci internal formats (e.g., PixelStorage, PixelTransfer)? What about byte 2315bd8deadSopenharmony_ci swapping? 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci RESOLVED: For uncompressed source images, all pixel storage and pixel 2345bd8deadSopenharmony_ci transfer modes will be applied prior to compression. For compressed 2355bd8deadSopenharmony_ci source images, all pixel storage and transfer modes will be ignored. 2365bd8deadSopenharmony_ci The encoding of compressed images should be specified as a byte stream 2375bd8deadSopenharmony_ci that matches the disk file format defined for the corresponding image 2385bd8deadSopenharmony_ci type. 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci (10) Should functionality be provided to allow applications to save 2415bd8deadSopenharmony_ci compressed images to disk and reuse them in subsequent runs without 2425bd8deadSopenharmony_ci programming to specific formats? If so, how? 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci RESOLVED: Yes. This can be done without knowledge of specific 2455bd8deadSopenharmony_ci compression formats in the following manner: 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ci * Call TexImage with an uncompressed image and a generic compressed 2485bd8deadSopenharmony_ci internal format. The texture image will be compressed by the GL, if 2495bd8deadSopenharmony_ci possible. 2505bd8deadSopenharmony_ci 2515bd8deadSopenharmony_ci * Call GetTexLevelParameteriv with a <value> of TEXTURE_COMPRESSED_ARB 2525bd8deadSopenharmony_ci to determine if the GL was able to store the image in compressed 2535bd8deadSopenharmony_ci form. 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci * Call GetTexLevelParameteriv with a <value> of 2565bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT to determine the specific compressed image 2575bd8deadSopenharmony_ci format in which the image is stored. 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci * Call GetTexLevelParameteriv with a <value> of 2605bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB to determine the size (in ubytes) 2615bd8deadSopenharmony_ci of the compressed image that will be returned by the GL. Allocate a 2625bd8deadSopenharmony_ci buffer of at least this size. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci * Call GetCompressedTexImageARB. The GL will write the compressed 2655bd8deadSopenharmony_ci texture image into the allocated buffer. 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci * Save the returned compressed image to disk, along with the 2685bd8deadSopenharmony_ci associated width, height, depth, border parameters and the returned 2695bd8deadSopenharmony_ci values of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB and 2705bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT. 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci * Load the compressed image and its parameters, and call 2735bd8deadSopenharmony_ci CompressedTexImage_[123]DARB to use the compressed image. The value 2745bd8deadSopenharmony_ci of TEXTURE_INTERNAL_FORMAT should be used as <internalFormat> and 2755bd8deadSopenharmony_ci the value of TEXTURE_COMPRESSED_IMAGE_SIZE_ARB should be used as 2765bd8deadSopenharmony_ci <imageSize>. 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci The saved images will be valid as long as they are used on a device 2795bd8deadSopenharmony_ci supporting the returned <internalFormat> parameter. If the saved images 2805bd8deadSopenharmony_ci are used on a device that does not support the compressed internal 2815bd8deadSopenharmony_ci format, an INVALID_ENUM error would be generated by the call to 2825bd8deadSopenharmony_ci CompressedTexImage_[123]D because of the unknown format. 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci Note also that to reliably determine if the GL will compress an image 2855bd8deadSopenharmony_ci without actually compressing it, an application need only define a proxy 2865bd8deadSopenharmony_ci texture image and query TEXTURE_COMPRESSED_ARB as above. 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ci (11) Without knowing of the compressed image format, there is no 2895bd8deadSopenharmony_ci convenient way for the client-side GLX library or tracing tools to 2905bd8deadSopenharmony_ci ascertain the size of a compressed texture image when sending a 2915bd8deadSopenharmony_ci TexImage1D, TexImage2D, or TexImage3D packet or interpret pixel storage 2925bd8deadSopenharmony_ci modes. To complicate matters further, it is possible to create both 2935bd8deadSopenharmony_ci indirect (that might not understand an image format) and direct rendering 2945bd8deadSopenharmony_ci contexts (that might understand an image format) on the same renderer. 2955bd8deadSopenharmony_ci How should this be solved? 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci RESOLVED: A separate set of CompressedTexImage and 2985bd8deadSopenharmony_ci CompressedTexSubImage calls has been created that allows libraries to 2995bd8deadSopenharmony_ci pass compressed images along to the renderer without needing to 3005bd8deadSopenharmony_ci understand their specific image formats or how to interpret pixel 3015bd8deadSopenharmony_ci storage modes. 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci (12) Are the CompressedTexImage[123]DARB entry points really needed? 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci RESOLVED: Yes. To robustly support images of unknown format, specific 3065bd8deadSopenharmony_ci compressed entry points are required. While the extension does not 3075bd8deadSopenharmony_ci support images in a completely unspecified format (early drafts did), 3085bd8deadSopenharmony_ci having a separate call means that GLX and tools such as GLS (stream 3095bd8deadSopenharmony_ci encoder) do not need intimate knowledge of every compressed image 3105bd8deadSopenharmony_ci format. Having separate calls also cleanly solves the problem where 3115bd8deadSopenharmony_ci pixel storage and pixel transfer operations apply if and only if the 3125bd8deadSopenharmony_ci source image is uncompressed. 3135bd8deadSopenharmony_ci 3145bd8deadSopenharmony_ci (13) Is variable-ratio compression supported? 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci RESOLVED: Yes. Fixed-ratio compression is currently the predominant 3175bd8deadSopenharmony_ci texture compression format, but this spec should not preclude the use of 3185bd8deadSopenharmony_ci other compression schemes. 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci (14) Should the <imageSize> parameter be validated on CompressedTexImage 3215bd8deadSopenharmony_ci calls? 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci RESOLVED: Yes. Enforcement overhead is generally trivial. Without 3245bd8deadSopenharmony_ci enforcement, an application could specify incorrect image sizes but 3255bd8deadSopenharmony_ci notice them only when run on an indirect renderer, causing portability 3265bd8deadSopenharmony_ci problems. There is also a reliability issue with respect to the GLX 3275bd8deadSopenharmony_ci environment -- if the compressed image size provided by the user is less 3285bd8deadSopenharmony_ci than the required image size, the GLX server may run off the end of the 3295bd8deadSopenharmony_ci image and access invalid memory. A size check may thus be desirable to 3305bd8deadSopenharmony_ci prevent server crashes (even though that could be considered an 3315bd8deadSopenharmony_ci "undefined" result). 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci While enforcing correct <imageSize> parameters is trivial for current 3345bd8deadSopenharmony_ci compressed internal formats, it might not be reasonable on others 3355bd8deadSopenharmony_ci (particular variable-ratio compression formats). For such formats, this 3365bd8deadSopenharmony_ci restriction should be overridden in the spec defining the formats. The 3375bd8deadSopenharmony_ci <imageSize> check was made mandatory only in the final draft approved at 3385bd8deadSopenharmony_ci the March 2000 OpenGL ARB meeting. 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci (15) Should TexImage calls fall back to uncompressed image formats when 3415bd8deadSopenharmony_ci <internalformat> is a specific compressed format but its use in 3425bd8deadSopenharmony_ci combination with other parameter values passed is not supported by the 3435bd8deadSopenharmony_ci renderer? 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci RESOLVED: Yes. Advantages: Works in exactly the same way as generic 3465bd8deadSopenharmony_ci formats, meaning no extra code/error checking. Inherent limitations of 3475bd8deadSopenharmony_ci TexImage on specific formats should be documented in their specs and 3485bd8deadSopenharmony_ci observed by their users. One simple query can detect fallback cases. 3495bd8deadSopenharmony_ci Disadvantages: Silent fallback to a format not requested by the user. 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci (16) Should the texture format invariance requirements disallow scanning 3525bd8deadSopenharmony_ci of the image data to select a compression method? What about for a base 3535bd8deadSopenharmony_ci (uncompressed) internal format? 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci RESOLVED: The primary issue is mipmap consistency. The 1.2.1 spec 3565bd8deadSopenharmony_ci defines a set of mipmaps as consistent if all are specified using the 3575bd8deadSopenharmony_ci same internal format. However, it doesn't require that all mipmaps are 3585bd8deadSopenharmony_ci allocated using the same format -- the renderer is responsible for 3595bd8deadSopenharmony_ci ensuring mipmap consistency if it selects different formats for 3605bd8deadSopenharmony_ci different images. There is no reason to disallow scanning for base 3615bd8deadSopenharmony_ci internal formats; the renderer is responsible for doing the right thing. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci The selection of a specific compressed internal format is different. It 3645bd8deadSopenharmony_ci must be independent of the the image data because the GL treats the 3655bd8deadSopenharmony_ci texture image as though it were specified using the specific compressed 3665bd8deadSopenharmony_ci internal format chosen by the renderer. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci (17) Should functionality be provided to enumerate the specific compressed 3695bd8deadSopenharmony_ci formats supported by the renderer? If so, how and what will it accomplish? 3705bd8deadSopenharmony_ci 3715bd8deadSopenharmony_ci RESOLVED: Yes. A glGet* query is added to return the number of 3725bd8deadSopenharmony_ci compressed internal formats supported by the renderer and the 3735bd8deadSopenharmony_ci <internalformat> tokens for each. These tokens can subsequently be used 3745bd8deadSopenharmony_ci as <internalformat> parameters for normal TexImage calls and the new 3755bd8deadSopenharmony_ci CompressedTexImage calls. 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci Providing an internal format enumeration allows applications to weigh 3785bd8deadSopenharmony_ci the suitability of the various compression methods provided to it by the 3795bd8deadSopenharmony_ci renderer without needing specific knowledge of the formats. 3805bd8deadSopenharmony_ci Applications can query the component sizes (see issue 6) to determine 3815bd8deadSopenharmony_ci the base format and approximate precision. Applications can directly 3825bd8deadSopenharmony_ci evaluate image compression quality by having the renderer generate 3835bd8deadSopenharmony_ci compressed texture images (using the returned <internalformat> values) 3845bd8deadSopenharmony_ci and return them in uncompressed form using GetTexImage. Applications 3855bd8deadSopenharmony_ci should also be aware that the use of the internal formats returned by 3865bd8deadSopenharmony_ci this query is subject to the restrictions imposed by the specification 3875bd8deadSopenharmony_ci defining them. The use of proxy textures allows the application to 3885bd8deadSopenharmony_ci determine if a specific set of TexImage parameters is supported for a 3895bd8deadSopenharmony_ci given internal format. 3905bd8deadSopenharmony_ci 3915bd8deadSopenharmony_ci The renderer should enumerate all supported compression formats EXCEPT 3925bd8deadSopenharmony_ci those that operate fundamentally differently from a normal uncompressed 3935bd8deadSopenharmony_ci format. For example, the DirectX DXT1 compression format is 3945bd8deadSopenharmony_ci fundamentally an RGB format, but it has a "transparent" encoding where 3955bd8deadSopenharmony_ci the red, green, and blue component values are forced to zero, regardless 3965bd8deadSopenharmony_ci of their original (uncompressed) values. Since such formats may have 3975bd8deadSopenharmony_ci caveats that must be understood before being used, they should not be 3985bd8deadSopenharmony_ci enumerated by this query. 3995bd8deadSopenharmony_ci 4005bd8deadSopenharmony_ci This allows for forward compatibility -- an application can exploit 4015bd8deadSopenharmony_ci compression techniques provided by future renderers. 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci (18) Should the separate GetCompressedTexImageARB function exist, or is 4045bd8deadSopenharmony_ci GetTexImage with special <format> and/or <type> parameters 4055bd8deadSopenharmony_ci sufficient? 4065bd8deadSopenharmony_ci 4075bd8deadSopenharmony_ci RESOLVED: Provide a separate GetCompressedTexImageARB function. The 4085bd8deadSopenharmony_ci primary rationale is for GLX indirect rendering. The client GetTexImage 4095bd8deadSopenharmony_ci would require information to determine if an image is uncompressed (and 4105bd8deadSopenharmony_ci should be decoded using pixel storage state) or compressed (pixel 4115bd8deadSopenharmony_ci storage ignored). In addition, if the image is compressed, the actual 4125bd8deadSopenharmony_ci image size would be required, but the only image size that could be 4135bd8deadSopenharmony_ci inferred from the GLX protocol is padded out to a multiple of four 4145bd8deadSopenharmony_ci bytes. A separate call is the cleanest solution to both issues. 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ciNew Procedures and Functions 4175bd8deadSopenharmony_ci 4185bd8deadSopenharmony_ci void CompressedTexImage3DARB(enum target, int level, 4195bd8deadSopenharmony_ci enum internalformat, sizei width, 4205bd8deadSopenharmony_ci sizei height, sizei depth, 4215bd8deadSopenharmony_ci int border, sizei imageSize, 4225bd8deadSopenharmony_ci const void *data); 4235bd8deadSopenharmony_ci void CompressedTexImage2DARB(enum target, int level, 4245bd8deadSopenharmony_ci enum internalformat, sizei width, 4255bd8deadSopenharmony_ci sizei height, int border, 4265bd8deadSopenharmony_ci sizei imageSize, const void *data); 4275bd8deadSopenharmony_ci void CompressedTexImage1DARB(enum target, int level, 4285bd8deadSopenharmony_ci enum internalformat, sizei width, 4295bd8deadSopenharmony_ci int border, sizei imageSize, 4305bd8deadSopenharmony_ci const void *data); 4315bd8deadSopenharmony_ci void CompressedTexSubImage3DARB(enum target, int level, 4325bd8deadSopenharmony_ci int xoffset, int yoffset, 4335bd8deadSopenharmony_ci int zoffset, sizei width, 4345bd8deadSopenharmony_ci sizei height, sizei depth, 4355bd8deadSopenharmony_ci enum format, sizei imageSize, 4365bd8deadSopenharmony_ci const void *data); 4375bd8deadSopenharmony_ci void CompressedTexSubImage2DARB(enum target, int level, 4385bd8deadSopenharmony_ci int xoffset, int yoffset, 4395bd8deadSopenharmony_ci sizei width, sizei height, 4405bd8deadSopenharmony_ci enum format, sizei imageSize, 4415bd8deadSopenharmony_ci const void *data); 4425bd8deadSopenharmony_ci void CompressedTexSubImage1DARB(enum target, int level, 4435bd8deadSopenharmony_ci int xoffset, sizei width, 4445bd8deadSopenharmony_ci enum format, sizei imageSize, 4455bd8deadSopenharmony_ci const void *data); 4465bd8deadSopenharmony_ci void GetCompressedTexImageARB(enum target, int lod, 4475bd8deadSopenharmony_ci void *img); 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ciNew Tokens 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of TexImage1D, TexImage2D, 4525bd8deadSopenharmony_ci TexImage3D, CopyTexImage1D, and CopyTexImage2D: 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci COMPRESSED_ALPHA_ARB 0x84E9 4555bd8deadSopenharmony_ci COMPRESSED_LUMINANCE_ARB 0x84EA 4565bd8deadSopenharmony_ci COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB 4575bd8deadSopenharmony_ci COMPRESSED_INTENSITY_ARB 0x84EC 4585bd8deadSopenharmony_ci COMPRESSED_RGB_ARB 0x84ED 4595bd8deadSopenharmony_ci COMPRESSED_RGBA_ARB 0x84EE 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci Accepted by the <target> parameter of Hint and the <value> parameter of 4625bd8deadSopenharmony_ci GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev: 4635bd8deadSopenharmony_ci 4645bd8deadSopenharmony_ci TEXTURE_COMPRESSION_HINT_ARB 0x84EF 4655bd8deadSopenharmony_ci 4665bd8deadSopenharmony_ci Accepted by the <value> parameter of GetTexLevelParameter: 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 4695bd8deadSopenharmony_ci TEXTURE_COMPRESSED_ARB 0x86A1 4705bd8deadSopenharmony_ci 4715bd8deadSopenharmony_ci Accepted by the <value> parameter of GetIntegerv, GetBooleanv, GetFloatv, 4725bd8deadSopenharmony_ci and GetDoublev: 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 4755bd8deadSopenharmony_ci COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 4765bd8deadSopenharmony_ci 4775bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 4785bd8deadSopenharmony_ci 4795bd8deadSopenharmony_ci None. 4805bd8deadSopenharmony_ci 4815bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci Modify Section 3.8.1, Texture Image Specification (p.113) 4845bd8deadSopenharmony_ci 4855bd8deadSopenharmony_ci (p.113, modify 3rd paragraph) <internalformat> may be specified as one of 4865bd8deadSopenharmony_ci the six base internal format symbolic constants listed in table 3.15, as 4875bd8deadSopenharmony_ci one of the sized internal format symbolic constants listed in table 3.16, 4885bd8deadSopenharmony_ci as one of the specific compressed internal format symbolic constants 4895bd8deadSopenharmony_ci listed in table 3.16.1, or as one of the six generic compressed internal 4905bd8deadSopenharmony_ci format symbolic constants listed in table 3.16.2. 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci (p.113, add after 3rd paragraph) 4935bd8deadSopenharmony_ci 4945bd8deadSopenharmony_ci The ARB_texture_compression specification provides no specific compressed 4955bd8deadSopenharmony_ci internal formats but does provide a mechanism to obtain the enums for such 4965bd8deadSopenharmony_ci formats provided by other specifications. If the ARB_texture_compression 4975bd8deadSopenharmony_ci extension is supported, the number of specific compressed internal format 4985bd8deadSopenharmony_ci symbolic constants supported by the renderer can be obtained by querying 4995bd8deadSopenharmony_ci the value of NUM_COMPRESSED_TEXTURE_FORMATS_ARB. The set of specific 5005bd8deadSopenharmony_ci compressed internal format symbolic constants supported by the renderer 5015bd8deadSopenharmony_ci can be obtained by querying the value of COMPRESSED_TEXTURE_FORMATS_ARB. 5025bd8deadSopenharmony_ci The only symbolic constants returned by this query are those suitable for 5035bd8deadSopenharmony_ci general-purpose usage. The renderer will not enumerate formats with 5045bd8deadSopenharmony_ci restrictions that need to be specifically understood prior to use. 5055bd8deadSopenharmony_ci 5065bd8deadSopenharmony_ci Generic compressed internal formats are never used directly as the 5075bd8deadSopenharmony_ci internal formats of texture images. If <internalformat> is one of the six 5085bd8deadSopenharmony_ci generic compressed internal formats, its value is replaced by the symbolic 5095bd8deadSopenharmony_ci constant for a specific compressed internal format of the GL's choosing 5105bd8deadSopenharmony_ci with the same base internal format. If no specific compressed format is 5115bd8deadSopenharmony_ci available, <internalformat> is instead replaced by the corresponding base 5125bd8deadSopenharmony_ci internal format. If <internalformat> is given as or mapped to a specific 5135bd8deadSopenharmony_ci compressed internal format, but the GL can not support images compressed 5145bd8deadSopenharmony_ci in the chosen internal format for any reason (e.g., the compression format 5155bd8deadSopenharmony_ci might not support 3D textures or borders), <internalformat> is replaced by 5165bd8deadSopenharmony_ci the corresponding base internal format and the texture image will not be 5175bd8deadSopenharmony_ci compressed by the GL. 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ci (p.113, modify 4th paragraph) ... If a compressed internal format is 5205bd8deadSopenharmony_ci specified, the mapping of the R, G, B, and A values to texture components 5215bd8deadSopenharmony_ci is equivalent to the mapping of the corresponding base internal format's 5225bd8deadSopenharmony_ci components, as specified in table 3.15. The specified image is compressed 5235bd8deadSopenharmony_ci using a (possibly lossy) compression algorithm chosen by the GL. 5245bd8deadSopenharmony_ci 5255bd8deadSopenharmony_ci (p.113, 5th paragraph) A GL implementation may vary its allocation of 5265bd8deadSopenharmony_ci internal component resolution or compressed internal format based on any 5275bd8deadSopenharmony_ci TexImage3D, TexImage2D, or TexImage1D (see below) parameter (except 5285bd8deadSopenharmony_ci <target>, but the allocation and chosen compressed image format must not 5295bd8deadSopenharmony_ci be a function of any other state and cannot be changed once they are 5305bd8deadSopenharmony_ci established. In addition, the choice of a compressed image format may not 5315bd8deadSopenharmony_ci be affected by the <data> parameter. Allocations must be invariant; the 5325bd8deadSopenharmony_ci same allocation and compressed image format must be chosen each time a 5335bd8deadSopenharmony_ci texture image is specified with the same parameter values. These 5345bd8deadSopenharmony_ci allocation rules also apply to proxy textures, which are described in 5355bd8deadSopenharmony_ci section 3.8.7. 5365bd8deadSopenharmony_ci 5375bd8deadSopenharmony_ci Add Table 3.16.1: Specific Compressed Internal Formats 5385bd8deadSopenharmony_ci 5395bd8deadSopenharmony_ci Compressed Internal Format Base Internal Format 5405bd8deadSopenharmony_ci ========================== ==================== 5415bd8deadSopenharmony_ci none provided here -- defined by dependent extensions 5425bd8deadSopenharmony_ci 5435bd8deadSopenharmony_ci 5445bd8deadSopenharmony_ci Add Table 3.16.2: Generic Compressed Internal Formats 5455bd8deadSopenharmony_ci 5465bd8deadSopenharmony_ci Generic Compressed Internal 5475bd8deadSopenharmony_ci Format Base Internal Format 5485bd8deadSopenharmony_ci ========================== ==================== 5495bd8deadSopenharmony_ci COMPRESSED_ALPHA_ARB ALPHA 5505bd8deadSopenharmony_ci COMPRESSED_LUMINANCE_ARB LUMINANCE 5515bd8deadSopenharmony_ci COMPRESSED_LUMINANCE_ALPHA_ARB LUMINANCE_ALPHA 5525bd8deadSopenharmony_ci COMPRESSED_INTENSITY_ARB INTENSITY 5535bd8deadSopenharmony_ci COMPRESSED_RGB_ARB RGB 5545bd8deadSopenharmony_ci COMPRESSED_RGBA_ARB RGBA 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci 5575bd8deadSopenharmony_ci Modify Section 3.8.2, Alternate Image Specification 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ci (add to end of TexSubImage discussion, p.123) 5605bd8deadSopenharmony_ci 5615bd8deadSopenharmony_ci Texture images with compressed internal formats may be stored in such a 5625bd8deadSopenharmony_ci way that it is not possible to edit an image with subimage commands 5635bd8deadSopenharmony_ci without having to decompress and recompress the texture image being 5645bd8deadSopenharmony_ci edited. Even if the image were edited in this manner, it may not be 5655bd8deadSopenharmony_ci possible to preserve the contents of some of the texels outside the region 5665bd8deadSopenharmony_ci being modified. To avoid these complications, the GL does not support 5675bd8deadSopenharmony_ci arbitrary edits to texture images with compressed internal formats. 5685bd8deadSopenharmony_ci Calling TexSubImage3D, CopyTexSubImage3D, TexSubImage2D, 5695bd8deadSopenharmony_ci CopyTexSubImage2D, TexSubImage1D, or CopyTexSubImage1D will result in an 5705bd8deadSopenharmony_ci INVALID_OPERATION error if <xoffset>, <yoffset>, or <zoffset> is not equal 5715bd8deadSopenharmony_ci to -b_s (border). In addition, the contents of any texel outside the 5725bd8deadSopenharmony_ci region modified by such a call are undefined. These restrictions may be 5735bd8deadSopenharmony_ci relaxed for specific compressed internal formats whose images are easily 5745bd8deadSopenharmony_ci edited. 5755bd8deadSopenharmony_ci 5765bd8deadSopenharmony_ci (add new subsection at end of section, p.123) 5775bd8deadSopenharmony_ci 5785bd8deadSopenharmony_ci Compressed Texture Images 5795bd8deadSopenharmony_ci 5805bd8deadSopenharmony_ci Texture images may also be specified or modified using image data already 5815bd8deadSopenharmony_ci stored in a known compressed image format. The ARB_texture_compression 5825bd8deadSopenharmony_ci extension defines no such formats, but provides the mechanisms for other 5835bd8deadSopenharmony_ci extensions that do. 5845bd8deadSopenharmony_ci 5855bd8deadSopenharmony_ci The commands 5865bd8deadSopenharmony_ci 5875bd8deadSopenharmony_ci void CompressedTexImage1DARB(enum target, int level, 5885bd8deadSopenharmony_ci enum internalformat, sizei width, 5895bd8deadSopenharmony_ci int border, sizei imageSize, 5905bd8deadSopenharmony_ci const void *data); 5915bd8deadSopenharmony_ci void CompressedTexImage2DARB(enum target, int level, 5925bd8deadSopenharmony_ci enum internalformat, sizei width, 5935bd8deadSopenharmony_ci sizei height, int border, 5945bd8deadSopenharmony_ci sizei imageSize, const void *data); 5955bd8deadSopenharmony_ci void CompressedTexImage3DARB(enum target, int level, 5965bd8deadSopenharmony_ci enum internalformat, sizei width, 5975bd8deadSopenharmony_ci sizei height, sizei depth, 5985bd8deadSopenharmony_ci int border, sizei imageSize, 5995bd8deadSopenharmony_ci const void *data); 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci define one-, two-, and three-dimensional texture images, respectively, 6025bd8deadSopenharmony_ci with incoming data stored in a specific compressed image format. The 6035bd8deadSopenharmony_ci <target>, <level>, <internalformat>, <width>, <height>, <depth>, and 6045bd8deadSopenharmony_ci <border> parameters have the same meaning as in TexImage1D, TexImage2D, 6055bd8deadSopenharmony_ci and TexImage3D. <data> points to compressed image data stored in the 6065bd8deadSopenharmony_ci compressed image format corresponding to <internalformat>. Since this 6075bd8deadSopenharmony_ci extension provides no specific image formats, using any of the six generic 6085bd8deadSopenharmony_ci compressed internal formats as <internalformat> will result in an 6095bd8deadSopenharmony_ci INVALID_ENUM error. 6105bd8deadSopenharmony_ci 6115bd8deadSopenharmony_ci For all other compressed internal formats, the compressed image will be 6125bd8deadSopenharmony_ci decoded according to the specification defining the <internalformat> 6135bd8deadSopenharmony_ci token. Compressed texture images are treated as an array of <imageSize> 6145bd8deadSopenharmony_ci ubytes beginning at address <data>. All pixel storage and pixel transfer 6155bd8deadSopenharmony_ci modes are ignored when decoding a compressed texture image. If the 6165bd8deadSopenharmony_ci <imageSize> parameter is not consistent with the format, dimensions, and 6175bd8deadSopenharmony_ci contents of the compressed image, an INVALID_VALUE error results. If the 6185bd8deadSopenharmony_ci compressed image is not encoded according to the defined image format, the 6195bd8deadSopenharmony_ci results of the call are undefined. 6205bd8deadSopenharmony_ci 6215bd8deadSopenharmony_ci Specific compressed internal formats may impose format-specific 6225bd8deadSopenharmony_ci restrictions on the use of the compressed image specification calls or 6235bd8deadSopenharmony_ci parameters. For example, the compressed image format might be supported 6245bd8deadSopenharmony_ci only for 2D textures or may not allow non-zero <border> values. Any such 6255bd8deadSopenharmony_ci restrictions will be documented in the specification defining the 6265bd8deadSopenharmony_ci compressed internal format; violating these restrictions will result in an 6275bd8deadSopenharmony_ci INVALID_OPERATION error. 6285bd8deadSopenharmony_ci 6295bd8deadSopenharmony_ci Any restrictions imposed by specific compressed internal formats will be 6305bd8deadSopenharmony_ci invariant, meaning that if the GL accepts and stores a texture image in 6315bd8deadSopenharmony_ci compressed form, providing the same image to CompressedTexImage1DARB, 6325bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB will not result in an 6335bd8deadSopenharmony_ci INVALID_OPERATION error if the following restrictions are satisfied: 6345bd8deadSopenharmony_ci 6355bd8deadSopenharmony_ci * <data> points to a compressed texture image returned by 6365bd8deadSopenharmony_ci GetCompressedTexImageARB (Section 6.1.4). 6375bd8deadSopenharmony_ci 6385bd8deadSopenharmony_ci * <target>, <level>, and <internalformat> match the <target>, <level> 6395bd8deadSopenharmony_ci and <format> parameters provided to the GetCompressedTexImageARB call 6405bd8deadSopenharmony_ci returning <data>. 6415bd8deadSopenharmony_ci 6425bd8deadSopenharmony_ci * <width>, <height>, <depth>, <border>, <internalformat>, and 6435bd8deadSopenharmony_ci <imageSize> match the values of TEXTURE_WIDTH, TEXTURE_HEIGHT, 6445bd8deadSopenharmony_ci TEXTURE_DEPTH, TEXTURE_BORDER, TEXTURE_INTERNAL_FORMAT, and 6455bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB for image level <level> in effect at 6465bd8deadSopenharmony_ci the time of the GetCompressedTexImageARB call returning <data>. 6475bd8deadSopenharmony_ci 6485bd8deadSopenharmony_ci This guarantee applies not just to images returned by 6495bd8deadSopenharmony_ci GetCompressedTexImageARB, but also to any other properly encoded 6505bd8deadSopenharmony_ci compressed texture image of the same size and format. 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci 6535bd8deadSopenharmony_ci The commands 6545bd8deadSopenharmony_ci 6555bd8deadSopenharmony_ci void CompressedTexSubImage1DARB(enum target, int level, 6565bd8deadSopenharmony_ci int xoffset, sizei width, 6575bd8deadSopenharmony_ci enum format, sizei imageSize, 6585bd8deadSopenharmony_ci const void *data); 6595bd8deadSopenharmony_ci void CompressedTexSubImage2DARB(enum target, int level, 6605bd8deadSopenharmony_ci int xoffset, int yoffset, 6615bd8deadSopenharmony_ci sizei width, sizei height, 6625bd8deadSopenharmony_ci enum format, sizei imageSize, 6635bd8deadSopenharmony_ci const void *data); 6645bd8deadSopenharmony_ci void CompressedTexSubImage3DARB(enum target, int level, 6655bd8deadSopenharmony_ci int xoffset, int yoffset, 6665bd8deadSopenharmony_ci int zoffset, sizei width, 6675bd8deadSopenharmony_ci sizei height, sizei depth, 6685bd8deadSopenharmony_ci enum format, sizei imageSize, 6695bd8deadSopenharmony_ci const void *data); 6705bd8deadSopenharmony_ci 6715bd8deadSopenharmony_ci 6725bd8deadSopenharmony_ci respecify only a rectangular region of an existing texture array, with 6735bd8deadSopenharmony_ci incoming data stored in a known compressed image format. The <target>, 6745bd8deadSopenharmony_ci <level>, <xoffset>, <yoffset>, <zoffset>, <width>, <height>, and <depth> 6755bd8deadSopenharmony_ci parameters have the same meaning as in TexSubImage1D, TexSubImage2D, and 6765bd8deadSopenharmony_ci TexSubImage3D. <data> points to compressed image data stored in the 6775bd8deadSopenharmony_ci compressed image format corresponding to <format>. Since this extension 6785bd8deadSopenharmony_ci provides no specific image formats, using any of these six generic 6795bd8deadSopenharmony_ci compressed internal formats as <format> will result in an INVALID_ENUM 6805bd8deadSopenharmony_ci error. 6815bd8deadSopenharmony_ci 6825bd8deadSopenharmony_ci The image pointed to by <data> and the <imageSize> parameter are 6835bd8deadSopenharmony_ci interpreted as though they were provided to CompressedTexImage1DARB, 6845bd8deadSopenharmony_ci CompressedTexImage2DARB, and CompressedTexImage3DARB. These commands do 6855bd8deadSopenharmony_ci not provide for image format conversion, so an INVALID_OPERATION error 6865bd8deadSopenharmony_ci results if <format> does not match the internal format of the texture 6875bd8deadSopenharmony_ci image being modified. If the <imageSize> parameter is not consistent with 6885bd8deadSopenharmony_ci the format, dimensions, and contents of the compressed image (too little 6895bd8deadSopenharmony_ci or too much data), an INVALID_VALUE error results. 6905bd8deadSopenharmony_ci 6915bd8deadSopenharmony_ci As with CompressedTexImage calls, compressed internal formats may have 6925bd8deadSopenharmony_ci additional restrictions on the use of the compressed image specification 6935bd8deadSopenharmony_ci calls or parameters. Any such restrictions will be documented in the 6945bd8deadSopenharmony_ci specification defining the compressed internal format; violating these 6955bd8deadSopenharmony_ci restrictions will result in an INVALID_OPERATION error. 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci Any restrictions imposed by specific compressed internal formats will be 6985bd8deadSopenharmony_ci invariant, meaning that if the GL accepts and stores a texture image in 6995bd8deadSopenharmony_ci compressed form, providing the same image to CompressedTexSubImage1DARB, 7005bd8deadSopenharmony_ci CompressedTexSubImage2DARB, CompressedTexSubImage3DARB will not result in 7015bd8deadSopenharmony_ci an INVALID_OPERATION error if the following restrictions are satisfied: 7025bd8deadSopenharmony_ci 7035bd8deadSopenharmony_ci * <data> points to a compressed texture image returned by 7045bd8deadSopenharmony_ci GetCompressedTexImageARB (Section 6.1.4). 7055bd8deadSopenharmony_ci 7065bd8deadSopenharmony_ci * <target>, <level>, and <format> match the <target>, <level> and 7075bd8deadSopenharmony_ci <format> parameters provided to the GetCompressedTexImageARB call 7085bd8deadSopenharmony_ci returning <data>. 7095bd8deadSopenharmony_ci 7105bd8deadSopenharmony_ci * <width>, <height>, <depth>, <format>, and <imageSize> match the values 7115bd8deadSopenharmony_ci of TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_DEPTH, 7125bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT, and TEXTURE_COMPRESSED_IMAGE_SIZE_ARB for 7135bd8deadSopenharmony_ci image level <level> in effect at the time of the 7145bd8deadSopenharmony_ci GetCompressedTexImageARB call returning <data>. 7155bd8deadSopenharmony_ci 7165bd8deadSopenharmony_ci * <width>, <height>, <depth>, <format> match the values of 7175bd8deadSopenharmony_ci TEXTURE_WIDTH, TEXTURE_HEIGHT, TEXTURE_DEPTH, and 7185bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT currently in effect for image level <level>. 7195bd8deadSopenharmony_ci 7205bd8deadSopenharmony_ci * <xoffset>, <yoffset>, and <zoffset> are all "-<b>", where <b> is the 7215bd8deadSopenharmony_ci value of TEXTURE_BORDER currently in effect for image level <level>. 7225bd8deadSopenharmony_ci 7235bd8deadSopenharmony_ci This guarantee applies not just to images returned by 7245bd8deadSopenharmony_ci GetCompressedTexImageARB, but also to any other properly encoded 7255bd8deadSopenharmony_ci compressed texture image of the same size. 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ci Calling CompressedTexSubImage3D, CompressedTexSubImage2D, or 7285bd8deadSopenharmony_ci CompressedTexSubImage1D will result in an INVALID_OPERATION error if 7295bd8deadSopenharmony_ci <xoffset>, <yoffset>, or <zoffset> is not equal to -b_s (border), or if 7305bd8deadSopenharmony_ci <width>, <height>, and <depth> do not match the values of TEXTURE_WIDTH, 7315bd8deadSopenharmony_ci TEXTURE_HEIGHT, or TEXTURE_DEPTH, respectively. The contents of any texel 7325bd8deadSopenharmony_ci outside the region modified by the call are undefined. These restrictions 7335bd8deadSopenharmony_ci may be relaxed for specific compressed internal formats whose images are 7345bd8deadSopenharmony_ci easily edited. 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 7375bd8deadSopenharmony_ciOperations and the Frame Buffer) 7385bd8deadSopenharmony_ci 7395bd8deadSopenharmony_ci None. 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 7425bd8deadSopenharmony_ci 7435bd8deadSopenharmony_ci Modify Section 5.6, Hints (p.180) 7445bd8deadSopenharmony_ci 7455bd8deadSopenharmony_ci (p.180, modify first paragraph) 7465bd8deadSopenharmony_ci 7475bd8deadSopenharmony_ci ...; FOG_HINT, indicating whether fog calculations are done per pixel or 7485bd8deadSopenharmony_ci per vertex; and TEXTURE_COMPRESSION_HINT_ARB, indicating the desired 7495bd8deadSopenharmony_ci quality and performance of compressing texture images. 7505bd8deadSopenharmony_ci 7515bd8deadSopenharmony_ci For the texture compression hint, a <hint> of FASTEST indicates that 7525bd8deadSopenharmony_ci texture images should be compressed as quickly as possible, while NICEST 7535bd8deadSopenharmony_ci indicates that the texture images be compressed with as little image 7545bd8deadSopenharmony_ci degradation as possible. FASTEST should be used for one-time texture 7555bd8deadSopenharmony_ci compression, and NICEST should be used if the compression results are to 7565bd8deadSopenharmony_ci be retrieved by GetCompressedTexImageARB (Section 6.1.4) for reuse. 7575bd8deadSopenharmony_ci 7585bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 7595bd8deadSopenharmony_ciState Requests) 7605bd8deadSopenharmony_ci 7615bd8deadSopenharmony_ci Modify Section 6.1.3, Enumerated Queries (p.183) 7625bd8deadSopenharmony_ci 7635bd8deadSopenharmony_ci (p.183, modify next-to-last paragraph) 7645bd8deadSopenharmony_ci 7655bd8deadSopenharmony_ci For texture images with uncompressed internal formats, queries of 7665bd8deadSopenharmony_ci TEXTURE_RED_SIZE, TEXTURE_GREEN_SIZE, TEXTURE_BLUE_SIZE, 7675bd8deadSopenharmony_ci TEXTURE_ALPHA_SIZE, TEXTURE_LUMINANCE_SIZE, and TEXTURE_INTENSITY_SIZE 7685bd8deadSopenharmony_ci return the actual resolutions of the stored image array components, not 7695bd8deadSopenharmony_ci the resolutions specified when the image array was defined. For texture 7705bd8deadSopenharmony_ci images with a compressed internal format, the resolutions returned specify 7715bd8deadSopenharmony_ci the component resolution of an uncompressed internal format that produces 7725bd8deadSopenharmony_ci an image of roughly the same quality as the compressed image in question. 7735bd8deadSopenharmony_ci Since the quality of the implementation's compression algorithm is likely 7745bd8deadSopenharmony_ci data-dependent, the returned component sizes should be treated only as 7755bd8deadSopenharmony_ci rough approximations. ... 7765bd8deadSopenharmony_ci 7775bd8deadSopenharmony_ci (p.183, add to end of next-to-last paragraph) 7785bd8deadSopenharmony_ci 7795bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB returns the size (in ubytes) of the 7805bd8deadSopenharmony_ci compressed texture image that would be returned by 7815bd8deadSopenharmony_ci GetCompressedTexImageARB (Section 6.1.4). Querying 7825bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB is not allowed on texture images with an 7835bd8deadSopenharmony_ci uncompressed internal format or on proxy targets and will result in an 7845bd8deadSopenharmony_ci INVALID_OPERATION error if attempted. 7855bd8deadSopenharmony_ci 7865bd8deadSopenharmony_ci Modify Section 6.1.4, Texture Queries (p.184) 7875bd8deadSopenharmony_ci 7885bd8deadSopenharmony_ci (add immediately after the GetTexImage section and before the IsTexture 7895bd8deadSopenharmony_ci section) 7905bd8deadSopenharmony_ci 7915bd8deadSopenharmony_ci The command 7925bd8deadSopenharmony_ci 7935bd8deadSopenharmony_ci void GetCompressedTexImageARB(enum target, int lod, 7945bd8deadSopenharmony_ci void *img); 7955bd8deadSopenharmony_ci 7965bd8deadSopenharmony_ci is used to obtain texture images stored in compressed form. The 7975bd8deadSopenharmony_ci parameters <target>, <lod>, and <img> are interpreted in the same manner 7985bd8deadSopenharmony_ci as in GetTexImage. When called, GetCompressedTexImageARB writes 7995bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB ubytes of compressed image data to the 8005bd8deadSopenharmony_ci memory pointed to by <img>. The compressed image data is formatted 8015bd8deadSopenharmony_ci according to the specification defining INTERNAL_FORMAT. All pixel 8025bd8deadSopenharmony_ci storage and pixel transfer modes are ignored when returning a compressed 8035bd8deadSopenharmony_ci texture image. 8045bd8deadSopenharmony_ci 8055bd8deadSopenharmony_ci Calling GetCompressedTexImageARB with an <lod> value less than zero or 8065bd8deadSopenharmony_ci greater than the maximum allowable causes an INVALID_VALUE error. Calling 8075bd8deadSopenharmony_ci GetCompressedTexImageARB with a texture image stored with an uncompressed 8085bd8deadSopenharmony_ci internal format causes an INVALID_OPERATION error. 8095bd8deadSopenharmony_ci 8105bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.2.1 Specification (Invariance) 8115bd8deadSopenharmony_ci 8125bd8deadSopenharmony_ci None. 8135bd8deadSopenharmony_ci 8145bd8deadSopenharmony_ci 8155bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 8165bd8deadSopenharmony_ci 8175bd8deadSopenharmony_ci None. 8185bd8deadSopenharmony_ci 8195bd8deadSopenharmony_ciGLX Protocol 8205bd8deadSopenharmony_ci 8215bd8deadSopenharmony_ci (Add after GetTexImage to Section 2.2.2 of the GLX 1.3 encoding spec, 8225bd8deadSopenharmony_ci p.74) 8235bd8deadSopenharmony_ci 8245bd8deadSopenharmony_ci GetCompressedTexImageARB 8255bd8deadSopenharmony_ci 8265bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 8275bd8deadSopenharmony_ci 1 160 GLX opcode 8285bd8deadSopenharmony_ci 2 4 request length 8295bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 8305bd8deadSopenharmony_ci 4 ENUM target 8315bd8deadSopenharmony_ci 4 INT32 level 8325bd8deadSopenharmony_ci 8335bd8deadSopenharmony_ci --> 8345bd8deadSopenharmony_ci 8355bd8deadSopenharmony_ci 1 1 Reply 8365bd8deadSopenharmony_ci 1 1 unused 8375bd8deadSopenharmony_ci 2 CARD16 sequence number 8385bd8deadSopenharmony_ci 4 n reply length 8395bd8deadSopenharmony_ci 8 unused 8405bd8deadSopenharmony_ci 4 INT32 compressed image size (in bytes) -- 8415bd8deadSopenharmony_ci should be between 4n-3 and 4n 8425bd8deadSopenharmony_ci 12 unused 8435bd8deadSopenharmony_ci 4*n LISTofBYTE teximage 8445bd8deadSopenharmony_ci 8455bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occurred. 8465bd8deadSopenharmony_ci 8475bd8deadSopenharmony_ci Since pixel storage modes do not apply to compressed texture images, 8485bd8deadSopenharmony_ci teximage is simply an array of bytes. The client library will ignore 8495bd8deadSopenharmony_ci pixel storage modes and should copy only <compressed image size> bytes, 8505bd8deadSopenharmony_ci regardless of the value of <reply length>. 8515bd8deadSopenharmony_ci 8525bd8deadSopenharmony_ci (Add to end of Section 2.3 of the GLX 1.3 encoding spec, p.147) 8535bd8deadSopenharmony_ci 8545bd8deadSopenharmony_ci CompressedTexImage1DARB 8555bd8deadSopenharmony_ci 8565bd8deadSopenharmony_ci 2 32+n+p rendering command length 8575bd8deadSopenharmony_ci 2 214 rendering command opcode 8585bd8deadSopenharmony_ci 4 ENUM target 8595bd8deadSopenharmony_ci 4 INT32 level 8605bd8deadSopenharmony_ci 4 ENUM internalformat 8615bd8deadSopenharmony_ci 4 INT32 width 8625bd8deadSopenharmony_ci 4 unused 8635bd8deadSopenharmony_ci 4 INT32 border 8645bd8deadSopenharmony_ci n LISTofBYTE image 8655bd8deadSopenharmony_ci 4 INT32 imageSize 8665bd8deadSopenharmony_ci p unused, p=pad(n) 8675bd8deadSopenharmony_ci 8685bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 8695bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 8705bd8deadSopenharmony_ci 8715bd8deadSopenharmony_ci 4 36+n+p rendering command length 8725bd8deadSopenharmony_ci 4 214 rendering command opcode 8735bd8deadSopenharmony_ci 8745bd8deadSopenharmony_ci CompressedTexImage2DARB 8755bd8deadSopenharmony_ci 8765bd8deadSopenharmony_ci 2 32+n+p rendering command length 8775bd8deadSopenharmony_ci 2 215 rendering command opcode 8785bd8deadSopenharmony_ci 4 ENUM target 8795bd8deadSopenharmony_ci 4 INT32 level 8805bd8deadSopenharmony_ci 4 ENUM internalformat 8815bd8deadSopenharmony_ci 4 INT32 width 8825bd8deadSopenharmony_ci 4 INT32 height 8835bd8deadSopenharmony_ci 4 INT32 border 8845bd8deadSopenharmony_ci 4 INT32 imageSize 8855bd8deadSopenharmony_ci n LISTofBYTE image 8865bd8deadSopenharmony_ci p unused, p=pad(n) 8875bd8deadSopenharmony_ci 8885bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 8895bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 8905bd8deadSopenharmony_ci 8915bd8deadSopenharmony_ci 4 36+n+p rendering command length 8925bd8deadSopenharmony_ci 4 215 rendering command opcode 8935bd8deadSopenharmony_ci 8945bd8deadSopenharmony_ci CompressedTexImage3DARB 8955bd8deadSopenharmony_ci 8965bd8deadSopenharmony_ci 2 36+n+p rendering command length 8975bd8deadSopenharmony_ci 2 216 rendering command opcode 8985bd8deadSopenharmony_ci 4 ENUM target 8995bd8deadSopenharmony_ci 4 INT32 level 9005bd8deadSopenharmony_ci 4 INT32 internalformat 9015bd8deadSopenharmony_ci 4 INT32 width 9025bd8deadSopenharmony_ci 4 INT32 height 9035bd8deadSopenharmony_ci 4 INT32 depth 9045bd8deadSopenharmony_ci 4 INT32 border 9055bd8deadSopenharmony_ci 4 INT32 imageSize 9065bd8deadSopenharmony_ci n LISTofBYTE image 9075bd8deadSopenharmony_ci p unused, p=pad(n) 9085bd8deadSopenharmony_ci 9095bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 9105bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 9115bd8deadSopenharmony_ci 9125bd8deadSopenharmony_ci 4 36+n+p rendering command length 9135bd8deadSopenharmony_ci 4 216 rendering command opcode 9145bd8deadSopenharmony_ci 9155bd8deadSopenharmony_ci CompressedTexSubImage1DARB 9165bd8deadSopenharmony_ci 9175bd8deadSopenharmony_ci 2 36+n+p rendering command length 9185bd8deadSopenharmony_ci 2 217 rendering command opcode 9195bd8deadSopenharmony_ci 4 ENUM target 9205bd8deadSopenharmony_ci 4 INT32 level 9215bd8deadSopenharmony_ci 4 INT32 xoffset 9225bd8deadSopenharmony_ci 4 unused 9235bd8deadSopenharmony_ci 4 INT32 width 9245bd8deadSopenharmony_ci 4 unused 9255bd8deadSopenharmony_ci 4 ENUM format 9265bd8deadSopenharmony_ci 4 INT32 imageSize 9275bd8deadSopenharmony_ci n LISTofBYTE image 9285bd8deadSopenharmony_ci p unused, p=pad(n) 9295bd8deadSopenharmony_ci 9305bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 9315bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 9325bd8deadSopenharmony_ci 9335bd8deadSopenharmony_ci 4 40+n+p rendering command length 9345bd8deadSopenharmony_ci 4 217 rendering command opcode 9355bd8deadSopenharmony_ci 9365bd8deadSopenharmony_ci CompressedTexSubImage2DARB 9375bd8deadSopenharmony_ci 9385bd8deadSopenharmony_ci 2 36+n+p rendering command length 9395bd8deadSopenharmony_ci 2 218 rendering command opcode 9405bd8deadSopenharmony_ci 4 ENUM target 9415bd8deadSopenharmony_ci 4 INT32 level 9425bd8deadSopenharmony_ci 4 INT32 xoffset 9435bd8deadSopenharmony_ci 4 INT32 yoffset 9445bd8deadSopenharmony_ci 4 INT32 width 9455bd8deadSopenharmony_ci 4 INT32 height 9465bd8deadSopenharmony_ci 4 ENUM format 9475bd8deadSopenharmony_ci 4 INT32 imageSize 9485bd8deadSopenharmony_ci n LISTofBYTE image 9495bd8deadSopenharmony_ci p unused, p=pad(n) 9505bd8deadSopenharmony_ci 9515bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 9525bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 9535bd8deadSopenharmony_ci 9545bd8deadSopenharmony_ci 4 40+n+p rendering command length 9555bd8deadSopenharmony_ci 4 218 rendering command opcode 9565bd8deadSopenharmony_ci 9575bd8deadSopenharmony_ci CompressedTexSubImage3DARB 9585bd8deadSopenharmony_ci 9595bd8deadSopenharmony_ci 2 44+n+p rendering command length 9605bd8deadSopenharmony_ci 2 219 rendering command opcode 9615bd8deadSopenharmony_ci 4 ENUM target 9625bd8deadSopenharmony_ci 4 INT32 level 9635bd8deadSopenharmony_ci 4 INT32 xoffset 9645bd8deadSopenharmony_ci 4 INT32 yoffset 9655bd8deadSopenharmony_ci 4 INT32 zoffset 9665bd8deadSopenharmony_ci 4 INT32 width 9675bd8deadSopenharmony_ci 4 INT32 height 9685bd8deadSopenharmony_ci 4 INT32 depth 9695bd8deadSopenharmony_ci 4 ENUM format 9705bd8deadSopenharmony_ci 4 INT32 imageSize 9715bd8deadSopenharmony_ci n LISTofBYTE image 9725bd8deadSopenharmony_ci p unused, p=pad(n) 9735bd8deadSopenharmony_ci 9745bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the command 9755bd8deadSopenharmony_ci opcode and command length fields are expanded to 4 bytes each. 9765bd8deadSopenharmony_ci 9775bd8deadSopenharmony_ci 4 48+n+p rendering command length 9785bd8deadSopenharmony_ci 4 219 rendering command opcode 9795bd8deadSopenharmony_ci 9805bd8deadSopenharmony_ci 9815bd8deadSopenharmony_ciErrors 9825bd8deadSopenharmony_ci 9835bd8deadSopenharmony_ci Errors for compressed TexImage and TexSubImage calls specific to 9845bd8deadSopenharmony_ci compression: 9855bd8deadSopenharmony_ci 9865bd8deadSopenharmony_ci INVALID_OPERATION is generated by TexSubImage1D, TexSubImage2D, 9875bd8deadSopenharmony_ci TexSubImage3D, CopyTexSubImage1D, CopyTexSubImage2D, or CopyTexSubImage3D 9885bd8deadSopenharmony_ci if the internal format of the texture image is compressed and <xoffset>, 9895bd8deadSopenharmony_ci <yoffset>, or <zoffset> does not equal -b, where b is value of 9905bd8deadSopenharmony_ci TEXTURE_BORDER. 9915bd8deadSopenharmony_ci 9925bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexSubImage1DARB, 9935bd8deadSopenharmony_ci CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB if the entire 9945bd8deadSopenharmony_ci texture image is not being edited: if <xoffset>, <yoffset>, or <zoffset> 9955bd8deadSopenharmony_ci is greater than -b, <xoffset> + <width> is less than w+b, <yoffset> + 9965bd8deadSopenharmony_ci <height> is less than h+b, or <zoffset> + <depth> is less than d+b, where 9975bd8deadSopenharmony_ci b is the value of TEXTURE_BORDER, w is the value of TEXTURE_WIDTH, h is 9985bd8deadSopenharmony_ci the value of TEXTURE_HEIGHT, and d is the value of TEXTURE_DEPTH. 9995bd8deadSopenharmony_ci 10005bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage1DARB, 10015bd8deadSopenharmony_ci CompressedTexImage2DARB, or CompressedTexImage3DARB, 10025bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage2DARB, or 10035bd8deadSopenharmony_ci CompressedTexSubImage3DARB, if <internalformat> is any of the six generic 10045bd8deadSopenharmony_ci compressed internal formats (e.g., COMPRESSED_RGBA_ARB) 10055bd8deadSopenharmony_ci 10065bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexImage1DARB, 10075bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB, 10085bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage2DARB, or 10095bd8deadSopenharmony_ci CompressedTexSubImage3DARB, if any parameter combinations are not 10105bd8deadSopenharmony_ci supported by the specific compressed internal format. Such invalid 10115bd8deadSopenharmony_ci combinations are documented in the specification defining the internal 10125bd8deadSopenharmony_ci format. 10135bd8deadSopenharmony_ci 10145bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10155bd8deadSopenharmony_ci CompressedTexImage2DARB, or CompressedTexImage3DARB, 10165bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage2DARB, or 10175bd8deadSopenharmony_ci CompressedTexSubImage3DARB, if <imageSize> is not consistent with the 10185bd8deadSopenharmony_ci format, dimensions, and contents of the specified image. The appropriate 10195bd8deadSopenharmony_ci value for the <imageSize> parameter is documented in the specification 10205bd8deadSopenharmony_ci defining the compressed internal format. 10215bd8deadSopenharmony_ci 10225bd8deadSopenharmony_ci Undefined results (including abnormal program termination) are generated 10235bd8deadSopenharmony_ci by CompressedTexImage1DARB, CompressedTexImage2DARB, or 10245bd8deadSopenharmony_ci CompressedTexImage3DARB, CompressedTexSubImage1DARB, 10255bd8deadSopenharmony_ci CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB, is not encoded 10265bd8deadSopenharmony_ci in a manner consistent with the specification defining the internal 10275bd8deadSopenharmony_ci format. 10285bd8deadSopenharmony_ci 10295bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage1DARB, 10305bd8deadSopenharmony_ci CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB if <format> does 10315bd8deadSopenharmony_ci not match the internal format of the texture image being modified. 10325bd8deadSopenharmony_ci 10335bd8deadSopenharmony_ci INVALID_OPERATION is generated by GetTexLevelParameter[if]v if <target> is 10345bd8deadSopenharmony_ci PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, or PROXY_TEXTURE_3D and <value> is 10355bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB. 10365bd8deadSopenharmony_ci 10375bd8deadSopenharmony_ci INVALID_OPERATION is generated by GetTexLevelParameter[if]v if the 10385bd8deadSopenharmony_ci internal format of the queried texture image is not compressed and <value> 10395bd8deadSopenharmony_ci is TEXTURE_COMPRESSED_IMAGE_SIZE_ARB. 10405bd8deadSopenharmony_ci 10415bd8deadSopenharmony_ci INVALID_OPERATION is generated by GetCompressedTexImageARB if the internal 10425bd8deadSopenharmony_ci format of the queried texture image is not compressed. 10435bd8deadSopenharmony_ci 10445bd8deadSopenharmony_ci 10455bd8deadSopenharmony_ci Errors for compressed TexImage and TexSubImage calls not specific to 10465bd8deadSopenharmony_ci compression: 10475bd8deadSopenharmony_ci 10485bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage3DARB or 10495bd8deadSopenharmony_ci CompressedTexSubImage3DARB if <target> is not TEXTURE_3D. 10505bd8deadSopenharmony_ci 10515bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage2DARB or 10525bd8deadSopenharmony_ci CompressedTexSubImage2DARB if <target> is not TEXTURE_2D, 10535bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_X_ARB, TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 10545bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 10555bd8deadSopenharmony_ci TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, or TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB. 10565bd8deadSopenharmony_ci 10575bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage1DARB or 10585bd8deadSopenharmony_ci CompressedTexSubImage1DARB if <target> is not TEXTURE_1D. 10595bd8deadSopenharmony_ci 10605bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10615bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB, 10625bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage1DARB, or 10635bd8deadSopenharmony_ci CompressedTexSubImage3DARB if <level> is negative. 10645bd8deadSopenharmony_ci 10655bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10665bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB, 10675bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage2DARB, or 10685bd8deadSopenharmony_ci CompressedTexSubImage3DARB, if <width>, <height>, or <depth> is negative. 10695bd8deadSopenharmony_ci 10705bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10715bd8deadSopenharmony_ci CompressedTexImage2DARB, or CompressedTexImage3DARB if <width>, <height>, 10725bd8deadSopenharmony_ci or <depth> can not be represented as 2^k+2 for some integer value k. 10735bd8deadSopenharmony_ci 10745bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10755bd8deadSopenharmony_ci CompressedTexImage2DARB, or CompressedTexImage3DARB if <border> is not 10765bd8deadSopenharmony_ci zero or one. 10775bd8deadSopenharmony_ci 10785bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexImage1DARB, 10795bd8deadSopenharmony_ci CompressedTexImage2DARB, CompressedTexImage3DARB, 10805bd8deadSopenharmony_ci CompressedTexSubImage1DARB, CompressedTexSubImage1DARB, or 10815bd8deadSopenharmony_ci CompressedTexSubImage3DARB if the call is made between a call to Begin and 10825bd8deadSopenharmony_ci the corresponding call to End. 10835bd8deadSopenharmony_ci 10845bd8deadSopenharmony_ci INVALID_VALUE is generated by CompressedTexSubImage1DARB, 10855bd8deadSopenharmony_ci CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB if <xoffset>, 10865bd8deadSopenharmony_ci <yoffset>, or <zoffset> is less than -b, <xoffset> + <width> is greater 10875bd8deadSopenharmony_ci than w+b, <yoffset> + <height> is greater than h+b, or <zoffset> + <depth> 10885bd8deadSopenharmony_ci is greater than d+b, where b is the value of TEXTURE_BORDER, w is the 10895bd8deadSopenharmony_ci value of TEXTURE_WIDTH, h is the value of TEXTURE_HEIGHT, and d is the 10905bd8deadSopenharmony_ci value of TEXTURE_DEPTH. 10915bd8deadSopenharmony_ci 10925bd8deadSopenharmony_ci INVALID_VALUE is generated by GetCompressedTexImageARB if <lod> is 10935bd8deadSopenharmony_ci negative or greater than the maximum allowable level. 10945bd8deadSopenharmony_ci 10955bd8deadSopenharmony_ciNew State 10965bd8deadSopenharmony_ci 10975bd8deadSopenharmony_ci (table 6.12, p.202) 10985bd8deadSopenharmony_ci Initial 10995bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 11005bd8deadSopenharmony_ci --------- ---- ----------- ------- ----------- ---- --------- 11015bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB n x Z+ GetTexLevel- 0 size (in 3.8 - 11025bd8deadSopenharmony_ci Parameter ubytes) 11035bd8deadSopenharmony_ci of xD compressed 11045bd8deadSopenharmony_ci texture image i. 11055bd8deadSopenharmony_ci TEXTURE_COMPRESSED_ARB n x B GetTexLevel- FALSE True if xD 3.8 - 11065bd8deadSopenharmony_ci Parameter image i has 11075bd8deadSopenharmony_ci a compressed 11085bd8deadSopenharmony_ci internal format 11095bd8deadSopenharmony_ci 11105bd8deadSopenharmony_ci (table 6.23, p.213) 11115bd8deadSopenharmony_ci Initial 11125bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 11135bd8deadSopenharmony_ci --------- ---- ----------- ------- ----------- ---- --------- 11145bd8deadSopenharmony_ci TEXTURE_COMPRESSION_HINT_ARB Z_3 GetIntegerv DONT_ Texture 5.6 hint 11155bd8deadSopenharmony_ci CARE compression 11165bd8deadSopenharmony_ci quality hint 11175bd8deadSopenharmony_ci 11185bd8deadSopenharmony_ci (table 6.25, p. 215) 11195bd8deadSopenharmony_ci Minimum 11205bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 11215bd8deadSopenharmony_ci --------- ---- ----------- ------- ----------- ---- --------- 11225bd8deadSopenharmony_ci NUM_COMPRESSED_TEXTURE_FORMATS_ARB Z GetIntegerv 0 Number of 3.8 - 11235bd8deadSopenharmony_ci enumerated 11245bd8deadSopenharmony_ci compressed 11255bd8deadSopenharmony_ci texture 11265bd8deadSopenharmony_ci formats 11275bd8deadSopenharmony_ci 11285bd8deadSopenharmony_ci COMPRESSED_TEXTURE_FORMATS_ARB 0* x Z GetIntegerv - Enumerated 3.8 - 11295bd8deadSopenharmony_ci compressed 11305bd8deadSopenharmony_ci texture 11315bd8deadSopenharmony_ci formats 11325bd8deadSopenharmony_ci 11335bd8deadSopenharmony_ciRevision History 11345bd8deadSopenharmony_ci 11355bd8deadSopenharmony_ci 1.03, 05/23/00 prbrown1: Removed stray "None." paragraph in modifications 11365bd8deadSopenharmony_ci to Chapter 5. 11375bd8deadSopenharmony_ci 11385bd8deadSopenharmony_ci 1.02, 05/08/00 prbrown1: Fixed prototype of GetCompressedTexImageARB (no 11395bd8deadSopenharmony_ci "const" qualifiers) in "New Procedures and 11405bd8deadSopenharmony_ci Functions" section. Changed <internalformat> 11415bd8deadSopenharmony_ci parameter of CompressedTexImage functions to be 11425bd8deadSopenharmony_ci an "enum" instead of an "int". "int" was carried 11435bd8deadSopenharmony_ci over only on TexImage calls as a 1.0 legacy -- 11445bd8deadSopenharmony_ci the newer CopyTexImage call takes an "enum". 11455bd8deadSopenharmony_ci 11465bd8deadSopenharmony_ci 1.01, 04/11/00 prbrown1: Minor bug fixes to the first published version. 11475bd8deadSopenharmony_ci Fixed prototypes to match extension spec 11485bd8deadSopenharmony_ci standards (no "GL" type prefixes). Fixed a 11495bd8deadSopenharmony_ci couple erroneous function names. Added "const" 11505bd8deadSopenharmony_ci qualifier to prototypes involving image data not 11515bd8deadSopenharmony_ci modified by the GL. Added text to indicate that 11525bd8deadSopenharmony_ci compressed formats apply to texture maps 11535bd8deadSopenharmony_ci supported by GL_ARB_texture_cube_map. 11545bd8deadSopenharmony_ci 11555bd8deadSopenharmony_ci 1.0, 03/24/00 prbrown1: Applied changes approved as part of the extension 11565bd8deadSopenharmony_ci at the March 2000 ARB meeting, as follows: 11575bd8deadSopenharmony_ci 11585bd8deadSopenharmony_ci * CompressedTexSubImage: Only allowed if the 11595bd8deadSopenharmony_ci entire image is replaced. Document that this 11605bd8deadSopenharmony_ci restriction can be relaxed for specific 11615bd8deadSopenharmony_ci compression extensions. 11625bd8deadSopenharmony_ci * Renamed TEXTURE_IMAGE_SIZE_ARB to 11635bd8deadSopenharmony_ci TEXTURE_COMPRESSED_IMAGE_SIZE_ARB. 11645bd8deadSopenharmony_ci * Querying image size on uncompressed images is 11655bd8deadSopenharmony_ci now an INVALID_OPERATION error. 11665bd8deadSopenharmony_ci * INVALID_VALUE error is generated if <imageSize> 11675bd8deadSopenharmony_ci is inconsistent with the image data. This 11685bd8deadSopenharmony_ci restriction may be overridden by specific 11695bd8deadSopenharmony_ci extensions only if requiring an image size 11705bd8deadSopenharmony_ci check is unreasonable. 11715bd8deadSopenharmony_ci * Added documentaion of undefined behavior for 11725bd8deadSopenharmony_ci CompressedTexImage/SubImage if the image data 11735bd8deadSopenharmony_ci is encoded in a manner inconsistent with the 11745bd8deadSopenharmony_ci spec defining the compressed image format. 11755bd8deadSopenharmony_ci * Fixed issue (16). Text was truncated. 11765bd8deadSopenharmony_ci * Modified invariance section. <data> can not 11775bd8deadSopenharmony_ci affect the choice of compressed internal 11785bd8deadSopenharmony_ci format, but can theoretically affect regular 11795bd8deadSopenharmony_ci component resolution. 11805bd8deadSopenharmony_ci * Add new function GetCompressedTexImage to deal 11815bd8deadSopenharmony_ci with subtle GLX issues. 11825bd8deadSopenharmony_ci * GLX protocol for CompressedTexImage/SubImage 11835bd8deadSopenharmony_ci and GetCompressedTexImage holds both a padded 11845bd8deadSopenharmony_ci image size (for GLX data transfer) and actual 11855bd8deadSopenharmony_ci image size (for packing in user buffers). 11865bd8deadSopenharmony_ci 11875bd8deadSopenharmony_ci Minor wording clean-ups. 11885bd8deadSopenharmony_ci 11895bd8deadSopenharmony_ci Added enum and GLX opcode values allocated from 11905bd8deadSopenharmony_ci OpenGL Extensions and GLX registries. 11915bd8deadSopenharmony_ci 11925bd8deadSopenharmony_ci 0.81, 03/07/00 prbrown1: Fixed error documentation for TexSubImage calls 11935bd8deadSopenharmony_ci of arbitrary alignment (did not document that the 11945bd8deadSopenharmony_ci internal format had to be compressed). Removed 11955bd8deadSopenharmony_ci references to CopyTexImage3D, which doesn't 11965bd8deadSopenharmony_ci actually exist. 11975bd8deadSopenharmony_ci 11985bd8deadSopenharmony_ci Per Kurt Akeley suggestions: (1) Renamed 11995bd8deadSopenharmony_ci TexImageCompressed to CompressedTexImage to 12005bd8deadSopenharmony_ci conform with naming conventions, (2) clarified 12015bd8deadSopenharmony_ci that the main feature distinguishing 12025bd8deadSopenharmony_ci CompressedTex[Sub]Image calls from normal 12035bd8deadSopenharmony_ci Tex[Sub]Image calls is compressed input data, (3) 12045bd8deadSopenharmony_ci added query to explicitly determine whether the 12055bd8deadSopenharmony_ci internal format of a texture is compressed. 12065bd8deadSopenharmony_ci 12075bd8deadSopenharmony_ci 0.8, 02/23/00 prbrown1: Marked previously unresolved issues as resolved 12085bd8deadSopenharmony_ci per the ARB working group. Added docs for errors 12095bd8deadSopenharmony_ci not specific to compression for the new 12105bd8deadSopenharmony_ci CompressedTexImage and CompressedTexSubImage 12115bd8deadSopenharmony_ci calls. Added queries to enumerate specific 12125bd8deadSopenharmony_ci compressed texture formats. 12135bd8deadSopenharmony_ci 0.76, 02/16/00 prbrown1: Removed "gl" and "GL_" prefixes. 12145bd8deadSopenharmony_ci 0.75, 02/07/00 prbrown1: Incorporated feedback from 12/99 ARB meeting 12155bd8deadSopenharmony_ci and a number of other revisions. 12165bd8deadSopenharmony_ci 0.7, 12/03/99 prbrown1: Incorporated comments from public review of 0.2 12175bd8deadSopenharmony_ci document. 12185bd8deadSopenharmony_ci 0.2, 10/28/99 prbrown1: Renamed to ARB_texture_compression. Significant 12195bd8deadSopenharmony_ci functional changes. 12205bd8deadSopenharmony_ci 0.11, 10/21/99 prbrown1: Edits suggested by 3dfx. 12215bd8deadSopenharmony_ci 0.1, 10/19/99 prbrown1: Initial revision. 12225bd8deadSopenharmony_ci 1223