• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    APPLE_texture_packed_float
4
5Name Strings
6
7    GL_APPLE_texture_packed_float
8
9Contributors
10
11    Alexander Rogoyski, Apple Inc
12    Serge Metral, Apple Inc
13
14Contact
15
16    Alexander Rogoyski, Apple Inc (rogoyski 'at' apple.com)
17
18Status
19
20    Complete
21
22Version
23
24    Last Modified Date: February 13, 2014
25    Version:            1.0
26
27Number
28
29    OpenGL ES Extension #195
30
31Dependencies
32
33    Requires OpenGL ES 2.0.
34
35    Written against the OpenGL ES 2.0.25 (Nov. 2010) Specification.
36
37    OES_texture_half_float affects the definition of this specification.
38
39    EXT_texture_storage affects the definition of this specification.
40
41Overview
42
43    This extension adds two new 3-component floating-point texture formats
44    that fit within a single 32-bit word called R11F_G11F_B10F and RGB9_E5
45
46    The first RGB format, R11F_G11F_B10F, stores 5 bits of biased exponent
47    per component in the same manner as 16-bit floating-point formats, but
48    rather than 10 mantissa bits, the red, green, and blue components have
49    6, 6, and 5 bits respectively. Each mantissa is assumed to have an
50    implied leading one except in the denorm exponent case.  There is no
51    sign bit so only non-negative values can be represented.  Positive
52    infinity, positivedenorms, and positive NaN values are representable.
53    The value of the fourth component returned by a texture fetch is always
54    1.0.
55
56    The second RGB format, RGB9_E5, stores a single 5-bit exponent (biased
57    up by 15) and three 9-bit mantissas for each respective component.
58    There is no sign bit so all three components must be non-negative.
59    The fractional mantissas are stored without an implied 1 to the left
60    of the decimal point. Neither infinity nor not-a-number (NaN) are
61    representable in this shared exponent format.
62
63New Procedures and Functions
64
65    None
66
67New Tokens
68
69    Accepted by the <type> parameter of TexImage2D and TexSubImage2D:
70
71        UNSIGNED_INT_10F_11F_11F_REV_APPLE           0x8C3B
72        UNSIGNED_INT_5_9_9_9_REV_APPLE               0x8C3E
73
74
75    Accepted by the <internalformat> parameter of TexStorage2DEXT:
76
77        R11F_G11F_B10F_APPLE                         0x8C3A
78        RGB9_E5_APPLE                                0x8C3D
79
80Changes to Chapter 2 of the OpenGL ES 2.0.25 Specification
81(OpenGL Operation)
82
83    Add two new sections after Section "Floating-Point Computation":
84
85        "Unsigned 11-Bit Floating-Point Numbers"
86
87        An unsigned 11-bit floating-point number has no sign bit, a 5-bit
88        exponent (E), and a 6-bit mantissa (M).  The value of an unsigned
89        11-bit floating-point number (represented as an 11-bit unsigned
90        integer N) is determined by the following:
91
92            0.0,                      if E == 0 and M == 0,
93            2^-14 * (M / 64),         if E == 0 and M != 0,
94            2^(E-15) * (1 + M/64),    if 0 < E < 31,
95            INF,                      if E == 31 and M == 0, or
96            NaN,                      if E == 31 and M != 0,
97
98        where
99
100            E = floor(N / 64), and
101            M = N mod 64.
102
103        Implementations are also allowed to use any of the following
104        alternative encodings:
105
106            0.0,                      if E == 0 and M != 0
107            2^(E-15) * (1 + M/64)     if E == 31 and M == 0
108            2^(E-15) * (1 + M/64)     if E == 31 and M != 0
109
110        When a floating-point value is converted to an unsigned 11-bit
111        floating-point representation, finite values are rounded to the
112        closest representable finite value.  While less accurate,
113        implementations are allowed to always round in the direction of
114        zero.  This means negative values are converted to zero.
115        Likewise, finite positive values greater than 65024 (the maximum
116        finite representable unsigned 11-bit floating-point value) are
117        converted to 65024.  Additionally: negative infinity is converted
118        to zero; positive infinity is converted to positive infinity; and
119        both positive and negative NaN are converted to positive NaN.
120
121        Any representable unsigned 11-bit floating-point value is legal
122        as input to a GL command that accepts 11-bit floating-point data.
123        The result of providing a value that is not a floating-point
124        number (such as infinity or NaN) to such a command is unspecified,
125        but must not lead to GL interruption or termination.  Providing a
126        denormalized number or negative zero to GL must yield predictable
127        results.
128
129        "Unsigned 10-Bit Floating-Point Numbers"
130
131        An unsigned 10-bit floating-point number has no sign bit, a 5-bit
132        exponent (E), and a 5-bit mantissa (M).  The value of an unsigned
133        10-bit floating-point number (represented as an 10-bit unsigned
134        integer N) is determined by the following:
135
136            0.0,                      if E == 0 and M == 0,
137            2^-14 * (M / 32),         if E == 0 and M != 0,
138            2^(E-15) * (1 + M/32),    if 0 < E < 31,
139            INF,                      if E == 31 and M == 0, or
140            NaN,                      if E == 31 and M != 0,
141
142        where
143
144            E = floor(N / 32), and
145            M = N mod 32.
146
147        When a floating-point value is converted to an unsigned 10-bit
148        floating-point representation, finite values are rounded to the
149        closet representable finite value.  While less accurate,
150        implementations are allowed to always round in the direction of
151        zero.  This means negative values are converted to zero.
152        Likewise, finite positive values greater than 64512 (the maximum
153        finite representable unsigned 10-bit floating-point value) are
154        converted to 64512.  Additionally: negative infinity is converted
155        to zero; positive infinity is converted to positive infinity; and
156        both positive and negative NaN are converted to positive NaN.
157
158        Any representable unsigned 10-bit floating-point value is legal
159        as input to a GL command that accepts 10-bit floating-point data.
160        The result of providing a value that is not a floating-point
161        number (such as infinity or NaN) to such a command is
162        unspecified, but must not lead to GL interruption or termination.
163        Providing a denormalized number or negative zero to GL must yield
164        predictable results.
165
166Changes to Chapter 3 of the OpenGL ES 2.0.25 Specification (Rasterization)
167
168    Add to Table 3.2, p. 62:
169
170        type Parameter                            Corresponding  Special
171        Token Name                                GL Data Type   Interpretation
172        ----------------------------------------  -------------  --------------
173        UNSIGNED_INT_10F_11F_11F_REV_APPLE        uint           Yes
174        UNSIGNED_INT_5_9_9_9_REV_APPLE            uint           Yes
175
176    Add to Table 3.4, p. 63:
177
178        Format            Type                                  Bytes per Pixel
179        ----------------  ------------------------------------  ---------------
180        RGB               UNSIGNED_INT_10F_11F_11F_REV_APPLE    4
181        RGB               UNSIGNED_INT_5_9_9_9_REV_APPLE        4
182
183  Add to Table 3.5, p. 64:
184
185        type Parameter                       GL Data  Number of   Matching
186        Token Name                           Type     Components  Pixel Formats
187        ----------------------------------   -------  ----------  -------------
188        UNSIGNED_INT_10F_11F_11F_REV_APPLE   uint     3           RGB
189        UNSIGNED_INT_5_9_9_9_REV_APPLE       uint     3           RGB
190
191  Add the following to section 3.6.2 Transfer of Pixel Rectangles,
192  subsection Unpacking
193
194
195        UNSIGNED_INT_10F_11F_11F_REV_APPLE:
196
197         31 30 ... 23 22 21 20 ... 12 11 10  9 ...  1  0
198        +---------------+---------------+---------------+
199        |      3rd      |      2nd      |      1st      |
200        +---------------+---------------+---------------+
201
202
203        UNSIGNED_INT_5_9_9_9_REV_APPLE:
204
205         31 30 ... 27 26 25 24 ... 18 17 16 15 ...  9 8 7 6 5 4 ... 0
206        +------------+---------------+---------------+---------------+
207        |     4th    |      3rd      |      2nd      |      1st      |
208        +------------+---------------+---------------+---------------+
209
210  Add Section 3.7.14, Shared Exponent Texture Color Conversion
211
212        If the currently bound texture's <format> is RGB and <type> is
213        UNSIGNED_INT_5_9_9_9_REV_APPLE, the red, green, blue, and shared
214        bits are converted to color components (prior to filtering) using
215        shared exponent decoding.  The 1st, 2nd, 3rd, and 4th components
216        are called p_red, p_green, p_blue, and p_exp respectively and are
217        treated as unsigned integers. They are converted to floating-point
218        red, green, and blue as follows:
219
220            red   = p_red   * 2^(p_exp - B - N)
221            green = p_green * 2^(p_exp - B - N)
222            blue  = p_blue  * 2^(p_exp - B - N)
223
224        where B is 15 (the exponent bias) and N is 9 (the number of mantissa
225        bits)."
226
227Errors
228
229    Relaxation of INVALID_ENUM errors
230    ---------------------------------
231
232    TexImage2D, and TexSubImage2D accept  the new
233    UNSIGNED_INT_10F_11F_11F_REV_APPLE and
234    UNSIGNED_INT_5_9_9_9_REV_APPLE token for <type>.
235
236    TexStorage2DEXT accepts the new R11F_G11F_B10F_APPLE and
237    RGB9_E5_APPLE token for <internalformat>.
238
239
240    New errors
241    ----------
242
243    INVALID_OPERATION is generated by TexImage2D and TexSubImage2D
244    if <type> is UNSIGNED_INT_10F_11F_11F_REV_APPLE or
245    UNSIGNED_INT_5_9_9_9_REV_APPLE and <format> is not RGB.
246
247    UNSIGNED_INT_10F_11F_11F_REV_APPLE is implied as the <type> when
248    TexStorage2DEXT is called with <internalformat>
249    R11F_G11F_B10F_APPLE. Thus, INVALID_OPERATION is generated by TexSubImage2D
250    if <type> is not UNSIGNED_INT_10F_11F_11F_REV_APPLE.
251
252    UNSIGNED_INT_5_9_9_9_REV_APPLE is implied as the <type> when
253    TexStorage2DEXT is called with <internalformat>
254    RGB9_E5_APPLE. Thus, INVALID_OPERATION is generated by TexSubImage2D
255    if <type> is not UNSIGNED_INT_5_9_9_9_REV_APPLE.
256
257Dependencies on OES_texture_half_float
258
259    If OES_texture_half_float is not supported, modify fifth paragraph
260    of 3.7.1 Texture Image Specification, p. 67:
261
262    "The selected groups are processed as described in section 3.6.2, stopping
263    after final expansion to RGBA. If the internal format of the texture is
264    fixed-point, components are clamped to [0,1]. Otherwise, values are not
265    modified."
266
267    Modify first sentence of "Unpacking", p. 62:
268
269    "Data are taken from client memory as a sequence of one of the GL data
270    types listed in Table 3.2. These elements are..."
271
272    Additionally, ignore all references to RGBA16F_EXT, RGB16F_EXT,
273    RG16F_EXT, R16F_EXT, HALF_FLOAT_OES and half.
274
275Dependencies on EXT_texture_storage
276
277    If EXT_texture_storage is not supported, remove all references to
278    TexStorage2DEXT.
279
280New Implementation Dependent State
281
282    None
283
284Revision History
285
286    1.0  2014/02/13  rogoyski    Initial version
287
288