Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / context / constants-and-properties-2.html
blobf4e2bfc30e3ab7acbe8d05f250f4dbd517a397d7
1 <!--
2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <title>WebGL2 Constants and Properties Test</title>
11 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
12 <script src="../../js/js-test-pre.js"></script>
13 <script src="../../js/webgl-test-utils.js"></script>
14 </head>
15 <body>
16 <div id="description"></div>
17 <div id="console"></div>
18 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
19 <script>
20 "use strict";
21 description("This test ensures that the WebGL context has all the constants and (non-function) properties in the specification.");
23 var constants = {
24 /* ClearBufferMask */
25 DEPTH_BUFFER_BIT : 0x00000100,
26 STENCIL_BUFFER_BIT : 0x00000400,
27 COLOR_BUFFER_BIT : 0x00004000,
29 /* BeginMode */
30 POINTS : 0x0000,
31 LINES : 0x0001,
32 LINE_LOOP : 0x0002,
33 LINE_STRIP : 0x0003,
34 TRIANGLES : 0x0004,
35 TRIANGLE_STRIP : 0x0005,
36 TRIANGLE_FAN : 0x0006,
38 /* AlphaFunction (not supported in ES20) */
39 /* NEVER */
40 /* LESS */
41 /* EQUAL */
42 /* LEQUAL */
43 /* GREATER */
44 /* NOTEQUAL */
45 /* GEQUAL */
46 /* ALWAYS */
48 /* BlendingFactorDest */
49 ZERO : 0,
50 ONE : 1,
51 SRC_COLOR : 0x0300,
52 ONE_MINUS_SRC_COLOR : 0x0301,
53 SRC_ALPHA : 0x0302,
54 ONE_MINUS_SRC_ALPHA : 0x0303,
55 DST_ALPHA : 0x0304,
56 ONE_MINUS_DST_ALPHA : 0x0305,
58 /* BlendingFactorSrc */
59 /* ZERO */
60 /* ONE */
61 DST_COLOR : 0x0306,
62 ONE_MINUS_DST_COLOR : 0x0307,
63 SRC_ALPHA_SATURATE : 0x0308,
64 /* SRC_ALPHA */
65 /* ONE_MINUS_SRC_ALPHA */
66 /* DST_ALPHA */
67 /* ONE_MINUS_DST_ALPHA */
69 /* BlendEquationSeparate */
70 FUNC_ADD : 0x8006,
71 BLEND_EQUATION : 0x8009,
72 BLEND_EQUATION_RGB : 0x8009, /* same as BLEND_EQUATION */
73 BLEND_EQUATION_ALPHA : 0x883D,
75 /* BlendSubtract */
76 FUNC_SUBTRACT : 0x800A,
77 FUNC_REVERSE_SUBTRACT : 0x800B,
79 /* Separate Blend Functions */
80 BLEND_DST_RGB : 0x80C8,
81 BLEND_SRC_RGB : 0x80C9,
82 BLEND_DST_ALPHA : 0x80CA,
83 BLEND_SRC_ALPHA : 0x80CB,
84 CONSTANT_COLOR : 0x8001,
85 ONE_MINUS_CONSTANT_COLOR : 0x8002,
86 CONSTANT_ALPHA : 0x8003,
87 ONE_MINUS_CONSTANT_ALPHA : 0x8004,
88 BLEND_COLOR : 0x8005,
90 /* Buffer Objects */
91 ARRAY_BUFFER : 0x8892,
92 ELEMENT_ARRAY_BUFFER : 0x8893,
93 ARRAY_BUFFER_BINDING : 0x8894,
94 ELEMENT_ARRAY_BUFFER_BINDING : 0x8895,
96 STREAM_DRAW : 0x88E0,
97 STATIC_DRAW : 0x88E4,
98 DYNAMIC_DRAW : 0x88E8,
100 BUFFER_SIZE : 0x8764,
101 BUFFER_USAGE : 0x8765,
103 CURRENT_VERTEX_ATTRIB : 0x8626,
105 /* CullFaceMode */
106 FRONT : 0x0404,
107 BACK : 0x0405,
108 FRONT_AND_BACK : 0x0408,
110 /* DepthFunction */
111 /* NEVER */
112 /* LESS */
113 /* EQUAL */
114 /* LEQUAL */
115 /* GREATER */
116 /* NOTEQUAL */
117 /* GEQUAL */
118 /* ALWAYS */
120 /* EnableCap */
121 /* TEXTURE_2D */
122 CULL_FACE : 0x0B44,
123 BLEND : 0x0BE2,
124 DITHER : 0x0BD0,
125 STENCIL_TEST : 0x0B90,
126 DEPTH_TEST : 0x0B71,
127 SCISSOR_TEST : 0x0C11,
128 POLYGON_OFFSET_FILL : 0x8037,
129 SAMPLE_ALPHA_TO_COVERAGE : 0x809E,
130 SAMPLE_COVERAGE : 0x80A0,
132 /* ErrorCode */
133 NO_ERROR : 0,
134 INVALID_ENUM : 0x0500,
135 INVALID_VALUE : 0x0501,
136 INVALID_OPERATION : 0x0502,
137 OUT_OF_MEMORY : 0x0505,
139 /* FrontFaceDirection */
140 CW : 0x0900,
141 CCW : 0x0901,
143 /* GetPName */
144 LINE_WIDTH : 0x0B21,
145 ALIASED_POINT_SIZE_RANGE : 0x846D,
146 ALIASED_LINE_WIDTH_RANGE : 0x846E,
147 CULL_FACE_MODE : 0x0B45,
148 FRONT_FACE : 0x0B46,
149 DEPTH_RANGE : 0x0B70,
150 DEPTH_WRITEMASK : 0x0B72,
151 DEPTH_CLEAR_VALUE : 0x0B73,
152 DEPTH_FUNC : 0x0B74,
153 STENCIL_CLEAR_VALUE : 0x0B91,
154 STENCIL_FUNC : 0x0B92,
155 STENCIL_FAIL : 0x0B94,
156 STENCIL_PASS_DEPTH_FAIL : 0x0B95,
157 STENCIL_PASS_DEPTH_PASS : 0x0B96,
158 STENCIL_REF : 0x0B97,
159 STENCIL_VALUE_MASK : 0x0B93,
160 STENCIL_WRITEMASK : 0x0B98,
161 STENCIL_BACK_FUNC : 0x8800,
162 STENCIL_BACK_FAIL : 0x8801,
163 STENCIL_BACK_PASS_DEPTH_FAIL : 0x8802,
164 STENCIL_BACK_PASS_DEPTH_PASS : 0x8803,
165 STENCIL_BACK_REF : 0x8CA3,
166 STENCIL_BACK_VALUE_MASK : 0x8CA4,
167 STENCIL_BACK_WRITEMASK : 0x8CA5,
168 VIEWPORT : 0x0BA2,
169 SCISSOR_BOX : 0x0C10,
170 /* SCISSOR_TEST */
171 COLOR_CLEAR_VALUE : 0x0C22,
172 COLOR_WRITEMASK : 0x0C23,
173 UNPACK_ALIGNMENT : 0x0CF5,
174 PACK_ALIGNMENT : 0x0D05,
175 MAX_TEXTURE_SIZE : 0x0D33,
176 MAX_VIEWPORT_DIMS : 0x0D3A,
177 SUBPIXEL_BITS : 0x0D50,
178 RED_BITS : 0x0D52,
179 GREEN_BITS : 0x0D53,
180 BLUE_BITS : 0x0D54,
181 ALPHA_BITS : 0x0D55,
182 DEPTH_BITS : 0x0D56,
183 STENCIL_BITS : 0x0D57,
184 POLYGON_OFFSET_UNITS : 0x2A00,
185 /* POLYGON_OFFSET_FILL */
186 POLYGON_OFFSET_FACTOR : 0x8038,
187 TEXTURE_BINDING_2D : 0x8069,
188 SAMPLE_BUFFERS : 0x80A8,
189 SAMPLES : 0x80A9,
190 SAMPLE_COVERAGE_VALUE : 0x80AA,
191 SAMPLE_COVERAGE_INVERT : 0x80AB,
193 /* GetTextureParameter */
194 /* TEXTURE_MAG_FILTER */
195 /* TEXTURE_MIN_FILTER */
196 /* TEXTURE_WRAP_S */
197 /* TEXTURE_WRAP_T */
199 COMPRESSED_TEXTURE_FORMATS : 0x86A3,
201 /* HintMode */
202 DONT_CARE : 0x1100,
203 FASTEST : 0x1101,
204 NICEST : 0x1102,
206 /* HintTarget */
207 GENERATE_MIPMAP_HINT : 0x8192,
209 /* DataType */
210 BYTE : 0x1400,
211 UNSIGNED_BYTE : 0x1401,
212 SHORT : 0x1402,
213 UNSIGNED_SHORT : 0x1403,
214 INT : 0x1404,
215 UNSIGNED_INT : 0x1405,
216 FLOAT : 0x1406,
218 /* PixelFormat */
219 DEPTH_COMPONENT : 0x1902,
220 ALPHA : 0x1906,
221 RGB : 0x1907,
222 RGBA : 0x1908,
223 LUMINANCE : 0x1909,
224 LUMINANCE_ALPHA : 0x190A,
226 /* PixelType */
227 /* UNSIGNED_BYTE */
228 UNSIGNED_SHORT_4_4_4_4 : 0x8033,
229 UNSIGNED_SHORT_5_5_5_1 : 0x8034,
230 UNSIGNED_SHORT_5_6_5 : 0x8363,
232 /* Shaders */
233 FRAGMENT_SHADER : 0x8B30,
234 VERTEX_SHADER : 0x8B31,
235 MAX_VERTEX_ATTRIBS : 0x8869,
236 MAX_VERTEX_UNIFORM_VECTORS : 0x8DFB,
237 MAX_VARYING_VECTORS : 0x8DFC,
238 MAX_COMBINED_TEXTURE_IMAGE_UNITS : 0x8B4D,
239 MAX_VERTEX_TEXTURE_IMAGE_UNITS : 0x8B4C,
240 MAX_TEXTURE_IMAGE_UNITS : 0x8872,
241 MAX_FRAGMENT_UNIFORM_VECTORS : 0x8DFD,
242 SHADER_TYPE : 0x8B4F,
243 DELETE_STATUS : 0x8B80,
244 LINK_STATUS : 0x8B82,
245 VALIDATE_STATUS : 0x8B83,
246 ATTACHED_SHADERS : 0x8B85,
247 ACTIVE_UNIFORMS : 0x8B86,
248 ACTIVE_ATTRIBUTES : 0x8B89,
249 SHADING_LANGUAGE_VERSION : 0x8B8C,
250 CURRENT_PROGRAM : 0x8B8D,
252 /* StencilFunction */
253 NEVER : 0x0200,
254 LESS : 0x0201,
255 EQUAL : 0x0202,
256 LEQUAL : 0x0203,
257 GREATER : 0x0204,
258 NOTEQUAL : 0x0205,
259 GEQUAL : 0x0206,
260 ALWAYS : 0x0207,
262 /* StencilOp */
263 /* ZERO */
264 KEEP : 0x1E00,
265 REPLACE : 0x1E01,
266 INCR : 0x1E02,
267 DECR : 0x1E03,
268 INVERT : 0x150A,
269 INCR_WRAP : 0x8507,
270 DECR_WRAP : 0x8508,
272 /* StringName */
273 VENDOR : 0x1F00,
274 RENDERER : 0x1F01,
275 VERSION : 0x1F02,
277 /* TextureMagFilter */
278 NEAREST : 0x2600,
279 LINEAR : 0x2601,
281 /* TextureMinFilter */
282 /* NEAREST */
283 /* LINEAR */
284 NEAREST_MIPMAP_NEAREST : 0x2700,
285 LINEAR_MIPMAP_NEAREST : 0x2701,
286 NEAREST_MIPMAP_LINEAR : 0x2702,
287 LINEAR_MIPMAP_LINEAR : 0x2703,
289 /* TextureParameterName */
290 TEXTURE_MAG_FILTER : 0x2800,
291 TEXTURE_MIN_FILTER : 0x2801,
292 TEXTURE_WRAP_S : 0x2802,
293 TEXTURE_WRAP_T : 0x2803,
295 /* TextureTarget */
296 TEXTURE_2D : 0x0DE1,
297 TEXTURE : 0x1702,
299 TEXTURE_CUBE_MAP : 0x8513,
300 TEXTURE_BINDING_CUBE_MAP : 0x8514,
301 TEXTURE_CUBE_MAP_POSITIVE_X : 0x8515,
302 TEXTURE_CUBE_MAP_NEGATIVE_X : 0x8516,
303 TEXTURE_CUBE_MAP_POSITIVE_Y : 0x8517,
304 TEXTURE_CUBE_MAP_NEGATIVE_Y : 0x8518,
305 TEXTURE_CUBE_MAP_POSITIVE_Z : 0x8519,
306 TEXTURE_CUBE_MAP_NEGATIVE_Z : 0x851A,
307 MAX_CUBE_MAP_TEXTURE_SIZE : 0x851C,
309 /* TextureUnit */
310 TEXTURE0 : 0x84C0,
311 TEXTURE1 : 0x84C1,
312 TEXTURE2 : 0x84C2,
313 TEXTURE3 : 0x84C3,
314 TEXTURE4 : 0x84C4,
315 TEXTURE5 : 0x84C5,
316 TEXTURE6 : 0x84C6,
317 TEXTURE7 : 0x84C7,
318 TEXTURE8 : 0x84C8,
319 TEXTURE9 : 0x84C9,
320 TEXTURE10 : 0x84CA,
321 TEXTURE11 : 0x84CB,
322 TEXTURE12 : 0x84CC,
323 TEXTURE13 : 0x84CD,
324 TEXTURE14 : 0x84CE,
325 TEXTURE15 : 0x84CF,
326 TEXTURE16 : 0x84D0,
327 TEXTURE17 : 0x84D1,
328 TEXTURE18 : 0x84D2,
329 TEXTURE19 : 0x84D3,
330 TEXTURE20 : 0x84D4,
331 TEXTURE21 : 0x84D5,
332 TEXTURE22 : 0x84D6,
333 TEXTURE23 : 0x84D7,
334 TEXTURE24 : 0x84D8,
335 TEXTURE25 : 0x84D9,
336 TEXTURE26 : 0x84DA,
337 TEXTURE27 : 0x84DB,
338 TEXTURE28 : 0x84DC,
339 TEXTURE29 : 0x84DD,
340 TEXTURE30 : 0x84DE,
341 TEXTURE31 : 0x84DF,
342 ACTIVE_TEXTURE : 0x84E0,
344 /* TextureWrapMode */
345 REPEAT : 0x2901,
346 CLAMP_TO_EDGE : 0x812F,
347 MIRRORED_REPEAT : 0x8370,
349 /* Uniform Types */
350 FLOAT_VEC2 : 0x8B50,
351 FLOAT_VEC3 : 0x8B51,
352 FLOAT_VEC4 : 0x8B52,
353 INT_VEC2 : 0x8B53,
354 INT_VEC3 : 0x8B54,
355 INT_VEC4 : 0x8B55,
356 BOOL : 0x8B56,
357 BOOL_VEC2 : 0x8B57,
358 BOOL_VEC3 : 0x8B58,
359 BOOL_VEC4 : 0x8B59,
360 FLOAT_MAT2 : 0x8B5A,
361 FLOAT_MAT3 : 0x8B5B,
362 FLOAT_MAT4 : 0x8B5C,
363 SAMPLER_2D : 0x8B5E,
364 SAMPLER_CUBE : 0x8B60,
366 /* Vertex Arrays */
367 VERTEX_ATTRIB_ARRAY_ENABLED : 0x8622,
368 VERTEX_ATTRIB_ARRAY_SIZE : 0x8623,
369 VERTEX_ATTRIB_ARRAY_STRIDE : 0x8624,
370 VERTEX_ATTRIB_ARRAY_TYPE : 0x8625,
371 VERTEX_ATTRIB_ARRAY_NORMALIZED : 0x886A,
372 VERTEX_ATTRIB_ARRAY_POINTER : 0x8645,
373 VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : 0x889F,
375 /* Shader Source */
376 COMPILE_STATUS : 0x8B81,
378 /* Shader Precision-Specified Types */
379 LOW_FLOAT : 0x8DF0,
380 MEDIUM_FLOAT : 0x8DF1,
381 HIGH_FLOAT : 0x8DF2,
382 LOW_INT : 0x8DF3,
383 MEDIUM_INT : 0x8DF4,
384 HIGH_INT : 0x8DF5,
386 /* Framebuffer Object. */
387 FRAMEBUFFER : 0x8D40,
388 RENDERBUFFER : 0x8D41,
390 RGBA4 : 0x8056,
391 RGB5_A1 : 0x8057,
392 RGB565 : 0x8D62,
393 DEPTH_COMPONENT16 : 0x81A5,
394 STENCIL_INDEX8 : 0x8D48,
395 DEPTH_STENCIL : 0x84F9,
397 RENDERBUFFER_WIDTH : 0x8D42,
398 RENDERBUFFER_HEIGHT : 0x8D43,
399 RENDERBUFFER_INTERNAL_FORMAT : 0x8D44,
400 RENDERBUFFER_RED_SIZE : 0x8D50,
401 RENDERBUFFER_GREEN_SIZE : 0x8D51,
402 RENDERBUFFER_BLUE_SIZE : 0x8D52,
403 RENDERBUFFER_ALPHA_SIZE : 0x8D53,
404 RENDERBUFFER_DEPTH_SIZE : 0x8D54,
405 RENDERBUFFER_STENCIL_SIZE : 0x8D55,
407 FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : 0x8CD0,
408 FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : 0x8CD1,
409 FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL : 0x8CD2,
410 FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : 0x8CD3,
412 COLOR_ATTACHMENT0 : 0x8CE0,
413 DEPTH_ATTACHMENT : 0x8D00,
414 STENCIL_ATTACHMENT : 0x8D20,
415 DEPTH_STENCIL_ATTACHMENT : 0x821A,
417 NONE : 0,
419 FRAMEBUFFER_COMPLETE : 0x8CD5,
420 FRAMEBUFFER_INCOMPLETE_ATTACHMENT : 0x8CD6,
421 FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : 0x8CD7,
422 FRAMEBUFFER_INCOMPLETE_DIMENSIONS : 0x8CD9,
423 FRAMEBUFFER_UNSUPPORTED : 0x8CDD,
425 FRAMEBUFFER_BINDING : 0x8CA6,
426 RENDERBUFFER_BINDING : 0x8CA7,
427 MAX_RENDERBUFFER_SIZE : 0x84E8,
429 INVALID_FRAMEBUFFER_OPERATION : 0x0506,
431 IMPLEMENTATION_COLOR_READ_TYPE : 0x8B9A,
432 IMPLEMENTATION_COLOR_READ_FORMAT : 0x8B9B,
434 /* WebGL-specific enums */
435 UNPACK_FLIP_Y_WEBGL : 0x9240,
436 UNPACK_PREMULTIPLY_ALPHA_WEBGL : 0x9241,
437 CONTEXT_LOST_WEBGL : 0x9242,
438 UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243,
439 BROWSER_DEFAULT_WEBGL : 0x9244,
441 /* WebGL2 enums */
442 READ_BUFFER : 0x0C02,
443 UNPACK_ROW_LENGTH : 0x0CF2,
444 UNPACK_SKIP_ROWS : 0x0CF3,
445 UNPACK_SKIP_PIXELS : 0x0CF4,
446 PACK_ROW_LENGTH : 0x0D02,
447 PACK_SKIP_ROWS : 0x0D03,
448 PACK_SKIP_PIXELS : 0x0D04,
449 COLOR : 0x1800,
450 DEPTH : 0x1801,
451 STENCIL : 0x1802,
452 RED : 0x1903,
453 RGB8 : 0x8051,
454 RGBA8 : 0x8058,
455 RGB10_A2 : 0x8059,
456 TEXTURE_BINDING_3D : 0x806A,
457 UNPACK_SKIP_IMAGES : 0x806D,
458 UNPACK_IMAGE_HEIGHT : 0x806E,
459 TEXTURE_3D : 0x806F,
460 TEXTURE_WRAP_R : 0x8072,
461 MAX_3D_TEXTURE_SIZE : 0x8073,
462 UNSIGNED_INT_2_10_10_10_REV : 0x8368,
463 MAX_ELEMENTS_VERTICES : 0x80E8,
464 MAX_ELEMENTS_INDICES : 0x80E9,
465 TEXTURE_MIN_LOD : 0x813A,
466 TEXTURE_MAX_LOD : 0x813B,
467 TEXTURE_BASE_LEVEL : 0x813C,
468 TEXTURE_MAX_LEVEL : 0x813D,
469 MIN : 0x8007,
470 MAX : 0x8008,
471 DEPTH_COMPONENT24 : 0x81A6,
472 MAX_TEXTURE_LOD_BIAS : 0x84FD,
473 TEXTURE_COMPARE_MODE : 0x884C,
474 TEXTURE_COMPARE_FUNC : 0x884D,
475 CURRENT_QUERY : 0x8865,
476 QUERY_RESULT : 0x8866,
477 QUERY_RESULT_AVAILABLE : 0x8867,
478 STREAM_READ : 0x88E1,
479 STREAM_COPY : 0x88E2,
480 STATIC_READ : 0x88E5,
481 STATIC_COPY : 0x88E6,
482 DYNAMIC_READ : 0x88E9,
483 DYNAMIC_COPY : 0x88EA,
484 MAX_DRAW_BUFFERS : 0x8824,
485 DRAW_BUFFER0 : 0x8825,
486 DRAW_BUFFER1 : 0x8826,
487 DRAW_BUFFER2 : 0x8827,
488 DRAW_BUFFER3 : 0x8828,
489 DRAW_BUFFER4 : 0x8829,
490 DRAW_BUFFER5 : 0x882A,
491 DRAW_BUFFER6 : 0x882B,
492 DRAW_BUFFER7 : 0x882C,
493 DRAW_BUFFER8 : 0x882D,
494 DRAW_BUFFER9 : 0x882E,
495 DRAW_BUFFER10 : 0x882F,
496 DRAW_BUFFER11 : 0x8830,
497 DRAW_BUFFER12 : 0x8831,
498 DRAW_BUFFER13 : 0x8832,
499 DRAW_BUFFER14 : 0x8833,
500 DRAW_BUFFER15 : 0x8834,
501 MAX_FRAGMENT_UNIFORM_COMPONENTS : 0x8B49,
502 MAX_VERTEX_UNIFORM_COMPONENTS : 0x8B4A,
503 SAMPLER_3D : 0x8B5F,
504 SAMPLER_2D_SHADOW : 0x8B62,
505 FRAGMENT_SHADER_DERIVATIVE_HINT : 0x8B8B,
506 PIXEL_PACK_BUFFER : 0x88EB,
507 PIXEL_UNPACK_BUFFER : 0x88EC,
508 PIXEL_PACK_BUFFER_BINDING : 0x88ED,
509 PIXEL_UNPACK_BUFFER_BINDING : 0x88EF,
510 FLOAT_MAT2x3 : 0x8B65,
511 FLOAT_MAT2x4 : 0x8B66,
512 FLOAT_MAT3x2 : 0x8B67,
513 FLOAT_MAT3x4 : 0x8B68,
514 FLOAT_MAT4x2 : 0x8B69,
515 FLOAT_MAT4x3 : 0x8B6A,
516 SRGB : 0x8C40,
517 SRGB8 : 0x8C41,
518 SRGB8_ALPHA8 : 0x8C43,
519 COMPARE_REF_TO_TEXTURE : 0x884E,
520 RGBA32F : 0x8814,
521 RGB32F : 0x8815,
522 RGBA16F : 0x881A,
523 RGB16F : 0x881B,
524 VERTEX_ATTRIB_ARRAY_INTEGER : 0x88FD,
525 MAX_ARRAY_TEXTURE_LAYERS : 0x88FF,
526 MIN_PROGRAM_TEXEL_OFFSET : 0x8904,
527 MAX_PROGRAM_TEXEL_OFFSET : 0x8905,
528 MAX_VARYING_COMPONENTS : 0x8B4B,
529 TEXTURE_2D_ARRAY : 0x8C1A,
530 TEXTURE_BINDING_2D_ARRAY : 0x8C1D,
531 R11F_G11F_B10F : 0x8C3A,
532 UNSIGNED_INT_10F_11F_11F_REV : 0x8C3B,
533 RGB9_E5 : 0x8C3D,
534 UNSIGNED_INT_5_9_9_9_REV : 0x8C3E,
535 TRANSFORM_FEEDBACK_BUFFER_MODE : 0x8C7F,
536 MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS : 0x8C80,
537 TRANSFORM_FEEDBACK_VARYINGS : 0x8C83,
538 TRANSFORM_FEEDBACK_BUFFER_START : 0x8C84,
539 TRANSFORM_FEEDBACK_BUFFER_SIZE : 0x8C85,
540 TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN : 0x8C88,
541 RASTERIZER_DISCARD : 0x8C89,
542 MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS : 0x8C8A,
543 MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS : 0x8C8B,
544 INTERLEAVED_ATTRIBS : 0x8C8C,
545 SEPARATE_ATTRIBS : 0x8C8D,
546 TRANSFORM_FEEDBACK_BUFFER : 0x8C8E,
547 TRANSFORM_FEEDBACK_BUFFER_BINDING : 0x8C8F,
548 RGBA32UI : 0x8D70,
549 RGB32UI : 0x8D71,
550 RGBA16UI : 0x8D76,
551 RGB16UI : 0x8D77,
552 RGBA8UI : 0x8D7C,
553 RGB8UI : 0x8D7D,
554 RGBA32I : 0x8D82,
555 RGB32I : 0x8D83,
556 RGBA16I : 0x8D88,
557 RGB16I : 0x8D89,
558 RGBA8I : 0x8D8E,
559 RGB8I : 0x8D8F,
560 RED_INTEGER : 0x8D94,
561 RGB_INTEGER : 0x8D98,
562 RGBA_INTEGER : 0x8D99,
563 SAMPLER_2D_ARRAY : 0x8DC1,
564 SAMPLER_2D_ARRAY_SHADOW : 0x8DC4,
565 SAMPLER_CUBE_SHADOW : 0x8DC5,
566 UNSIGNED_INT_VEC2 : 0x8DC6,
567 UNSIGNED_INT_VEC3 : 0x8DC7,
568 UNSIGNED_INT_VEC4 : 0x8DC8,
569 INT_SAMPLER_2D : 0x8DCA,
570 INT_SAMPLER_3D : 0x8DCB,
571 INT_SAMPLER_CUBE : 0x8DCC,
572 INT_SAMPLER_2D_ARRAY : 0x8DCF,
573 UNSIGNED_INT_SAMPLER_2D : 0x8DD2,
574 UNSIGNED_INT_SAMPLER_3D : 0x8DD3,
575 UNSIGNED_INT_SAMPLER_CUBE : 0x8DD4,
576 UNSIGNED_INT_SAMPLER_2D_ARRAY : 0x8DD7,
577 DEPTH_COMPONENT32F : 0x8CAC,
578 DEPTH32F_STENCIL8 : 0x8CAD,
579 FLOAT_32_UNSIGNED_INT_24_8_REV : 0x8DAD,
580 FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING : 0x8210,
581 FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE : 0x8211,
582 FRAMEBUFFER_ATTACHMENT_RED_SIZE : 0x8212,
583 FRAMEBUFFER_ATTACHMENT_GREEN_SIZE : 0x8213,
584 FRAMEBUFFER_ATTACHMENT_BLUE_SIZE : 0x8214,
585 FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE : 0x8215,
586 FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE : 0x8216,
587 FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE : 0x8217,
588 FRAMEBUFFER_DEFAULT : 0x8218,
589 UNSIGNED_INT_24_8 : 0x84FA,
590 DEPTH24_STENCIL8 : 0x88F0,
591 UNSIGNED_NORMALIZED : 0x8C17,
592 DRAW_FRAMEBUFFER_BINDING : 0x8CA6,
593 READ_FRAMEBUFFER : 0x8CA8,
594 DRAW_FRAMEBUFFER : 0x8CA9,
595 READ_FRAMEBUFFER_BINDING : 0x8CAA,
596 RENDERBUFFER_SAMPLES : 0x8CAB,
597 FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER : 0x8CD4,
598 MAX_COLOR_ATTACHMENTS : 0x8CDF,
599 COLOR_ATTACHMENT1 : 0x8CE1,
600 COLOR_ATTACHMENT2 : 0x8CE2,
601 COLOR_ATTACHMENT3 : 0x8CE3,
602 COLOR_ATTACHMENT4 : 0x8CE4,
603 COLOR_ATTACHMENT5 : 0x8CE5,
604 COLOR_ATTACHMENT6 : 0x8CE6,
605 COLOR_ATTACHMENT7 : 0x8CE7,
606 COLOR_ATTACHMENT8 : 0x8CE8,
607 COLOR_ATTACHMENT9 : 0x8CE9,
608 COLOR_ATTACHMENT10 : 0x8CEA,
609 COLOR_ATTACHMENT11 : 0x8CEB,
610 COLOR_ATTACHMENT12 : 0x8CEC,
611 COLOR_ATTACHMENT13 : 0x8CED,
612 COLOR_ATTACHMENT14 : 0x8CEE,
613 COLOR_ATTACHMENT15 : 0x8CEF,
614 FRAMEBUFFER_INCOMPLETE_MULTISAMPLE : 0x8D56,
615 MAX_SAMPLES : 0x8D57,
616 HALF_FLOAT : 0x140B,
617 RG : 0x8227,
618 RG_INTEGER : 0x8228,
619 R8 : 0x8229,
620 RG8 : 0x822B,
621 R16F : 0x822D,
622 R32F : 0x822E,
623 RG16F : 0x822F,
624 RG32F : 0x8230,
625 R8I : 0x8231,
626 R8UI : 0x8232,
627 R16I : 0x8233,
628 R16UI : 0x8234,
629 R32I : 0x8235,
630 R32UI : 0x8236,
631 RG8I : 0x8237,
632 RG8UI : 0x8238,
633 RG16I : 0x8239,
634 RG16UI : 0x823A,
635 RG32I : 0x823B,
636 RG32UI : 0x823C,
637 VERTEX_ARRAY_BINDING : 0x85B5,
638 R8_SNORM : 0x8F94,
639 RG8_SNORM : 0x8F95,
640 RGB8_SNORM : 0x8F96,
641 RGBA8_SNORM : 0x8F97,
642 SIGNED_NORMALIZED : 0x8F9C,
643 COPY_READ_BUFFER : 0x8F36,
644 COPY_WRITE_BUFFER : 0x8F37,
645 COPY_READ_BUFFER_BINDING : 0x8F36,
646 COPY_WRITE_BUFFER_BINDING : 0x8F37,
647 UNIFORM_BUFFER : 0x8A11,
648 UNIFORM_BUFFER_BINDING : 0x8A28,
649 UNIFORM_BUFFER_START : 0x8A29,
650 UNIFORM_BUFFER_SIZE : 0x8A2A,
651 MAX_VERTEX_UNIFORM_BLOCKS : 0x8A2B,
652 MAX_FRAGMENT_UNIFORM_BLOCKS : 0x8A2D,
653 MAX_COMBINED_UNIFORM_BLOCKS : 0x8A2E,
654 MAX_UNIFORM_BUFFER_BINDINGS : 0x8A2F,
655 MAX_UNIFORM_BLOCK_SIZE : 0x8A30,
656 MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS : 0x8A31,
657 MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS : 0x8A33,
658 UNIFORM_BUFFER_OFFSET_ALIGNMENT : 0x8A34,
659 ACTIVE_UNIFORM_BLOCKS : 0x8A36,
660 UNIFORM_TYPE : 0x8A37,
661 UNIFORM_SIZE : 0x8A38,
662 UNIFORM_BLOCK_INDEX : 0x8A3A,
663 UNIFORM_OFFSET : 0x8A3B,
664 UNIFORM_ARRAY_STRIDE : 0x8A3C,
665 UNIFORM_MATRIX_STRIDE : 0x8A3D,
666 UNIFORM_IS_ROW_MAJOR : 0x8A3E,
667 UNIFORM_BLOCK_BINDING : 0x8A3F,
668 UNIFORM_BLOCK_DATA_SIZE : 0x8A40,
669 UNIFORM_BLOCK_ACTIVE_UNIFORMS : 0x8A42,
670 UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES : 0x8A43,
671 UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER : 0x8A44,
672 UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER : 0x8A46,
673 INVALID_INDEX : 0xFFFFFFFF,
674 MAX_VERTEX_OUTPUT_COMPONENTS : 0x9122,
675 MAX_FRAGMENT_INPUT_COMPONENTS : 0x9125,
676 MAX_SERVER_WAIT_TIMEOUT : 0x9111,
677 OBJECT_TYPE : 0x9112,
678 SYNC_CONDITION : 0x9113,
679 SYNC_STATUS : 0x9114,
680 SYNC_FLAGS : 0x9115,
681 SYNC_FENCE : 0x9116,
682 SYNC_GPU_COMMANDS_COMPLETE : 0x9117,
683 UNSIGNALED : 0x9118,
684 SIGNALED : 0x9119,
685 ALREADY_SIGNALED : 0x911A,
686 TIMEOUT_EXPIRED : 0x911B,
687 CONDITION_SATISFIED : 0x911C,
688 WAIT_FAILED : 0x911D,
689 SYNC_FLUSH_COMMANDS_BIT : 0x00000001,
690 TIMEOUT_IGNORED : -1,
691 VERTEX_ATTRIB_ARRAY_DIVISOR : 0x88FE,
692 ANY_SAMPLES_PASSED : 0x8C2F,
693 ANY_SAMPLES_PASSED_CONSERVATIVE : 0x8D6A,
694 SAMPLER_BINDING : 0x8919,
695 RGB10_A2UI : 0x906F,
696 INT_2_10_10_10_REV : 0x8D9F,
697 TRANSFORM_FEEDBACK : 0x8E22,
698 TRANSFORM_FEEDBACK_PAUSED : 0x8E23,
699 TRANSFORM_FEEDBACK_ACTIVE : 0x8E24,
700 TRANSFORM_FEEDBACK_BINDING : 0x8E25,
701 TEXTURE_IMMUTABLE_FORMAT : 0x912F,
702 MAX_ELEMENT_INDEX : 0x8D6B,
703 TEXTURE_IMMUTABLE_LEVELS : 0x82DF,
705 /* WebGL-specific enums */
706 MAX_CLIENT_WAIT_TIMEOUT_WEBGL: 0x9247
709 // Other non-function properties on the WebGL object
710 var otherProperties = {
711 drawingBufferWidth : "number",
712 drawingBufferHeight : "number",
713 drawingBufferColorSpace : "string",
714 unpackColorSpace : "string",
715 canvas : "implementation-dependent"
718 // Properties to be ignored (as a list of strings) because they were
719 // added in versions of the spec that are backward-compatible with
720 // this version
721 var ignoredProperties = [
724 // Constants removed from the WebGL spec compared to ES 3.0
725 var removedConstants = {
726 BUFFER_ACCESS_FLAGS : 0x911F,
727 BUFFER_MAP_LENGTH : 0x9120,
728 BUFFER_MAP_OFFSET : 0x9121,
729 NUM_COMPRESSED_TEXTURE_FORMATS : 0x86A2,
730 FIXED : 0x140C,
731 ACTIVE_UNIFORM_MAX_LENGTH : 0x8B87,
732 ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH : 0x8A35,
733 ACTIVE_ATTRIBUTE_MAX_LENGTH : 0x8B8A,
734 EXTENSIONS : 0x1F03,
735 UNIFORM_NAME_LENGTH : 0x8A39,
736 UNIFORM_BLOCK_NAME_LENGTH : 0x8A41,
737 INFO_LOG_LENGTH : 0x8B84,
738 MAP_READ_BIT : 0x0001,
739 MAP_WRITE_BIT : 0x0002,
740 MAP_INVALIDATE_RANGE_BIT : 0x0004,
741 MAP_INVALIDATE_BUFFER_BIT : 0x0008,
742 MAP_FLUSH_EXPLICIT_BIT : 0x0010,
743 MAP_UNSYNCHRONIZED_BIT : 0x0020,
744 SHADER_SOURCE_LENGTH : 0x8B88,
745 SHADER_COMPILER : 0x8DFA,
746 SHADER_BINARY_FORMATS : 0x8DF8,
747 NUM_SHADER_BINARY_FORMATS : 0x8DF9,
748 TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH : 0x8C76,
749 FRAMEBUFFER_UNDEFINED : 0x8219,
750 PROGRAM_BINARY_RETRIEVABLE_HINT : 0x8257,
751 PROGRAM_BINARY_LENGTH : 0x8741,
752 PROGRAM_BINARY_FORMATS : 0x87FE,
753 NUM_PROGRAM_BINARY_FORMATS : 0x87FF,
754 TEXTURE_SWIZZLE_A : 0x8E45,
755 TEXTURE_SWIZZLE_B : 0x8E44,
756 TEXTURE_SWIZZLE_G : 0x8E43,
757 TEXTURE_SWIZZLE_R : 0x8E42,
758 PRIMITIVE_RESTART_FIXED_INDEX : 0x8D69,
761 function assertProperty(v, p) {
762 if (p in v) {
763 return true;
764 } else {
765 testFailed("Property does not exist: " + p)
766 return false;
770 function assertNoProperty(v, p) {
771 if (p in v) {
772 testFailed("Property is defined and should not be: " + p)
773 return false;
774 } else {
775 return true;
779 function assertMsg_(bool, msg) {
780 if (!bool) // show only failures to avoid spamming result list
781 assertMsg(bool, msg);
782 return bool;
785 debug("");
786 debug("Canvas.getContext");
788 var canvas = document.getElementById("canvas");
789 var wtu = WebGLTestUtils;
790 var gl = wtu.create3DContext(canvas, null, 2);
791 var passed = true;
792 for (var i in constants) {
793 var r = assertProperty(gl, i) && assertMsg_(gl[i] == constants[i], "Property "+i+" value test "+gl[i]+" == "+constants[i]);
794 passed = passed && r;
796 if (passed) {
797 testPassed("All WebGL constants found to have correct values.");
799 passed = true;
800 for (var i in removedConstants) {
801 var r = assertNoProperty(gl, i);
802 passed = passed && r;
804 if (passed) {
805 testPassed("All constants removed from WebGL spec were absent from WebGL context.");
807 var extended = false;
808 for (var i in gl) {
809 if (constants[i] !== undefined) {
810 // OK; known constant
811 } else if (ignoredProperties.indexOf(i) != -1) {
812 // OK; constant that should be ignored because it was added in a later version of the spec
813 } else if (otherProperties[i] !== undefined &&
814 (otherProperties[i] == "implementation-dependent" || typeof gl[i] == otherProperties[i])) {
815 // OK; known property of known type
816 } else if (typeof gl[i] != "function" && removedConstants[i] === undefined) {
817 if (!extended) {
818 extended = true;
819 testFailed("Also found the following extra properties:");
821 testFailed(i);
825 if (!extended) {
826 testPassed("No extra properties found on WebGL context.");
829 debug("");
830 var successfullyParsed = true;
831 </script>
832 <script src="../../js/js-test-post.js"></script>
834 </body>
835 </html>