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.
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>
16 <div id=
"description"></div>
17 <div id=
"console"></div>
18 <canvas id=
"canvas" style=
"width: 50px; height: 50px;"> </canvas>
21 description("This test ensures that the WebGL context has all the constants and (non-function) properties in the specification.");
25 DEPTH_BUFFER_BIT
: 0x00000100,
26 STENCIL_BUFFER_BIT
: 0x00000400,
27 COLOR_BUFFER_BIT
: 0x00004000,
35 TRIANGLE_STRIP
: 0x0005,
36 TRIANGLE_FAN
: 0x0006,
38 /* AlphaFunction (not supported in ES20) */
48 /* BlendingFactorDest */
52 ONE_MINUS_SRC_COLOR
: 0x0301,
54 ONE_MINUS_SRC_ALPHA
: 0x0303,
56 ONE_MINUS_DST_ALPHA
: 0x0305,
58 /* BlendingFactorSrc */
62 ONE_MINUS_DST_COLOR
: 0x0307,
63 SRC_ALPHA_SATURATE
: 0x0308,
65 /* ONE_MINUS_SRC_ALPHA */
67 /* ONE_MINUS_DST_ALPHA */
69 /* BlendEquationSeparate */
71 BLEND_EQUATION
: 0x8009,
72 BLEND_EQUATION_RGB
: 0x8009, /* same as BLEND_EQUATION */
73 BLEND_EQUATION_ALPHA
: 0x883D,
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,
91 ARRAY_BUFFER
: 0x8892,
92 ELEMENT_ARRAY_BUFFER
: 0x8893,
93 ARRAY_BUFFER_BINDING
: 0x8894,
94 ELEMENT_ARRAY_BUFFER_BINDING
: 0x8895,
98 DYNAMIC_DRAW
: 0x88E8,
100 BUFFER_SIZE
: 0x8764,
101 BUFFER_USAGE
: 0x8765,
103 CURRENT_VERTEX_ATTRIB
: 0x8626,
108 FRONT_AND_BACK
: 0x0408,
125 STENCIL_TEST
: 0x0B90,
127 SCISSOR_TEST
: 0x0C11,
128 POLYGON_OFFSET_FILL
: 0x8037,
129 SAMPLE_ALPHA_TO_COVERAGE
: 0x809E,
130 SAMPLE_COVERAGE
: 0x80A0,
134 INVALID_ENUM
: 0x0500,
135 INVALID_VALUE
: 0x0501,
136 INVALID_OPERATION
: 0x0502,
137 OUT_OF_MEMORY
: 0x0505,
139 /* FrontFaceDirection */
145 ALIASED_POINT_SIZE_RANGE
: 0x846D,
146 ALIASED_LINE_WIDTH_RANGE
: 0x846E,
147 CULL_FACE_MODE
: 0x0B45,
149 DEPTH_RANGE
: 0x0B70,
150 DEPTH_WRITEMASK
: 0x0B72,
151 DEPTH_CLEAR_VALUE
: 0x0B73,
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,
169 SCISSOR_BOX
: 0x0C10,
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,
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,
190 SAMPLE_COVERAGE_VALUE
: 0x80AA,
191 SAMPLE_COVERAGE_INVERT
: 0x80AB,
193 /* GetTextureParameter */
194 /* TEXTURE_MAG_FILTER */
195 /* TEXTURE_MIN_FILTER */
199 COMPRESSED_TEXTURE_FORMATS
: 0x86A3,
207 GENERATE_MIPMAP_HINT
: 0x8192,
211 UNSIGNED_BYTE
: 0x1401,
213 UNSIGNED_SHORT
: 0x1403,
215 UNSIGNED_INT
: 0x1405,
219 DEPTH_COMPONENT
: 0x1902,
224 LUMINANCE_ALPHA
: 0x190A,
228 UNSIGNED_SHORT_4_4_4_4
: 0x8033,
229 UNSIGNED_SHORT_5_5_5_1
: 0x8034,
230 UNSIGNED_SHORT_5_6_5
: 0x8363,
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 */
277 /* TextureMagFilter */
281 /* TextureMinFilter */
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,
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,
342 ACTIVE_TEXTURE
: 0x84E0,
344 /* TextureWrapMode */
346 CLAMP_TO_EDGE
: 0x812F,
347 MIRRORED_REPEAT
: 0x8370,
364 SAMPLER_CUBE
: 0x8B60,
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,
376 COMPILE_STATUS
: 0x8B81,
378 /* Shader Precision-Specified Types */
380 MEDIUM_FLOAT
: 0x8DF1,
386 /* Framebuffer Object. */
387 FRAMEBUFFER
: 0x8D40,
388 RENDERBUFFER
: 0x8D41,
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,
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,
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,
456 TEXTURE_BINDING_3D
: 0x806A,
457 UNPACK_SKIP_IMAGES
: 0x806D,
458 UNPACK_IMAGE_HEIGHT
: 0x806E,
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,
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,
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,
518 SRGB8_ALPHA8
: 0x8C43,
519 COMPARE_REF_TO_TEXTURE
: 0x884E,
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,
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,
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,
637 VERTEX_ARRAY_BINDING
: 0x85B5,
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,
682 SYNC_GPU_COMMANDS_COMPLETE
: 0x9117,
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,
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
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,
731 ACTIVE_UNIFORM_MAX_LENGTH
: 0x8B87,
732 ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
: 0x8A35,
733 ACTIVE_ATTRIBUTE_MAX_LENGTH
: 0x8B8A,
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
) {
765 testFailed("Property does not exist: " + p
)
770 function assertNoProperty(v
, p
) {
772 testFailed("Property is defined and should not be: " + p
)
779 function assertMsg_(bool
, msg
) {
780 if (!bool
) // show only failures to avoid spamming result list
781 assertMsg(bool
, msg
);
786 debug("Canvas.getContext");
788 var canvas
= document
.getElementById("canvas");
789 var wtu
= WebGLTestUtils
;
790 var gl
= wtu
.create3DContext(canvas
, null, 2);
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
;
797 testPassed("All WebGL constants found to have correct values.");
800 for (var i
in removedConstants
) {
801 var r
= assertNoProperty(gl
, i
);
802 passed
= passed
&& r
;
805 testPassed("All constants removed from WebGL spec were absent from WebGL context.");
807 var extended
= false;
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) {
819 testFailed("Also found the following extra properties:");
826 testPassed("No extra properties found on WebGL context.");
830 var successfullyParsed
= true;
832 <script src=
"../../js/js-test-post.js"></script>