• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    EXT_texture_format_sRGB_override
4
5Name Strings
6
7    GL_EXT_texture_format_sRGB_override
8
9Contributors
10
11    Jeff Leger, Qualcomm
12    Jonathan Wicks, Qualcomm
13    John Carmack, Oculus
14    Cass Everitt, Oculus
15    Graeme Leese, Broadcom
16    Daniel Koch, NVidia
17
18Contact
19
20    Jeff Leger, Qualcomm  (jleger 'at' qti.qualcomm.com)
21
22Status
23
24    Complete.
25
26Version
27
28    Last Modified Date: Feb 21, 2018
29    Revision: #1
30
31Number
32
33     OpenGL ES Extension #299
34
35Dependencies
36
37    OpenGL ES 3.0 or EXT_sRGB are required for OpenGL ES.
38
39    This extension is written against OpenGL ES 3.2.
40
41    EXT_texture_compression_s3tc interacts with this extension.
42
43    EXT_texture_sRGB_decode interacts with this extension.
44
45    EXT_texture_compression_bptc interacts with this extension.
46
47    GL_NV_sRGB_formats interacts with this extension.
48
49    EXT_texture_sRGB_R8 interacts with this extension.
50
51    EXT_texture_sRGB_RG8 interacts with this extension.
52
53    OES_EGL_image_external interacts with this extension.
54
55    This extension is written against the wording of the OpenGL ES 3.2 specification
56    (November 3, 2016).
57
58Overview
59
60    This extension provides a new texture parameter to override the internal
61    format of a texture object; allowing a non-sRGB format to be overridden to
62    a corresponding sRGB format.  For example, an RGB8 texture can be overridden
63    to SRGB8.  Such an override will cause the RGB components to be "decoded" from
64    sRGB color space to linear as part of texture filtering.  This can be useful for
65    applications where a texture was written with sRGB data using EXT_sRGB_write_control
66    or when sampling from an EGLImage that is known to contain sRGB color values.
67
68IP Status
69
70    No known IP claims.
71
72New Procedures and Functions
73
74    None.
75
76New Tokens
77
78    Accepted by the <pname> parameter of
79    TexParameterf, TexParameterfv,
80    TexParameteri, TexParameteriv,
81    TexParameterIiv, TexParameterIuiv,
82    TexParameterIivEXT, TexParameterIuivEXT,
83    GetTexParameterfv, GetTexParameteriv,
84    GetTexParameterIiv, GetTexParameterIuiv,
85    GetTexParameterIivEXT, GetTexParameterIuivEXT:
86
87        TEXTURE_FORMAT_SRGB_OVERRIDE_EXT     0x8FBF
88
89Changes to Section 8.19 (Texture State) of the OpenGL ES 3.2 Specification
90
91    Add to the end of the fifth paragraph describing texture properties, the
92    following sentence:
93
94        "In addition, each set includes the selected sRGB override setting."
95
96    Add to the end of the sixth paragraph describing initial texture state, the
97    following sentence:
98
99        "The value of TEXTURE_FORMAT_SRGB_OVERRIDE_EXT is NONE."
100
101
102Changes to Table 8.19 (Texture parameters and their values):
103
104    Name                               | Type | Legal Values
105    ------------------------------------------------------------
106    TEXTURE_FORMAT_SRGB_OVERRIDE_EXT   | enum | SRGB,
107                                                NONE
108
109Changes to Section 8.21 (sRGB Texture Color Conversion) of the OpenGL ES 3.2 Specification:
110
111    Add the following to the beginning of this section:
112
113   "If the currently bound texture's internal format is one of the non-sRGB formats
114    listed below, and if the texture has TEXTURE_FORMAT_SRGB_OVERRIDE_EXT
115    set to the value SRGB, then the effective internal format is overridden
116    to be the sRGB Override Format as listed below:
117
118        Internal Format                           sRGB Override Format
119        ==============================            ==============================
120        RGB8                                      SRGB8
121        RGBA8                                     SRGB8_ALPHA8
122        COMPRESSED_RGB8_ETC2                      COMPRESSED_SRGB8_ETC2
123        COMPRESSED_RGBA8_ETC2_EAC                 COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
124        COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2  COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
125        COMPRESSED_RGBA_ASTC_4x4                  COMPRESSED_SRGB8_ALPHA8_ASTC_4x4
126        COMPRESSED_RGBA_ASTC_5x4                  COMPRESSED_SRGB8_ALPHA8_ASTC_5x4
127        COMPRESSED_RGBA_ASTC_5x5                  COMPRESSED_SRGB8_ALPHA8_ASTC_5x5
128        COMPRESSED_RGBA_ASTC_6x5                  COMPRESSED_SRGB8_ALPHA8_ASTC_6x5
129        COMPRESSED_RGBA_ASTC_6x6                  COMPRESSED_SRGB8_ALPHA8_ASTC_6x6
130        COMPRESSED_RGBA_ASTC_8x5                  COMPRESSED_SRGB8_ALPHA8_ASTC_8x5
131        COMPRESSED_RGBA_ASTC_8x6                  COMPRESSED_SRGB8_ALPHA8_ASTC_8x6
132        COMPRESSED_RGBA_ASTC_8x8                  COMPRESSED_SRGB8_ALPHA8_ASTC_8x8
133        COMPRESSED_RGBA_ASTC_10x5                 COMPRESSED_SRGB8_ALPHA8_ASTC_10x5
134        COMPRESSED_RGBA_ASTC_10x6                 COMPRESSED_SRGB8_ALPHA8_ASTC_10x6
135        COMPRESSED_RGBA_ASTC_10x8                 COMPRESSED_SRGB8_ALPHA8_ASTC_10x8
136        COMPRESSED_RGBA_ASTC_10x10                COMPRESSED_SRGB8_ALPHA8_ASTC_10x10
137        COMPRESSED_RGBA_ASTC_12x10                COMPRESSED_SRGB8_ALPHA8_ASTC_12x10
138        COMPRESSED_RGBA_ASTC_12x12                COMPRESSED_SRGB8_ALPHA8_ASTC_12x12
139
140        [[ The following additional formats apply if EXT_texture_compression_s3tc_srgb is supported.]]
141
142        COMPRESSED_RGB_S3TC_DXT1_EXT              COMPRESSED_SRGB_S3TC_DXT1_EXT
143        COMPRESSED_RGBA_S3TC_DXT1_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
144        COMPRESSED_RGBA_S3TC_DXT3_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
145        COMPRESSED_RGBA_S3TC_DXT5_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
146
147        [[ The following additional formats apply if EXT_texture_compression_s3tc_srgb is not supported,
148           but EXT_texture_compression_s3tc and GL_NV_sRGB_formats are supported.]]
149
150        COMPRESSED_RGB_S3TC_DXT1_EXT              COMPRESSED_SRGB_S3TC_DXT1_NV
151        COMPRESSED_RGBA_S3TC_DXT1_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV
152        COMPRESSED_RGBA_S3TC_DXT3_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV
153        COMPRESSED_RGBA_S3TC_DXT5_EXT             COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV
154
155        [[ The following additional format applies only if EXT_texture_sRGB_R8 is supported.]]
156
157        R8                                        SR8_EXT
158
159        [[ The following additional format applies only if EXT_texture_sRGB_RG8 is supported.]]
160
161        RG8                                       SRG8_EXT
162
163        [[ The following additional format applies if EXT_texture_compression_bptc is supported.]]
164
165        COMPRESSED_RGBA_BPTC_UNORM_EXT            COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
166
167
168    If the internal format is not one of the above formats, then
169    the value of TEXTURE_FORMAT_SRGB_OVERRIDE_EXT is ignored.
170
171    If the value of TEXTURE_FORMAT_SRGB_OVERRIDE_EXT is NONE, then
172    the internal format is not overridden.
173
174    If the internal format is overridden, the effect of the override is limited
175    to sRGB texture color conversion as described in this section.  For example,
176    the override has no effect on per-fragment sRGB conversion described in section
177    15.1.6 when when the texture is attached as a renderbuffer or framebuffer.
178
179    It is invalid to modify the value of TEXTURE_FORMAT_SRGB_OVERRIDE_EXT
180    for a immutable-format texture.
181
182    [[ The following applies if OES_EGL_image_external is supported.]]
183
184    If the texture target is an EGLImage, then the internal format may be unknown
185    and not otherwise supported by OpenGL ES.  It is up to the implementation to
186    determine whether specific EGLImage formats will support
187    TEXTURE_FORMAT_SRGB_OVERRIDE_EXT."
188
189Errors
190
191    INVALID_ENUM is generated if the <pname> parameter of
192    TexParameter[i,f,Ii,Iui][v][EXT], TextureParameter[i,f,Ii,Iui][v]EXT
193    is TEXTURE_FORMAT_SRGB_OVERRIDE_EXT and the <param> parameter is not
194    SRGB or NONE.
195
196    INVALID_OPERATION is generated if the <pname> parameter of
197    TexParameter[i,f,Ii,Iui][v][EXT], TextureParameter[i,f,Ii,Iui][v]EXT
198    is TEXTURE_FORMAT_SRGB_OVERRIDE_EXT when TEXTURE_IMMUTABLE_FORMAT is TRUE.
199
200New State
201
202    In table 21.10, Textures ((state per texture object), p. 454, add the following:
203
204    Get Value                         Type  Get Command           Initial Value  Description       Sec.
205    --------------------------------  ----  --------------------  -------------  ----------------  -----
206    TEXTURE_FORMAT_SRGB_OVERRIDE_EXT   E    GetTexParameter[if]v  NONE            Indicates the     8.21
207                                                                                  sRBG internal
208                                                                                  format override.
209
210Issues
211
212    1) Why is this parameter only added to texture state and not sampler state?
213
214        RESOLVED: Hardware implementations typically treat sRGB handling as a
215        texture state and not a sampler state.  Supporting this property for
216        sampler state adds driver overhead that implementors would prefer to
217        avoid.
218
219     2) What is the interaction of this extension with EXT_texture_sRGB_decode
220
221        RESOLVED: Both extensions can be used in combination.  This extension
222        allows a non-sRGB format (e.g. RGB8) to be overridden so that it behaves
223        as an sRGB format (e.g. SRGB8), with the corresponding texture sRGB-decode
224        operation enabled by default.  Using EXT_texture_sRGB_decode extension with
225        SKIP_DECODE_EXT value, it is possible to skip (disable) the decode operation.
226
227Revision History
228
229    Rev.    Date     Author    Changes
230    ----  --------  --------  ----------------------------------------------
231     1    02/21/18   jleger    Initial version.
232