1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
<?xml version="1.0"?>
<extension href="WEBGL_compressed_texture_etc/">
<name>WEBGL_compressed_texture_etc</name>
<contact>
<a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
</contact>
<contributors>
<contributor>Jeff Gilbert, Mozilla</contributor>
<contributor>Members of the WebGL working group</contributor>
</contributors>
<number>29</number>
<depends>
<api version="1.0"/>
</depends>
<overview>
<p>
This extension exposes the compressed texture formats defined as core in the
<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.4.pdf">
OpenGL ES 3.0</a> spec to WebGL. These include the ETC2 and EAC formats, where
ETC2 is a superset of ETC1. ETC1 textures can be loaded using the ETC2 token
value. All of these formats are in the ETC family.
</p>
<p>
Browsers should not advertise this extension when the WebGL implementation, or
graphics driver, supports these formats by decompressing them.
</p>
<features>
<feature>
Compression formats <code>COMPRESSED_R11_EAC</code>,
<code>COMPRESSED_SIGNED_R11_EAC</code>,
<code>COMPRESSED_RG11_EAC</code>,
<code>COMPRESSED_SIGNED_RG11_EAC</code>,
<code>COMPRESSED_RGB8_ETC2</code>,
<code>COMPRESSED_SRGB8_ETC2</code>,
<code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_RGBA8_ETC2_EAC</code>,
and <code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code> may be passed to the
<code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points. In
WebGL 2.0, they may also be passed to the <code>compressedTexImage3D</code> and
<code>compressedTexSubImage3D</code> entry points with the <code>TEXTURE_2D_ARRAY</code>
target.
</feature>
<feature>
Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
will include the formats from this specification.
</feature>
<feature>
For all of the formats, <code>validatedSize</code> (defined for each specific format
below) is validated in the following ways:
<ul>
<li>
<b>WebGL 1.0 and 2.0</b>: if the variant of <code>compressedTexImage*D</code> or
<code>compressedTexSubImage*D</code> taking <code>ArrayBufferView pixels</code> is
called, then the <code>byteLength</code> of the view must be equal to
<code>validatedSize</code>, or an INVALID_VALUE error is generated.
</li>
<li>
<b>WebGL 2.0</b>: if the variant of <code>compressedTexImage*D</code> or
<code>compressedTexSubImage*D</code> taking <code>GLintptr offset</code> is called,
and <code>offset + validatedSize</code> is greater than the size of the bound
<code>PIXEL_UNPACK_BUFFER</code>, an <code>INVALID_OPERATION</code> error is
generated.
</li>
</ul>
<dl>
<dt>COMPRESSED_R11_EAC</dt>
<dt>COMPRESSED_SIGNED_R11_EAC</dt>
<dt>COMPRESSED_RGB8_ETC2</dt>
<dt>COMPRESSED_SRGB8_ETC2</dt>
<dt>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</dt>
<dt>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</dt>
<dd><p><code>validatedSize</code> is computed in the following way:</p>
<blockquote><code>
floor((width + 3) / 4) * floor((height + 3) / 4) * 8
</code></blockquote>
</dd>
</dl>
<dl>
<dt>COMPRESSED_RG11_EAC</dt>
<dt>COMPRESSED_SIGNED_RG11_EAC</dt>
<dt>COMPRESSED_RGBA8_ETC2_EAC</dt>
<dt>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</dt>
<dd><p><code>validatedSize</code> is computed in the following way:</p>
<blockquote><code>
floor((width + 3) / 4) * floor((height + 3) / 4) * 16
</code></blockquote>
</dd>
</dl>
</feature>
</features>
</overview>
<idl xml:space="preserve">
[NoInterfaceObject]
interface WEBGL_compressed_texture_etc {
/* Compressed Texture Formats */
const GLenum COMPRESSED_R11_EAC = 0x9270;
const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
const GLenum COMPRESSED_RG11_EAC = 0x9272;
const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
};
</idl>
<newtok>
<function name="compressedTexImage2D">
<param name="internalformat" type="GLenum"/>
Accepted by the <code>internalformat</code> parameter:
<code>COMPRESSED_R11_EAC</code>,
<code>COMPRESSED_SIGNED_R11_EAC</code>,
<code>COMPRESSED_RG11_EAC</code>,
<code>COMPRESSED_SIGNED_RG11_EAC</code>,
<code>COMPRESSED_RGB8_ETC2</code>,
<code>COMPRESSED_SRGB8_ETC2</code>,
<code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_RGBA8_ETC2_EAC</code> or
<code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code>
<br/>
</function>
<function name="compressedTexSubImage2D">
<param name="internalformat" type="GLenum"/>
Accepted by the <code>internalformat</code> parameter:
<code>COMPRESSED_R11_EAC</code>,
<code>COMPRESSED_SIGNED_R11_EAC</code>,
<code>COMPRESSED_RG11_EAC</code>,
<code>COMPRESSED_SIGNED_RG11_EAC</code>,
<code>COMPRESSED_RGB8_ETC2</code>,
<code>COMPRESSED_SRGB8_ETC2</code>,
<code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
<code>COMPRESSED_RGBA8_ETC2_EAC</code> or
<code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code>
<br/>
</function>
</newtok>
<errors>
<error enum="INVALID_VALUE">
The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code>,
<code>compressedTexSubImage2D</code>, <code>compressedTexImage3D</code>, and
<code>compressedTexSubImage3D</code> if the variant taking <code>ArrayBufferView pixels</code>
is called and the size restrictions above are not met.
</error>
<error enum="INVALID_OPERATION">
The error <code>INVALID_OPERATION</code> is generated by <code>compressedTexImage2D</code>,
<code>compressedTexSubImage2D</code>, <code>compressedTexImage3D</code>, and
<code>compressedTexSubImage3D</code> if the variant taking <code>GLintptr offset</code> is
called and the size restrictions above are not met.
</error>
</errors>
<history>
<revision date="2013/12/9">
<change>Initial revision.</change>
</revision>
<revision date="2014/07/15">
<change>Added NoInterfaceObject extended attribute.</change>
</revision>
<revision date="2014/12/12">
<change>COMPRESSED_RGB_ETC2 should be COMPRESSED_RGB8_ETC2.</change>
<change>Remove unnecessary language.</change>
</revision>
<revision date="2015/01/31">
<change>Moved to draft.</change>
<change>Added issue questions.</change>
<change>Formalized the newtok and error codes.</change>
</revision>
<revision date="2016/09/16">
<change>Renamed to WEBGL_compressed_texture_es3_0.</change>
</revision>
<revision date="2016/09/21">
<change>Clarifications to the supported formats on suggestion from Mark Callow.</change>
</revision>
<revision date="2016/09/30">
<change>Addressed issues regarding 3D entry points, description of interation with WebGL 2.0,
and generation of INVALID_OPERATION and INVALID_VALUE errors. Added note that browsers should
not advertise this extension if these compressed texture formats are decompressed. Renamed to
WEBGL_compressed_texture_etc after further discussion. Promoted to community
approved.</change>
</revision>
</history>
</extension>
|