• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    EXT_texture_integer
4
5Name Strings
6
7    GL_EXT_texture_integer
8
9Contact
10
11    Michael Gold, NVIDIA Corporation (gold 'at' nvidia.com)
12    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
13
14Status
15
16    Shipping for GeForce 8 Series (November 2006)
17
18Version
19
20    Last Modified Date:         05/20/2010
21    NVIDIA Revision:            6
22
23Number
24
25    343
26
27Dependencies
28
29    OpenGL 2.0 is required.
30
31    NV_gpu_program4 or EXT_gpu_shader4 is required.
32
33    ARB_texture_float affects the definition of this extension.
34
35    ARB_color_buffer_float affects the definition of this extension.
36
37    EXT_framebuffer_object affects the definition of this extension.
38
39    This extension is written against the OpenGL 2.0 specification.
40
41Overview
42
43    Fixed-point textures in unextended OpenGL have integer components,
44    but those values are taken to represent floating-point values in
45    the range [0,1].  These integer components are considered
46    "normalized" integers.  When such a texture is accessed by a
47    shader or by fixed-function fragment processing, floating-point
48    values are returned.
49
50    This extension provides a set of new "unnormalized" integer texture
51    formats.  Formats with both signed and unsigned integers are provided.  In
52    these formats, the components are treated as true integers.  When such
53    textures are accessed by a shader, actual integer values are returned.
54
55    Pixel operations that read from or write to a texture or color
56    buffer with unnormalized integer components follow a path similar
57    to that used for color index pixel operations, except that more
58    than one component may be provided at once.  Integer values flow
59    through the pixel processing pipe, and no pixel transfer
60    operations are performed.  Integer format enumerants used for such
61    operations indicate unnormalized integer data.
62
63    Textures or render buffers with unnormalized integer formats may also be
64    attached to framebuffer objects to receive fragment color values written
65    by a fragment shader.  Per-fragment operations that require floating-point
66    color components, including multisample alpha operations, alpha test,
67    blending, and dithering, have no effect when the corresponding colors are
68    written to an integer color buffer.  The NV_gpu_program4 and
69    EXT_gpu_shader4 extensions add the capability to fragment programs and
70    fragment shaders to write signed and unsigned integer output values.
71
72    This extension does not enforce type consistency for texture accesses or
73    between fragment shaders and the corresponding framebuffer attachments.
74    The results of a texture lookup from an integer texture are undefined:
75
76      * for fixed-function fragment processing, or
77
78      * for shader texture accesses expecting floating-point return values.
79
80    The color components used for per-fragment operations and written into a
81    color buffer are undefined:
82
83      * for fixed-function fragment processing with an integer color buffer,
84
85      * for fragment shaders that write floating-point color components to an
86        integer color buffer, or
87
88      * for fragment shaders that write integer color components to a color
89        buffer with floating point or normalized integer components.
90
91
92New Procedures and Functions
93
94    void ClearColorIiEXT ( int r, int g, int b, int a );
95    void ClearColorIuiEXT ( uint r, uint g, uint b, uint a );
96    void TexParameterIivEXT( enum target, enum pname, int *params );
97    void TexParameterIuivEXT( enum target, enum pname, uint *params );
98    void GetTexParameterIivEXT ( enum target, enum pname, int *params);
99    void GetTexParameterIuivEXT ( enum target, enum pname, uint *params);
100
101New Tokens
102
103    Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
104    GetFloatv, and GetDoublev:
105
106        RGBA_INTEGER_MODE_EXT                           0x8D9E
107
108    Accepted by the <internalFormat> parameter of TexImage1D,
109    TexImage2D, and TexImage3D:
110
111        RGBA32UI_EXT                                    0x8D70
112        RGB32UI_EXT                                     0x8D71
113        ALPHA32UI_EXT                                   0x8D72
114        INTENSITY32UI_EXT                               0x8D73
115        LUMINANCE32UI_EXT                               0x8D74
116        LUMINANCE_ALPHA32UI_EXT                         0x8D75
117
118        RGBA16UI_EXT                                    0x8D76
119        RGB16UI_EXT                                     0x8D77
120        ALPHA16UI_EXT                                   0x8D78
121        INTENSITY16UI_EXT                               0x8D79
122        LUMINANCE16UI_EXT                               0x8D7A
123        LUMINANCE_ALPHA16UI_EXT                         0x8D7B
124
125        RGBA8UI_EXT                                     0x8D7C
126        RGB8UI_EXT                                      0x8D7D
127        ALPHA8UI_EXT                                    0x8D7E
128        INTENSITY8UI_EXT                                0x8D7F
129        LUMINANCE8UI_EXT                                0x8D80
130        LUMINANCE_ALPHA8UI_EXT                          0x8D81
131
132        RGBA32I_EXT                                     0x8D82
133        RGB32I_EXT                                      0x8D83
134        ALPHA32I_EXT                                    0x8D84
135        INTENSITY32I_EXT                                0x8D85
136        LUMINANCE32I_EXT                                0x8D86
137        LUMINANCE_ALPHA32I_EXT                          0x8D87
138
139        RGBA16I_EXT                                     0x8D88
140        RGB16I_EXT                                      0x8D89
141        ALPHA16I_EXT                                    0x8D8A
142        INTENSITY16I_EXT                                0x8D8B
143        LUMINANCE16I_EXT                                0x8D8C
144        LUMINANCE_ALPHA16I_EXT                          0x8D8D
145
146        RGBA8I_EXT                                      0x8D8E
147        RGB8I_EXT                                       0x8D8F
148        ALPHA8I_EXT                                     0x8D90
149        INTENSITY8I_EXT                                 0x8D91
150        LUMINANCE8I_EXT                                 0x8D92
151        LUMINANCE_ALPHA8I_EXT                           0x8D93
152
153    Accepted by the <format> parameter of TexImage1D, TexImage2D,
154    TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D,
155    DrawPixels and ReadPixels:
156
157        RED_INTEGER_EXT                                 0x8D94
158        GREEN_INTEGER_EXT                               0x8D95
159        BLUE_INTEGER_EXT                                0x8D96
160        ALPHA_INTEGER_EXT                               0x8D97
161        RGB_INTEGER_EXT                                 0x8D98
162        RGBA_INTEGER_EXT                                0x8D99
163        BGR_INTEGER_EXT                                 0x8D9A
164        BGRA_INTEGER_EXT                                0x8D9B
165        LUMINANCE_INTEGER_EXT                           0x8D9C
166        LUMINANCE_ALPHA_INTEGER_EXT                     0x8D9D
167
168Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
169
170    Modify Section 3.6.4 (Rasterization of Pixel Rectangles), p. 126:
171
172    (modify the last paragraph, p. 126)
173    Pixels are drawn using
174
175        void DrawPixels( sizei width, sizei height, enum format,
176            enum type, void *data );
177
178    <format> is a symbolic constant indicating what the values in
179    memory represent.  <width> and <height> are the width and height,
180    respectively, of the pixel rectangle to be drawn. <data> is a
181    pointer to the data to be drawn. These data are represented with
182    one of seven GL data types, specified by <type>. The
183    correspondence between the twenty type token values and the GL
184    data types they indicate is given in table 3.5. If the GL is in
185    color index mode and <format> is not one of COLOR_INDEX,
186    STENCIL_INDEX, or DEPTH_COMPONENT, then the error
187    INVALID_OPERATION occurs.  If the GL is in RGBA mode and the color
188    buffer is an integer format and no fragment shader is active, the
189    error INVALID_OPERATION occurs.  If <type> is BITMAP and <format>
190    is not COLOR_INDEX or STENCIL_INDEX then the error INVALID_ENUM
191    occurs.  If <format> is one of the integer component formats as
192    defined in table 3.6, and <type> is FLOAT, then the error
193    INVALID_ENUM occurs.  Some additional constraints on the
194    combinations of format and type values that are accepted is
195    discussed below.
196
197    (add the following to table 3.6, p. 129)
198    Format Name                  Element Meaning and Order      Target Buffer
199    ------ ----                  ------- ------- --- -----      ------ ------
200    RED_INTEGER_EXT              iR                             Color
201    GREEN_INTEGER_EXT            iG                             Color
202    BLUE_INTEGER_EXT             iB                             Color
203    ALPHA_INTEGER_EXT            iA                             Color
204    RGB_INTEGER_EXT              iR, iG, iB                     Color
205    RGBA_INTEGER_EXT             iR, iG, iB, iA                 Color
206    BGR_INTEGER_EXT              iB, iG, iR                     Color
207    BGRA_INTEGER_EXT             iB, iG, iR, iA                 Color
208    LUMINANCE_INTEGER_EXT        iLuminance                     Color
209    LUMINANCE_ALPHA_INTEGER_EXT  iLuminance, iA                 Color
210
211    Table 3.6: DrawPixels and ReadPixels formats. The second column
212    gives a description of and the number and order of elements in a
213    group. Unless specified as an index, formats yield components.
214    Components are floating-point unless prefixed with the letter 'i'
215    which indicates they are integer.
216
217    (modify first paragraph, p. 129)
218    Data are taken from host memory as a sequence of signed or
219    unsigned bytes (GL data types byte and ubyte), signed or unsigned
220    short integers (GL data types short and ushort), signed or
221    unsigned integers (GL data types int and uint), or floating point
222    values (GL data type float). These elements are grouped into sets
223    of one, two, three, or four values, depending on the format, to
224    form a group.  Table 3.6 summarizes the format of groups obtained
225    from memory; it also indicates those formats that yield indices
226    and those that yield floating-point or integer components.
227
228    (modify the last paragraph, p. 135)
229
230    Conversion to floating-point
231
232    This step applies only to groups of floating-point components. It
233    is not performed on indices or integer components.
234
235    (modify the third paragraph, p. 136)
236    Final Expansion to RGBA
237
238    This step is performed only for non-depth component groups. Each
239    group is converted to a group of 4 elements as follows: if a group
240    does not contain an A element, then A is added and set to 1 for
241    integer components or 1.0 for floating-point components. If any of
242    R, G, or B is missing from the group, each missing element is
243    added and assigned a value of 0 for integer components or 0.0 for
244    floating-point components.
245
246    (modify the last paragraph, p. 136)
247    Final Conversion
248
249    For a color index, final conversion consists of masking the bits
250    of the index to the left of the binary point by 2^n - 1, where n is
251    the number of bits in an index buffer.  For floating-point RGBA
252    components, each element is clamped to [0, 1]. The resulting
253    values are converted to fixed-point according to the rules given
254    in section 2.14.9 (Final Color Processing).  For integer RGBA
255    components, no conversion is applied.  For a depth component, an
256    element is first clamped to [0, 1] and then converted to
257    fixed-point as if it were a window z value (see section 2.11.1,
258    Controlling the Viewport).  Stencil indices are masked by 2^n - 1,
259    where n is the number of bits in the stencil buffer.
260
261    Modify Section 3.6.5 (Pixel Transfer Operations), p. 137
262
263    (modify last paragraph, p. 137)
264    The GL defines five kinds of pixel groups:
265
266    1. Floating-point RGBA component: Each group comprises four color
267       components in floating point format: red, green, blue, and
268       alpha.
269
270    2. Integer RGBA component: Each group comprises four color
271       components in integer format: red, green, blue, and alpha.
272
273    3. Depth component: Each group comprises a single depth component.
274
275    4. Color index: Each group comprises a single color index.
276
277    5. Stencil index: Each group comprises a single stencil index.
278
279    (modify second paragraph, p. 138)
280    Each operation described in this section is applied sequentially
281    to each pixel group in an image. Many operations are applied only
282    to pixel groups of certain kinds; if an operation is not
283    applicable to a given group, it is skipped.  None of the
284    operations defined in this section affect integer RGBA component
285    pixel groups.
286
287    Modify Section 3.8 (Texturing), p. 149
288
289    (insert between the first and second paragraphs, p. 150)
290    The internal data type of a texture may be fixed-point,
291    floating-point, signed integer or unsigned integer, depending on
292    the internalformat of the texture.  The correspondence between
293    internalformat and the internal data type is given in table 3.16.
294    Fixed-point and floating-point textures return a floating-point
295    value and integer textures return signed or unsigned integer
296    values.  When a fragment shader is active, the shader is
297    responsible for interpreting the result of a texture lookup as the
298    correct data type, otherwise the result is undefined.  Fixed
299    functionality assumes floating-point data, hence the result of
300    using fixed functionality with integer textures is undefined.
301
302    Modify Section 3.8.1 (Texture Image Specification), p. 150
303
304    (modify second paragraph, p. 151) The selected groups are
305    processed exactly as for DrawPixels, stopping just before final
306    conversion.  If the <internalformat> of the texture is integer,
307    the components are clamped to the representable range of the
308    internal format: for signed formats, this is [-2^(n-1), 2^(n-1)-1]
309    where n is the number of bits per component; for unsigned formats,
310    the range is [0, 2^n-1].  For R, G, B, and A, if the
311    <internalformat> of the texture is fixed-point, the components are
312    clamped to [0, 1].  Otherwise, the components are not modified.
313
314    (insert between paragraphs five and six, p. 151)
315    Textures with integer internal formats (table 3.16) require
316    integer data.  The error INVALID_OPERATION is generated if the
317    internal format is integer and <format> is not one of the integer
318    formats listed in table 3.6, or if the internal format is not
319    integer and <format> is an integer format, or if <format> is an
320    integer format and <type> is FLOAT.
321
322    (add the following to table 3.16, p. 154)
323    Sized                   Base              R    G    B    A    L    I
324    Internal Format         Internal Format  bits bits bits bits bits bits
325    ----------------------- ---------------  ---- ---- ---- ---- ---- ----
326    ALPHA8I_EXT             ALPHA                             i8
327    ALPHA8UI_EXT            ALPHA                            ui8
328    ALPHA16I_EXT            ALPHA                            i16
329    ALPHA16UI_EXT           ALPHA                           ui16
330    ALPHA32I_EXT            ALPHA                            i32
331    ALPHA32UI_EXT           ALPHA                           ui32
332    LUMINANCE8I_EXT         LUMINANCE                              i8
333    LUMINANCE8UI_EXT        LUMINANCE                             ui8
334    LUMINANCE16I_EXT        LUMINANCE                             i16
335    LUMINANCE16UI_EXT       LUMINANCE                            ui16
336    LUMINANCE32I_EXT        LUMINANCE                             i32
337    LUMINANCE32UI_EXT       LUMINANCE                            ui32
338    LUMINANCE_ALPHA8I_EXT   LUMINANCE_ALPHA                   i8   i8
339    LUMINANCE_ALPHA8UI_EXT  LUMINANCE_ALPHA                  ui8  ui8
340    LUMINANCE_ALPHA16I_EXT  LUMINANCE_ALPHA                  i16  i16
341    LUMINANCE_ALPHA16UI_EXT LUMINANCE_ALPHA                 ui16 ui16
342    LUMINANCE_ALPHA32I_EXT  LUMINANCE_ALPHA                  i32  i32
343    LUMINANCE_ALPHA32UI_EXT LUMINANCE_ALPHA                 ui32 ui32
344    INTENSITY8I_EXT         INTENSITY                                   i8
345    INTENSITY8UI_EXT        INTENSITY                                  ui8
346    INTENSITY16I_EXT        INTENSITY                                  i16
347    INTENSITY16UI_EXT       INTENSITY                                 ui16
348    INTENSITY32I_EXT        INTENSITY                                  i32
349    INTENSITY32UI_EXT       INTENSITY                                 ui32
350    RGB8I_EXT               RGB                i8   i8   i8
351    RGB8UI_EXT              RGB               ui8  ui8  ui8
352    RGB16I_EXT              RGB               i16  i16  i16
353    RGB16UI_EXT             RGB              ui16 ui16 ui16
354    RGB32I_EXT              RGB               i32  i32  i32
355    RGB32UI_EXT             RGB              ui32 ui32 ui32
356    RGBA8I_EXT              RGBA               i8   i8   i8   i8
357    RGBA8UI_EXT             RGBA              ui8  ui8  ui8  ui8
358    RGBA16I_EXT             RGBA              i16  i16  i16  i16
359    RGBA16UI_EXT            RGBA             ui16 ui16 ui16 ui16
360    RGBA32I_EXT             RGBA              i32  i32  i32  i32
361    RGBA32UI_EXT            RGBA             ui32 ui32 ui32 ui32
362
363    Table 3.16: Correspondence of sized internal formats to base
364    internal formats, internal data type and desired component
365    resolutions for each sized internal format.  The component
366    resolution prefix indicates the internal data type: <f> is
367    floating point, <i> is signed integer, <ui> is unsigned integer,
368    and no prefix is fixed-point.
369
370
371    Modify Section 3.8.2 (Alternate Texture Image Specification
372    Commands), p. 159:
373
374    (modify the second paragraph, p. 159)
375    The error INVALID_OPERATION is generated if depth component data
376    is required and no depth buffer is present, or if integer RGBA
377    data is required and the format of the current color buffer is not
378    integer, or if floating-point or fixed-point RGBA data is required
379    and the format of the current color buffer is integer.
380
381    Modify Section 3.8.4 (Texture Parameters), p. 166:
382
383    Various parameters control how the texture array is treated when
384    specified or changed, and when applied to a fragment. Each
385    parameter is set by calling
386
387        void TexParameter{if}( enum target, enum pname, T param );
388        void TexParameter{if}v( enum target, enum pname, T params );
389        void TexParameterIivEXT( enum target, enum pname, int *params );
390        void TexParameterIuivEXT( enum target, enum pname, uint *params );
391
392    <target> is the target, either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
393    or TEXTURE_CUBE_MAP. <pname> is a symbolic constant indicating the
394    parameter to be set; the possible constants and corresponding
395    parameters are summarized in table 3.19. In the first form of the
396    command, <param> is a value to which to set a single-valued
397    parameter; in the second and third forms of the command, <params>
398    is an array of parameters whose type depends on the parameter
399    being set.
400
401    If the value for TEXTURE_PRIORITY is specified as an integer, the
402    conversion for signed integers from table 2.9 is applied to
403    convert the value to floating-point.  The floating point value of
404    TEXTURE_PRIORITY is clamped to lie in [0, 1].
405
406    If the values for TEXTURE_BORDER_COLOR are specified with
407    TexParameterIivEXT or TexParameterIuivEXT, the values are
408    unmodified and stored with an internal data type of integer.  If
409    specified with TexParameteriv, the conversion for signed integers
410    from table 2.9 is applied to convert these values to
411    floating-point.  Otherwise the values are unmodified and stored as
412    floating-point.
413
414
415
416    (modify table 3.19, p. 167)
417    Name                  Type         Legal Values
418    ----                  ----         ------------
419    TEXTURE_BORDER_COLOR  4 floats or  any 4 values
420                          4 ints or
421                          4 uints
422
423    Table 3.19: Texture parameters and their values.
424
425    Modify Section 3.8.8 (Texture Minification), p. 170
426
427    (modify last paragraph, p. 174)
428
429    ... If the texture contains color components, the values of
430    TEXTURE_BORDER_COLOR are interpreted as an RGBA color to match the
431    texture's internal format in a manner consistent with table 3.15.
432    The internal data type of the border values must be consistent
433    with the type returned by the texture as described in section 3.8,
434    or the result is undefined.  The border values for texture
435    components stored as fixed-point values are clamped to [0, 1]
436    before they are used.  If the texture contains depth components,
437    the first component of TEXTURE_BORDER_COLOR is interpreted as a
438    depth value
439
440    Modify Section 3.8.10 (Texture Completeness), p. 177:
441
442    (add to the requirements for one-, two-, or three-dimensional
443    textures)
444    If the internalformat is integer, TEXTURE_MAG_FILTER must be
445    NEAREST and TEXTURE_MIN_FILTER must be NEAREST or
446    NEAREST_MIPMAP_NEAREST.
447
448    Modify Section 3.11.2 (Shader Execution), p. 194
449
450    (modify Shader Outputs, first paragraph, p. 196)
451    ... These are gl_FragColor, gl_FragData[n], and gl_FragDepth.  If
452    fragment clamping is enabled and the color buffer has a
453    fixed-point or floating-point format, the final fragment color
454    values or the final fragment data values written by a fragment
455    shader are clamped to the range [0, 1].  If fragment clamping is
456    disabled or the color buffer has an integer format, the final
457    fragment color values or the final fragment data values are not
458    modified.  The final fragment depth...
459
460    (insert between the first paragraph and second paragraphs of
461    "Shader Outputs", p. 196)
462    Colors values written by the fragment shader may be floating-
463    point, signed integer or unsigned integer.  If the color buffer
464    has a fixed-point format, the color values are assumed to be
465    floating-point and are converted to fixed-point as described in
466    section 2.14.9; otherwise no type conversion is applied.  If the
467    values written by the fragment shader do not match the format(s)
468    of the corresponding color buffer(s), the result is undefined.
469
470
471Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment
472Operations and the Frame Buffer)
473
474    Modify Chapter 4 Introduction, (p. 198)
475
476    (modify third paragraph, p. 198)
477    Color buffers consist of unsigned integer color indices, R, G, B
478    and optionally A floating-point components represented as
479    fixed-point unsigned integer or floating-point values, or R, G, B
480    and optionally A integer components represented as signed or
481    unsigned integer values.  The number of bitplanes...
482
483    Modify Section 4.1.3 (Multisample Fragment Operations), p. 200
484
485    (modify the second paragraph in this section)
486    ... If SAMPLE_ALPHA_TO_COVERAGE is enabled and the color buffer
487    has a fixed-point or floating-point format, a temporary coverage
488    value is generated ...
489
490    Modify Section 4.1.4 (Alpha Test), p. 201
491
492    (modify the first paragraph in this section)
493    This step applies only in RGBA mode and only if the color buffer
494    has a fixed-point or floating-point format. In color index mode or
495    if the color buffer has an integer format, proceed to the next
496    operation. The alpha test discards ...
497
498    Modify Section 4.1.8 (Blending), p. 205
499
500    (modify the second paragraph, p. 206)
501    ... Blending is dependent on the incoming fragment's alpha value
502    and that of the corresponding currently stored pixel. Blending
503    applies only in RGBA mode and only if the color buffer has a
504    fixed-point or floating-point format; in color index mode or if
505    the color buffer has an integer format, it is bypassed. ...
506
507    Modify Section 4.2.3 (Clearing the Buffers), p. 215
508
509       void ClearColor(float r, float g, float b, float a);
510
511    sets the clear value for fixed-point and floating-point color
512    buffers in RGBA mode.  The specified components are stored as
513    floating-point values.
514
515       void ClearColorIiEXT(int r, int g, int b, int a);
516       void ClearColorIuiEXT(uint r, uint g, uint b, uint a);
517
518    set the clear value for signed integer and unsigned integer color
519    buffers, respectively, in RGBA mode.  The specified components are
520    stored as integer values.
521
522    (add to the end of first partial paragraph, p. 217) ... then a
523    Clear directed at that buffer has no effect.  When fixed-point
524    RGBA color buffers are cleared, the clear color values are assumed
525    to be floating-point and are clamped to [0,1] before being
526    converted to fixed-point according to the rules of section 2.14.9.
527    The result of clearing fixed-point or floating-point color buffers
528    is undefined if the clear color was specified as integer values.
529    The result of when clearing integer color buffers is undefined if
530    the clear color was specified as floating-point values.
531
532    Modify Section 4.3.2 (Reading Pixels), p. 219
533
534    (append to the last paragraph, p. 221)
535    The error INVALID_OPERATION occurs if <format> is an integer
536    format and the color buffer is not an integer format, or if the
537    color buffer is an integer format and <format> is not.  The error
538    INVALID_ENUM occurs if <format> is an integer format and <type> is
539    FLOAT.
540
541    (modify the first paragraph, p. 222)
542    ... For a fixed-point color buffer, each element is taken to be a
543    fixed-point value in [0, 1] with m bits, where m is the number of
544    bits in the corresponding color component of the selected buffer
545    (see section 2.14.9).  For an integer or floating-point color
546    buffer, the elements are unmodified.
547
548    (modify the section labeled "Conversion to L", p. 222)
549    This step applies only to RGBA component groups.  If the format is
550    either LUMINANCE or LUMINANCE_ALPHA, a value L is computed as
551
552        L = R + G + B
553
554    otherwise if the format is either LUMINANCE_INTEGER_EXT or
555    LUMINANCE_ALPHA_INTEGER_EXT, L is computed as
556
557        L = R
558
559    where R, G, and B are the values of the R, G, and B
560    components. The single computed L component replaces the R, G, and
561    B components in the group.
562
563    (modify the section labeled "Final Conversion", p. 222)
564
565    For a floating-point RGBA color, each component is first clamped
566    to [0, 1]. Then the appropriate conversion formula from table 4.7
567    is applied to the component.  For an integer RGBA color, each
568    component is clamped to the representable range of <type>.
569
570
571Additions to Chapter 6 of the OpenGL 2.0 Specification (State and
572State Requests)
573
574    Modify Section 6.1.3 (Enumerated Queries), p. 246
575
576    (insert in the list of query functions, p. 246)
577    void GetTexParameterIivEXT( enum target, enum value, int *data );
578    void GetTexParameterIuivEXT( enum target, enum value, uint *data );
579
580    (modify the second paragraph, p. 247)
581    ... For GetTexParameter, value must be either TEXTURE_RESIDENT, or
582    one of the symbolic values in table 3.19.  Querying <value>
583    TEXTURE_BORDER_COLOR with GetTexParameterIivEXT or
584    GetTexParameterIuivEXT returns the border color values as signed
585    integers or unsigned integers, respectively; otherwise the values
586    are returned as described in section 6.1.2.  If the border color
587    is queried with a type that does not match the original type with
588    which it was specified, the result is undefined.  The <lod>
589    argument ...
590
591    (add to end of third paragraph, p. 247) Queries with a <value> of
592    TEXTURE_RED_TYPE_ARB, TEXTURE_GREEN_TYPE_ARB, TEXTURE_BLUE_TYPE_ARB,
593    TEXTURE_ALPHA_TYPE_ARB, TEXTURE_LUMINANCE_TYPE_ARB,
594    TEXTURE_INTENSITY_TYPE_ARB, or TEXTURE_DEPTH_TYPE_ARB, return the data
595    type used to store the component.  Values of NONE,
596    UNSIGNED_NORMALIZED_ARB, FLOAT, INT, or UNSIGNED_INT, indicate missing,
597    unsigned normalized integer, floating-point, signed unnormalized integer,
598    and unsigned unnormalized integer components, respectively.
599
600
601GLX Protocol
602
603    The following rendering commands are sent to the server as part of
604    a glXRender request:
605
606    ClearColorIiEXT
607
608        2      20              rendering command length
609        2      4292            rendering command opcode
610        4      INT32           r
611        4      INT32           g
612        4      INT32           b
613        4      INT32           a
614
615    ClearColorIuiEXT
616
617        2      20              rendering command length
618        2      4293            rendering command opcode
619        4      CARD32          r
620        4      CARD32          g
621        4      CARD32          b
622        4      CARD32          a
623
624    TexParameterIivEXT
625
626        2      12+(4*n)        rendering command length
627        2      346             rendering command opcode
628        4      ENUM            target
629        4      ENUM            pname
630               0x2802 n=1      GL_TEXTURE_WRAP_S
631               0x2803 n=1      GL_TEXTURE_WRAP_T
632               0x8072 n=1      GL_TEXTURE_WRAP_R
633               0x2801 n=1      GL_TEXTURE_MIN_FILTER
634               0x2800 n=1      GL_TEXTURE_MAG_FILTER
635               0x8066 n=1      GL_TEXTURE_PRIORITY
636               0x813A n=1      GL_TEXTURE_MIN_LOD
637               0x813B n=1      GL_TEXTURE_MAX_LOD
638               0x813C n=1      GL_TEXTURE_BASE_LEVEL
639               0x813D n=1      GL_TEXTURE_MAX_LEVEL
640               0x8501 n=1      GL_TEXTURE_LOD_BIAS
641               0x884B n=1      GL_DEPTH_TEXTURE_MODE
642               0x884C n=1      GL_TEXTURE_COMPARE_MODE
643               0x884D n=1      GL_TEXTURE_COMPARE_FUNC
644               0x8191 n=1      GL_GENERATE_MIPMAP
645               0x1004 n=4      GL_TEXTURE_BORDER_COLOR
646        4*n    LISTofINT32     params
647
648    TexParameterIuivEXT
649
650        2      12+(4*n)        rendering command length
651        2      347             rendering command opcode
652        4      ENUM            target
653        4      ENUM            pname
654               0x2802 n=1      GL_TEXTURE_WRAP_S
655               0x2803 n=1      GL_TEXTURE_WRAP_T
656               0x8072 n=1      GL_TEXTURE_WRAP_R
657               0x2801 n=1      GL_TEXTURE_MIN_FILTER
658               0x2800 n=1      GL_TEXTURE_MAG_FILTER
659               0x8066 n=1      GL_TEXTURE_PRIORITY
660               0x813A n=1      GL_TEXTURE_MIN_LOD
661               0x813B n=1      GL_TEXTURE_MAX_LOD
662               0x813C n=1      GL_TEXTURE_BASE_LEVEL
663               0x813D n=1      GL_TEXTURE_MAX_LEVEL
664               0x8501 n=1      GL_TEXTURE_LOD_BIAS
665               0x884B n=1      GL_DEPTH_TEXTURE_MODE
666               0x884C n=1      GL_TEXTURE_COMPARE_MODE
667               0x884D n=1      GL_TEXTURE_COMPARE_FUNC
668               0x8191 n=1      GL_GENERATE_MIPMAP
669               0x1004 n=4      GL_TEXTURE_BORDER_COLOR
670        4*n    LISTofCARD32    params
671
672    The following new non-rendering commands are added:
673
674    GetTexParameterIivEXT
675
676        1      CARD8           opcode(X assigned)
677        1      203             GLX opcode
678        2      4               request length
679        4      GLX_CONTEXT_TAG context tag
680        4      ENUM            target
681        4      ENUM            pname
682    =>
683        1      1               reply
684        1                      unused
685        2      CARD16          sequence number
686        4      m               reply length, m=(n==1?0:n)
687        4                      unused
688        4      CARD32          n
689
690        if (n=1) this follows:
691
692        4      INT32           params
693        12                     unused
694
695        otherwise this follows:
696
697        16                     unused
698        n*4    LISTofINT32     params
699
700    GetTexParameterIuivEXT
701
702        1      CARD8           opcode(X assigned)
703        1      204             GLX opcode
704        2      4               request length
705        4      GLX_CONTEXT_TAG context tag
706        4      ENUM            target
707        4      ENUM            pname
708    =>
709        1      1               reply
710        1                      unused
711        2      CARD16          sequence number
712        4      m               reply length, m=(n==1?0:n)
713        4                      unused
714        4      CARD32          n
715
716        if (n=1) this follows:
717
718        4      CARD32          params
719        12                     unused
720
721        otherwise this follows:
722
723        16                     unused
724        n*4    LISTofCARD32    params
725
726Dependencies on ARB_texture_float
727
728    The following changes should be made if ARB_texture_float is not
729    supported:
730
731    The references to floating-point data types in section 3.8, p. 150
732    should be deleted.
733
734    The language in section 3.8.1 should indicate that final
735    conversion always clamps when the internalformat is not integer.
736
737    The description of table 3.16 should not mention the <f>
738    floating-point formats.
739
740    Section 3.8.4 should indicate that border color values should be
741    clamped to [0,1] before being stored, if not specified with one of
742    the TexParameterI* functions.
743
744    Section 3.8.8 should not mention clamping border color values to
745    [0,1] for fixed-point textures, since this occurs in 3.8.4 at
746    TexParameter specification.
747
748Dependencies on ARB_color_buffer_float
749
750    The following changes should be made if ARB_color_buffer_float is
751    not supported:
752
753    Section 3.11.2, subsection "Shader Outputs: p. 196 should not
754    mention fragment clamping or color buffers with floating-point
755    formats.
756
757    Chapter 4, p. 198 should not mention components represented as
758    floating-point values.
759
760    Section 4.1.3, p. 200, section 4.1.4 p. 205, section 4.1.8 p. 206,
761    section 4.2.3 p. 215 and section 4.3.2 p. 222 should not mention
762    color buffers with a floating-point format.
763
764    Section 4.2.3 p. 217 should not mention clamping the clear color
765    values to [0,1].
766
767Errors
768
769    INVALID_OPERATION is generated by Begin, DrawPixels, Bitmap,
770    CopyPixels, or a command that performs an explicit Begin if the
771    color buffer has an integer RGBA format and no fragment shader is
772    active.
773
774    INVALID_ENUM is generated by DrawPixels, TexImage* and
775    SubTexImage* if <format> is one of the integer component formats
776    described in table 3.6 and <type> is FLOAT.
777
778    INVALID_OPERATION is generated by TexImage* and SubTexImage* if
779    the texture internalformat is an integer format as described in
780    table 3.16 and <format> is not one of the integer component
781    formats described in table 3.6, or if the internalformat is not an
782    integer format and <format> is an integer format.
783
784    INVALID_OPERATION is generated by CopyTexImage* and
785    CopyTexSubImage* if the texture internalformat is an integer
786    format and the read color buffer is not an integer format, or if
787    the internalformat is not an integer format and the read color
788    buffer is an integer format.
789
790    INVALID_ENUM is generated by ReadPixels if <format> is an integer
791    format and <type> is FLOAT.
792
793    INVALID_OPERATON is generated by ReadPixels if <format> is an
794    integer format and the color buffer is not an integer format, or
795    if <format> is not an integer format and the color buffer is an
796    integer format.
797
798New State
799
800    (modify table 6.33, p. 294)
801
802                                                    Minimum
803    Get Value                  Type   Get Command   Value    Description       Sec.   Attribute
804    ------------------------   ----   -----------   -------  ----------------  ----   ----------
805    RGBA_INTEGER_MODE_EXT        B    GetBooleanv   -        True if RGBA      2.7    -
806                                                             components are
807                                                             integers
808
809Issues
810
811    How should the integer pixel path be triggered: by the destination
812    type, new source types, or new source formats?
813
814        RESOLVED: New source formats, based on the precedence of
815        COLOR_INDEX and STENCIL_INDEX formats which invoke distinct
816        pixel path behavior with identical data types and independent
817        of the destination.
818
819    Should pixel transfer operations be defined for the integer pixel
820    path?
821
822        RESOLVED: No.  Fragment shaders can achieve similar results
823        with more flexibility.  There is no need to aggrandize this
824        legacy mechanism.
825
826    What happens if a shader reads a float texel from an integer
827    texture or vice-versa?
828
829        RESOLVED: The result is undefined.  The shader must have
830        knowledge of the texture internal data type.
831
832    How do integer textures behave in fixed function fragment
833    processing?
834
835        RESOLVED: The fixed function texture pipeline assumes textures
836        return floating-point values, hence the return value from an
837        integer texture will not be in a meaningful format.
838
839    How does TEXTURE_BORDER_COLOR work with integer textures?
840
841        RESOLVED: The internal storage of border values effectively
842        becomes a union, and the returned values are interpreted as
843        the same type as the texture.  New versions of TexParameter
844        allow specification of signed and unsigned integer border
845        values.
846
847    How does logic op behave with RGBA mode rendering into integer
848    color buffer?
849
850        RESOLVED: The color logic op operates when enabled when
851        rendering into integer color buffers.
852
853        Logic op operations make sense for integer color buffers so the
854        COLOR_LOGIC_OP enable is respected when rendering into integer
855        color buffers.
856
857        Blending does not apply to RGBA mode rendering when rendering
858        into integer color buffers (as section 4.1.8 is updated to say).
859        The color logic op (described in section 4.1.10) is not a blending
860        operation (though it does take priority over the blending enable).
861
862Revision History
863
864    Rev.    Date    Author    Changes
865    ----  --------  --------  -----------------------------------------
866      6   05/20/10  srahman   Add GLX protocol.
867
868      5   07/15/07  pbrown    Fix typo in GetTexParameterIuivEXT function
869                              name in "New Procedures and Functions".
870
871      4      --               Pre-release revisions.
872
873