Home | History | Annotate | Download | only in opengl
      1 # -*- coding: utf-8 -*-
      2 
      3 #-------------------------------------------------------------------------
      4 # drawElements Quality Program utilities
      5 # --------------------------------------
      6 #
      7 # Copyright 2015 The Android Open Source Project
      8 #
      9 # Licensed under the Apache License, Version 2.0 (the "License");
     10 # you may not use this file except in compliance with the License.
     11 # You may obtain a copy of the License at
     12 #
     13 #      http://www.apache.org/licenses/LICENSE-2.0
     14 #
     15 # Unless required by applicable law or agreed to in writing, software
     16 # distributed under the License is distributed on an "AS IS" BASIS,
     17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     18 # See the License for the specific language governing permissions and
     19 # limitations under the License.
     20 #
     21 #-------------------------------------------------------------------------
     22 
     23 import os
     24 import string
     25 
     26 # TODO remove
     27 import sys
     28 sys.path.append(os.path.dirname(os.path.dirname(__file__)))
     29 
     30 from src_util import *
     31 from khr_util.gen_str_util import addValuePrefix, genStrUtilProtos, genStrUtilImpls
     32 
     33 # Bitfield mapping
     34 BITFIELD_GROUPS = [
     35 	# ClearBufferMask
     36 	("BufferMask",		["DEPTH_BUFFER_BIT", "STENCIL_BUFFER_BIT", "COLOR_BUFFER_BIT"]),
     37 	# MapBufferUsageMask
     38 	("BufferMapFlags",	[
     39 		"MAP_READ_BIT",
     40 		"MAP_WRITE_BIT",
     41 		"MAP_INVALIDATE_RANGE_BIT",
     42 		"MAP_INVALIDATE_BUFFER_BIT",
     43 		"MAP_FLUSH_EXPLICIT_BIT",
     44 		"MAP_UNSYNCHRONIZED_BIT"
     45 		]),
     46 	# MemoryBarrierMask
     47 	("MemoryBarrierFlags", [
     48 		"VERTEX_ATTRIB_ARRAY_BARRIER_BIT",
     49 		"ELEMENT_ARRAY_BARRIER_BIT",
     50 		"UNIFORM_BARRIER_BIT",
     51 		"TEXTURE_FETCH_BARRIER_BIT",
     52 		"SHADER_IMAGE_ACCESS_BARRIER_BIT",
     53 		"COMMAND_BARRIER_BIT",
     54 		"PIXEL_BUFFER_BARRIER_BIT",
     55 		"TEXTURE_UPDATE_BARRIER_BIT",
     56 		"BUFFER_UPDATE_BARRIER_BIT",
     57 		"FRAMEBUFFER_BARRIER_BIT",
     58 		"TRANSFORM_FEEDBACK_BARRIER_BIT",
     59 		"ATOMIC_COUNTER_BARRIER_BIT"
     60 		]),
     61 	# ShaderTypeMask
     62 	("ShaderTypeMask",	[
     63 		"VERTEX_SHADER_BIT",
     64 		"FRAGMENT_SHADER_BIT",
     65 		"COMPUTE_SHADER_BIT",
     66 		"GEOMETRY_SHADER_BIT",
     67 		"TESS_CONTROL_SHADER_BIT",
     68 		"TESS_EVALUATION_SHADER_BIT"
     69 		]),
     70 ]
     71 
     72 # Enum mapping
     73 ENUM_GROUPS = [
     74 	# Common enums
     75 
     76 	# ErrorCode
     77 	("Error",				["NO_ERROR", "INVALID_ENUM", "INVALID_VALUE", "INVALID_OPERATION", "OUT_OF_MEMORY",
     78 							 "INVALID_FRAMEBUFFER_OPERATION", "CONTEXT_LOST"]),
     79 	# PixelType, partially
     80 	("Type", [
     81 		# GLES2 types
     82 		"BYTE",
     83 		"UNSIGNED_BYTE",
     84 		"SHORT",
     85 		"UNSIGNED_SHORT",
     86 		"INT",
     87 		"UNSIGNED_INT",
     88 		"FLOAT",
     89 		"FIXED",
     90 		"UNSIGNED_SHORT_5_6_5",
     91 		"UNSIGNED_SHORT_4_4_4_4",
     92 		"UNSIGNED_SHORT_5_5_5_1",
     93 
     94 		# GLES3 types
     95 		"HALF_FLOAT",
     96 		"INT_2_10_10_10_REV",
     97 		"UNSIGNED_INT_2_10_10_10_REV",
     98 		"UNSIGNED_INT_10F_11F_11F_REV",
     99 		"UNSIGNED_INT_5_9_9_9_REV",
    100 		"UNSIGNED_INT_24_8",
    101 		"FLOAT_32_UNSIGNED_INT_24_8_REV",
    102 		"SIGNED_NORMALIZED",
    103 		"UNSIGNED_NORMALIZED",
    104 
    105 		# Extension types
    106 		"HALF_FLOAT_OES",
    107 		]),
    108 
    109 	# GetPName, also GettableState below
    110 	("ParamQuery", [
    111 		# Generic
    112 		"LINE_WIDTH",
    113 		"ALIASED_POINT_SIZE_RANGE",
    114 		"ALIASED_LINE_WIDTH_RANGE",
    115 		"CULL_FACE_MODE",
    116 		"FRONT_FACE",
    117 		"DEPTH_RANGE",
    118 		"DEPTH_WRITEMASK",
    119 		"DEPTH_CLEAR_VALUE",
    120 		"DEPTH_FUNC",
    121 		"STENCIL_CLEAR_VALUE",
    122 		"STENCIL_FUNC",
    123 		"STENCIL_FAIL",
    124 		"STENCIL_PASS_DEPTH_FAIL",
    125 		"STENCIL_PASS_DEPTH_PASS",
    126 		"STENCIL_REF",
    127 		"STENCIL_VALUE_MASK",
    128 		"STENCIL_WRITEMASK",
    129 		"STENCIL_BACK_FUNC",
    130 		"STENCIL_BACK_FAIL",
    131 		"STENCIL_BACK_PASS_DEPTH_FAIL",
    132 		"STENCIL_BACK_PASS_DEPTH_PASS",
    133 		"STENCIL_BACK_REF",
    134 		"STENCIL_BACK_VALUE_MASK",
    135 		"STENCIL_BACK_WRITEMASK",
    136 		"VIEWPORT",
    137 		"SCISSOR_BOX",
    138 		"SCISSOR_TEST",
    139 		"COLOR_CLEAR_VALUE",
    140 		"COLOR_WRITEMASK",
    141 		"UNPACK_ALIGNMENT",
    142 		"PACK_ALIGNMENT",
    143 		"MAX_TEXTURE_SIZE",
    144 		"MAX_VIEWPORT_DIMS",
    145 		"SUBPIXEL_BITS",
    146 		"RED_BITS",
    147 		"GREEN_BITS",
    148 		"BLUE_BITS",
    149 		"ALPHA_BITS",
    150 		"DEPTH_BITS",
    151 		"STENCIL_BITS",
    152 		"POLYGON_OFFSET_UNITS",
    153 		"POLYGON_OFFSET_FILL",
    154         "POLYGON_OFFSET_FACTOR",
    155 		"TEXTURE_BINDING_2D",
    156 		"SAMPLE_BUFFERS",
    157 		"SAMPLES",
    158 		"SAMPLE_COVERAGE_VALUE",
    159 		"SAMPLE_COVERAGE_INVERT",
    160 
    161 		"MAX_CUBE_MAP_TEXTURE_SIZE",
    162 		"MAX_RENDERBUFFER_SIZE",
    163 
    164 		# Program-related
    165 		"MAX_VERTEX_ATTRIBS",
    166 		"MAX_VERTEX_UNIFORM_VECTORS",
    167 		"MAX_VARYING_VECTORS",
    168 		"MAX_COMBINED_TEXTURE_IMAGE_UNITS",
    169 		"MAX_VERTEX_TEXTURE_IMAGE_UNITS",
    170 		"MAX_TEXTURE_IMAGE_UNITS",
    171 		"MAX_FRAGMENT_UNIFORM_VECTORS"
    172 		]),
    173 
    174 	# *missing*
    175 	# Program query
    176 	("ProgramParam", [
    177 		"ACTIVE_ATTRIBUTES",
    178 		"ACTIVE_ATTRIBUTE_MAX_LENGTH",
    179 		"ACTIVE_UNIFORMS",
    180 		"ACTIVE_UNIFORM_BLOCKS",
    181 		"ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH",
    182 		"ACTIVE_UNIFORM_MAX_LENGTH",
    183 		"ATTACHED_SHADERS",
    184 		"DELETE_STATUS",
    185 		"INFO_LOG_LENGTH",
    186 		"LINK_STATUS",
    187 		"PROGRAM_BINARY_RETRIEVABLE_HINT",
    188 		"TRANSFORM_FEEDBACK_BUFFER_MODE",
    189 		"TRANSFORM_FEEDBACK_VARYINGS",
    190 		"TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH",
    191 		"VALIDATE_STATUS",
    192 		"GEOMETRY_INPUT_TYPE",
    193 		"GEOMETRY_OUTPUT_TYPE",
    194 		"GEOMETRY_VERTICES_OUT",
    195 		"GEOMETRY_SHADER_INVOCATIONS",
    196 		"PROGRAM_SEPARABLE",
    197 		"COMPUTE_WORK_GROUP_SIZE",
    198 		"ACTIVE_ATOMIC_COUNTER_BUFFERS",
    199 		"TESS_CONTROL_OUTPUT_VERTICES",
    200 		"TESS_GEN_MODE",
    201 		"TESS_GEN_SPACING",
    202 		"TESS_GEN_VERTEX_ORDER",
    203 		"TESS_GEN_POINT_MODE",
    204 		]),
    205 
    206 	# *missing*
    207 	# Uniform query
    208 	("UniformParam", [
    209 		"UNIFORM_TYPE",
    210 		"UNIFORM_SIZE",
    211 		"UNIFORM_NAME_LENGTH",
    212 		"UNIFORM_BLOCK_INDEX",
    213 		"UNIFORM_OFFSET",
    214 		"UNIFORM_ARRAY_STRIDE",
    215 		"UNIFORM_MATRIX_STRIDE",
    216 		"UNIFORM_IS_ROW_MAJOR"
    217 		]),
    218 
    219 	# *missing*
    220 	# Framebuffers
    221 	("FramebufferAttachment",			["COLOR_ATTACHMENT0", "COLOR_ATTACHMENT1", "COLOR_ATTACHMENT2", "COLOR_ATTACHMENT3",
    222 										 "COLOR_ATTACHMENT4", "COLOR_ATTACHMENT5", "COLOR_ATTACHMENT6", "COLOR_ATTACHMENT7",
    223 										 "COLOR_ATTACHMENT8", "COLOR_ATTACHMENT9", "COLOR_ATTACHMENT10", "COLOR_ATTACHMENT11",
    224 										 "COLOR_ATTACHMENT12", "COLOR_ATTACHMENT13", "COLOR_ATTACHMENT14", "COLOR_ATTACHMENT15",
    225 										 "DEPTH_ATTACHMENT", "STENCIL_ATTACHMENT", "DEPTH_STENCIL_ATTACHMENT",
    226 										 "BACK", "FRONT_LEFT", "FRONT_RIGHT", "BACK_LEFT", "BACK_RIGHT",
    227 										 "DEPTH", "STENCIL"]),
    228 	# *missing*
    229 	("FramebufferAttachmentParameter",	["FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",
    230 										 "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",
    231 										 "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",
    232 										 "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", "FRAMEBUFFER_ATTACHMENT_RED_SIZE",
    233 										 "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
    234 										 "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
    235 										 "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", "FRAMEBUFFER_ATTACHMENT_LAYERED"]),
    236 	("FramebufferTarget",				["FRAMEBUFFER", "RENDERBUFFER", "DRAW_FRAMEBUFFER", "READ_FRAMEBUFFER"]),
    237 	("FramebufferStatus",				["FRAMEBUFFER_COMPLETE", "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",
    238 										 "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", "FRAMEBUFFER_UNSUPPORTED", "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",
    239 										 "FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS"]),
    240 	("FramebufferAttachmentType",		["NONE", "FRAMEBUFFER_DEFAULT", "TEXTURE", "RENDERBUFFER"]),
    241 	("FramebufferColorEncoding",		["LINEAR", "SRGB"]),
    242 
    243 	("FramebufferParameter", [
    244 		"FRAMEBUFFER_DEFAULT_WIDTH",
    245 		"FRAMEBUFFER_DEFAULT_HEIGHT",
    246 		"FRAMEBUFFER_DEFAULT_SAMPLES",
    247 		"FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS",
    248 		"FRAMEBUFFER_DEFAULT_LAYERS",
    249 		]),
    250 
    251 	# Renderbuffers
    252 	("RenderbufferParameter",			["RENDERBUFFER_WIDTH", "RENDERBUFFER_HEIGHT", "RENDERBUFFER_INTERNAL_FORMAT", "RENDERBUFFER_RED_SIZE",
    253 										"RENDERBUFFER_GREEN_SIZE", "RENDERBUFFER_BLUE_SIZE", "RENDERBUFFER_ALPHA_SIZE", "RENDERBUFFER_DEPTH_SIZE",
    254 										"RENDERBUFFER_STENCIL_SIZE", "RENDERBUFFER_SAMPLES"]),
    255 
    256 	# Primitives
    257 	("PrimitiveType",		["POINTS", "LINES", "LINE_STRIP", "LINE_LOOP", "TRIANGLES", "TRIANGLE_STRIP", "TRIANGLE_FAN", "LINES_ADJACENCY", "LINE_STRIP_ADJACENCY", "TRIANGLES_ADJACENCY", "TRIANGLE_STRIP_ADJACENCY"]),
    258 
    259 	# Blending
    260 	("BlendFactor",			["ZERO", "ONE", "SRC_ALPHA_SATURATE",
    261 							 "SRC_COLOR", "ONE_MINUS_SRC_COLOR", "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA",
    262 							 "SRC1_COLOR", "ONE_MINUS_SRC1_COLOR", "SRC1_ALPHA", "ONE_MINUS_SRC1_ALPHA",
    263 							 "DST_COLOR", "ONE_MINUS_DST_COLOR", "DST_ALPHA", "ONE_MINUS_DST_ALPHA",
    264 							 "CONSTANT_COLOR", "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA", "ONE_MINUS_CONSTANT_ALPHA"]),
    265 	("BlendEquation",		[
    266 		"FUNC_ADD",
    267 		"FUNC_SUBTRACT",
    268 		"FUNC_REVERSE_SUBTRACT",
    269 		"MIN",
    270 		"MAX",
    271 		"MULTIPLY_KHR",
    272 		"SCREEN_KHR",
    273 		"OVERLAY_KHR",
    274 		"DARKEN_KHR",
    275 		"LIGHTEN_KHR",
    276 		"COLORDODGE_KHR",
    277 		"COLORBURN_KHR",
    278 		"HARDLIGHT_KHR",
    279 		"SOFTLIGHT_KHR",
    280 		"DIFFERENCE_KHR",
    281 		"EXCLUSION_KHR",
    282 		"HSL_HUE_KHR",
    283 		"HSL_SATURATION_KHR",
    284 		"HSL_COLOR_KHR",
    285 		"HSL_LUMINOSITY_KHR",
    286 		]),
    287 
    288 	# Buffer Objects
    289 	("BufferTarget",		[
    290 		"ARRAY_BUFFER",
    291 		"ELEMENT_ARRAY_BUFFER",
    292 		"COPY_READ_BUFFER",
    293 		"COPY_WRITE_BUFFER",
    294 		"PIXEL_PACK_BUFFER",
    295 		"PIXEL_UNPACK_BUFFER",
    296 		"TRANSFORM_FEEDBACK_BUFFER",
    297 		"UNIFORM_BUFFER",
    298 		"DRAW_INDIRECT_BUFFER",
    299 		"SHADER_STORAGE_BUFFER",
    300 		"TEXTURE_BUFFER",
    301 		"DISPATCH_INDIRECT_BUFFER",
    302 		"ATOMIC_COUNTER_BUFFER",
    303 		]),
    304 	("BufferBinding",		["ARRAY_BUFFER_BINDING", "ELEMENT_ARRAY_BUFFER_BINDING"]),
    305 	("Usage",				[
    306 		"STREAM_DRAW",
    307 		"STREAM_READ",
    308 		"STREAM_COPY",
    309 		"STATIC_DRAW",
    310 		"STATIC_READ",
    311 		"STATIC_COPY",
    312 		"DYNAMIC_DRAW",
    313 		"DYNAMIC_READ",
    314 		"DYNAMIC_COPY"]),
    315 	("BufferQuery",			["BUFFER_SIZE", "BUFFER_USAGE", "BUFFER_ACCESS_FLAGS", "BUFFER_MAPPED", "BUFFER_MAP_OFFSET", "BUFFER_MAP_LENGTH"]),
    316 
    317 	# Culling
    318 	("Face",				["FRONT", "BACK", "FRONT_AND_BACK"]),
    319 
    320 	# Comparison function
    321 	("CompareFunc",			["NEVER", "LESS", "LEQUAL", "GREATER", "EQUAL", "NOTEQUAL", "GEQUAL", "ALWAYS"]),
    322 
    323 	# Enable-disable bit
    324 	("EnableCap",			["TEXTURE_2D", "CULL_FACE", "BLEND", "DITHER", "STENCIL_TEST", "DEPTH_TEST", "SCISSOR_TEST",
    325 							 "POLYGON_OFFSET_FILL", "SAMPLE_ALPHA_TO_COVERAGE", "SAMPLE_COVERAGE",
    326 							 "PRIMITIVE_RESTART_FIXED_INDEX", "RASTERIZER_DISCARD",
    327 							 "FRAMEBUFFER_SRGB", "SAMPLE_SHADING", "DEPTH_CLAMP",
    328 							 "PRIMITIVE_RESTART", "SAMPLE_MASK", "DEBUG_OUTPUT", "DEBUG_OUTPUT_SYNCHRONOUS",
    329 							 "BLEND_ADVANCED_COHERENT_KHR"]),
    330 
    331 	# Indexed enable-disable bit
    332 	("IndexedEnableCap",	["BLEND"]),
    333 
    334 	# Polygon winding
    335 	("Winding",				["CW", "CCW"]),
    336 
    337 	# Hints
    338 	("HintMode",			["DONT_CARE", "FASTEST", "NICEST"]),
    339 	("Hint",				["GENERATE_MIPMAP_HINT"]),
    340 
    341 	# Stencil ops
    342 	("StencilOp",			["ZERO", "KEEP", "REPLACE", "INCR", "DECR", "INVERT", "INCR_WRAP", "DECR_WRAP"]),
    343 
    344 	# Shader type
    345 	("ShaderType",	[
    346 		"VERTEX_SHADER",
    347 		"FRAGMENT_SHADER",
    348 		"COMPUTE_SHADER",
    349 		"TESS_CONTROL_SHADER",
    350 		"TESS_EVALUATION_SHADER",
    351 		"GEOMETRY_SHADER",
    352 		]),
    353 
    354 	# Buffers
    355 	("Buffer",				["COLOR", "DEPTH", "STENCIL", "DEPTH_STENCIL"]),
    356 
    357 	# Invalidate buffer target
    358 	("InvalidateAttachment",["COLOR", "DEPTH", "STENCIL",
    359 							 "COLOR_ATTACHMENT0",
    360 							 "COLOR_ATTACHMENT1",
    361 							 "COLOR_ATTACHMENT2",
    362 							 "COLOR_ATTACHMENT3",
    363 							 "COLOR_ATTACHMENT4",
    364 							 "COLOR_ATTACHMENT5",
    365 							 "COLOR_ATTACHMENT6",
    366 							 "COLOR_ATTACHMENT7",
    367 							 "DEPTH_ATTACHMENT",
    368 							 "STENCIL_ATTACHMENT",
    369 							 "DEPTH_STENCIL_ATTACHMENT"]),
    370 
    371 	# Draw/ReadBuffer attachment
    372 	("DrawReadBuffer",		["COLOR", "DEPTH", "STENCIL", "BACK", "NONE",
    373 							 "COLOR_ATTACHMENT0",
    374 							 "COLOR_ATTACHMENT1",
    375 							 "COLOR_ATTACHMENT2",
    376 							 "COLOR_ATTACHMENT3",
    377 							 "COLOR_ATTACHMENT4",
    378 							 "COLOR_ATTACHMENT5",
    379 							 "COLOR_ATTACHMENT6",
    380 							 "COLOR_ATTACHMENT7",
    381 							 "DEPTH_ATTACHMENT",
    382 							 "STENCIL_ATTACHMENT",
    383 							 "DEPTH_STENCIL_ATTACHMENT"]),
    384 
    385 	# Textures
    386 	("TextureTarget",		["TEXTURE_1D",
    387 							 "TEXTURE_2D", "TEXTURE_CUBE_MAP",
    388 							 "TEXTURE_CUBE_MAP_POSITIVE_X", "TEXTURE_CUBE_MAP_NEGATIVE_X",
    389 							 "TEXTURE_CUBE_MAP_POSITIVE_Y", "TEXTURE_CUBE_MAP_NEGATIVE_Y",
    390 							 "TEXTURE_CUBE_MAP_POSITIVE_Z", "TEXTURE_CUBE_MAP_NEGATIVE_Z",
    391 							 "TEXTURE_3D", "TEXTURE_2D_ARRAY", "TEXTURE_2D_MULTISAMPLE",
    392 							 "TEXTURE_2D_MULTISAMPLE_ARRAY",
    393 							 "TEXTURE_BUFFER",
    394 							 "TEXTURE_CUBE_MAP_ARRAY"]),
    395 	("TextureParameter", [
    396 		"TEXTURE_WRAP_S",
    397 		"TEXTURE_WRAP_T",
    398 		"TEXTURE_WRAP_R",
    399 		"TEXTURE_BASE_LEVEL",
    400 		"TEXTURE_MAX_LEVEL",
    401 		"TEXTURE_COMPARE_MODE",
    402 		"TEXTURE_COMPARE_FUNC",
    403 		"TEXTURE_MAX_LOD",
    404 		"TEXTURE_MIN_LOD",
    405 		"TEXTURE_SWIZZLE_R",
    406 		"TEXTURE_SWIZZLE_G",
    407 		"TEXTURE_SWIZZLE_B",
    408 		"TEXTURE_SWIZZLE_A",
    409 		"TEXTURE_MIN_FILTER",
    410 		"TEXTURE_MAG_FILTER",
    411 		"DEPTH_STENCIL_TEXTURE_MODE",
    412 		"TEXTURE_SRGB_DECODE_EXT",
    413 		"TEXTURE_BORDER_COLOR",
    414 
    415 		# Gettable only
    416 		"TEXTURE_IMMUTABLE_LEVELS",
    417 		"TEXTURE_IMMUTABLE_FORMAT",
    418 		]),
    419 	("TextureLevelParameter", [
    420 		"TEXTURE_SAMPLES",
    421 		"TEXTURE_FIXED_SAMPLE_LOCATIONS",
    422 		"TEXTURE_WIDTH",
    423 		"TEXTURE_HEIGHT",
    424 		"TEXTURE_DEPTH",
    425 		"TEXTURE_INTERNAL_FORMAT",
    426 		"TEXTURE_RED_SIZE",
    427 		"TEXTURE_GREEN_SIZE",
    428 		"TEXTURE_BLUE_SIZE",
    429 		"TEXTURE_ALPHA_SIZE",
    430 		"TEXTURE_DEPTH_SIZE",
    431 		"TEXTURE_STENCIL_SIZE",
    432 		"TEXTURE_SHARED_SIZE",
    433 		"TEXTURE_RED_TYPE",
    434 		"TEXTURE_GREEN_TYPE",
    435 		"TEXTURE_BLUE_TYPE",
    436 		"TEXTURE_ALPHA_TYPE",
    437 		"TEXTURE_DEPTH_TYPE",
    438 		"TEXTURE_COMPRESSED",
    439 		"TEXTURE_BUFFER_DATA_STORE_BINDING",
    440 		"TEXTURE_BUFFER_OFFSET",
    441 		"TEXTURE_BUFFER_SIZE",
    442 		]),
    443 	("RepeatMode",			["REPEAT", "CLAMP_TO_EDGE", "MIRRORED_REPEAT", "CLAMP_TO_BORDER"]),
    444 	("TextureFilter",		["NEAREST", "LINEAR", "NEAREST_MIPMAP_NEAREST", "LINEAR_MIPMAP_NEAREST",
    445 							 "NEAREST_MIPMAP_LINEAR", "LINEAR_MIPMAP_LINEAR"]),
    446 	("TextureWrapMode",		["REPEAT", "CLAMP_TO_EDGE", "MIRRORED_REPEAT"]),
    447 	("TextureSwizzle",		["RED", "GREEN", "BLUE", "ALPHA", "ZERO", "ONE"]),
    448 	("TextureCompareMode",	["NONE", "COMPARE_REF_TO_TEXTURE"]),
    449 	("CubeMapFace",			["TEXTURE_CUBE_MAP_POSITIVE_X", "TEXTURE_CUBE_MAP_NEGATIVE_X",
    450 							 "TEXTURE_CUBE_MAP_POSITIVE_Y", "TEXTURE_CUBE_MAP_NEGATIVE_Y",
    451 							 "TEXTURE_CUBE_MAP_POSITIVE_Z", "TEXTURE_CUBE_MAP_NEGATIVE_Z"]),
    452 	("TextureDepthStencilMode",	["DEPTH_COMPONENT", "STENCIL_INDEX"]),
    453 	("PixelStoreParameter",	[
    454 		"UNPACK_ALIGNMENT",
    455 		"UNPACK_IMAGE_HEIGHT",
    456 		"UNPACK_ROW_LENGTH",
    457 		"UNPACK_SKIP_IMAGES",
    458 		"UNPACK_SKIP_ROWS",
    459 		"UNPACK_SKIP_PIXELS",
    460 		"PACK_ROW_LENGTH",
    461 		"PACK_SKIP_ROWS",
    462 		"PACK_SKIP_PIXELS"]),
    463 	("UncompressedTextureFormat", [
    464 		# GLES2 unsized formats
    465 		"LUMINANCE",
    466 		"LUMINANCE_ALPHA",
    467 		"ALPHA",
    468 		"RGB",
    469 		"RGBA",
    470 
    471 		# GLES2 sized formats
    472 		"RGBA4",
    473 		"RGB5_A1",
    474 		"RGB565",
    475 		"DEPTH_COMPONENT16",
    476 		"STENCIL_INDEX8",
    477 
    478 		# GLES3 unsized formats
    479 		"RG",
    480 		"RED",
    481 		"RGBA_INTEGER",
    482 		"RGB_INTEGER",
    483 		"RG_INTEGER",
    484 		"RED_INTEGER",
    485 		"DEPTH_COMPONENT",
    486 		"DEPTH_STENCIL",
    487 
    488 		# GLES3 sized formats
    489 		"RGBA32F",
    490 		"RGBA32I",
    491 		"RGBA32UI",
    492 		"RGBA16",
    493 		"RGBA16_SNORM",
    494 		"RGBA16F",
    495 		"RGBA16I",
    496 		"RGBA16UI",
    497 		"RGBA8",
    498 		"RGBA8I",
    499 		"RGBA8UI",
    500 		"SRGB8_ALPHA8",
    501 		"RGB10_A2",
    502 		"RGB10_A2UI",
    503 		"RGBA8_SNORM",
    504 		"RGB8",
    505 		"R11F_G11F_B10F",
    506 		"RGB32F",
    507 		"RGB32I",
    508 		"RGB32UI",
    509 		"RGB16",
    510 		"RGB16_SNORM",
    511 		"RGB16F",
    512 		"RGB16I",
    513 		"RGB16UI",
    514 		"RGB8_SNORM",
    515 		"RGB8I",
    516 		"RGB8UI",
    517 		"SRGB8",
    518 		"RGB9_E5",
    519 		"RG32F",
    520 		"RG32I",
    521 		"RG32UI",
    522 		"RG16",
    523 		"RG16_SNORM",
    524 		"RG16F",
    525 		"RG16I",
    526 		"RG16UI",
    527 		"RG8",
    528 		"RG8I",
    529 		"RG8UI",
    530 		"RG8_SNORM",
    531 		"R32F",
    532 		"R32I",
    533 		"R32UI",
    534 		"R16",
    535 		"R16_SNORM",
    536 		"R16F",
    537 		"R16I",
    538 		"R16UI",
    539 		"R8",
    540 		"R8I",
    541 		"R8UI",
    542 		"R8_SNORM",
    543 		"DEPTH_COMPONENT32F",
    544 		"DEPTH_COMPONENT24",
    545 		"DEPTH32F_STENCIL8",
    546 		"DEPTH24_STENCIL8",
    547 
    548 		# OES_required_internalformat
    549 		"RGB10",
    550 
    551 		# OES_depth32
    552 		"DEPTH_COMPONENT32",
    553 
    554 		# EXT_sRGB
    555 		"SRGB",
    556 		"SRGB_ALPHA",
    557 
    558 		# GL_EXT_texture_sRGB_R8 & RG8
    559 		"SR8_EXT",
    560 		"SRG8_EXT",
    561 
    562 		# GL_EXT_read_format_bgra
    563 		"BGRA",
    564 		]),
    565 
    566 	("CompressedTextureFormat", [
    567 		# ETC2/EAC formats
    568 		"COMPRESSED_R11_EAC",
    569 		"COMPRESSED_SIGNED_R11_EAC",
    570 		"COMPRESSED_RG11_EAC",
    571 		"COMPRESSED_SIGNED_RG11_EAC",
    572 		"COMPRESSED_RGB8_ETC2",
    573 		"COMPRESSED_SRGB8_ETC2",
    574 		"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",
    575 		"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",
    576 		"COMPRESSED_RGBA8_ETC2_EAC",
    577 		"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",
    578 
    579 		# ASTC formats
    580 		"COMPRESSED_RGBA_ASTC_4x4_KHR",
    581 		"COMPRESSED_RGBA_ASTC_5x4_KHR",
    582 		"COMPRESSED_RGBA_ASTC_5x5_KHR",
    583 		"COMPRESSED_RGBA_ASTC_6x5_KHR",
    584 		"COMPRESSED_RGBA_ASTC_6x6_KHR",
    585 		"COMPRESSED_RGBA_ASTC_8x5_KHR",
    586 		"COMPRESSED_RGBA_ASTC_8x6_KHR",
    587 		"COMPRESSED_RGBA_ASTC_8x8_KHR",
    588 		"COMPRESSED_RGBA_ASTC_10x5_KHR",
    589 		"COMPRESSED_RGBA_ASTC_10x6_KHR",
    590 		"COMPRESSED_RGBA_ASTC_10x8_KHR",
    591 		"COMPRESSED_RGBA_ASTC_10x10_KHR",
    592 		"COMPRESSED_RGBA_ASTC_12x10_KHR",
    593 		"COMPRESSED_RGBA_ASTC_12x12_KHR",
    594 		"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",
    595 		"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",
    596 		"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",
    597 		"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",
    598 		"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",
    599 		"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",
    600 		"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",
    601 		"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",
    602 		"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",
    603 		"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",
    604 		"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",
    605 		"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",
    606 		"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",
    607 		"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",
    608 
    609 		# EXT_texture_compression_s3tc
    610 		"COMPRESSED_RGB_S3TC_DXT1_EXT",
    611 		"COMPRESSED_RGBA_S3TC_DXT1_EXT",
    612 		"COMPRESSED_RGBA_S3TC_DXT3_EXT",
    613 		"COMPRESSED_RGBA_S3TC_DXT5_EXT",
    614 
    615 		# IMG_texture_compression_pvrtc
    616 		"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",
    617 		"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",
    618 		"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",
    619 		"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",
    620 		]),
    621 
    622 	# Shader var type
    623 	("ShaderVarType", [
    624 		"FLOAT",
    625 		"FLOAT_VEC2",
    626 		"FLOAT_VEC3",
    627 		"FLOAT_VEC4",
    628 		"INT",
    629 		"INT_VEC2",
    630 		"INT_VEC3",
    631 		"INT_VEC4",
    632 		"UNSIGNED_INT",
    633 		"UNSIGNED_INT_VEC2",
    634 		"UNSIGNED_INT_VEC3",
    635 		"UNSIGNED_INT_VEC4",
    636 		"BOOL",
    637 		"BOOL_VEC2",
    638 		"BOOL_VEC3",
    639 		"BOOL_VEC4",
    640 		"FLOAT_MAT2",
    641 		"FLOAT_MAT3",
    642 		"FLOAT_MAT4",
    643 		"FLOAT_MAT2x3",
    644 		"FLOAT_MAT2x4",
    645 		"FLOAT_MAT3x2",
    646 		"FLOAT_MAT3x4",
    647 		"FLOAT_MAT4x2",
    648 		"FLOAT_MAT4x3",
    649 		"SAMPLER_2D",
    650 		"SAMPLER_3D",
    651 		"SAMPLER_CUBE",
    652 		"SAMPLER_2D_SHADOW",
    653 		"SAMPLER_2D_ARRAY",
    654 		"SAMPLER_2D_ARRAY_SHADOW",
    655 		"SAMPLER_CUBE_SHADOW",
    656 		"INT_SAMPLER_2D",
    657 		"INT_SAMPLER_3D",
    658 		"INT_SAMPLER_CUBE",
    659 		"INT_SAMPLER_2D_ARRAY",
    660 		"UNSIGNED_INT_SAMPLER_2D",
    661 		"UNSIGNED_INT_SAMPLER_3D",
    662 		"UNSIGNED_INT_SAMPLER_CUBE",
    663 		"UNSIGNED_INT_SAMPLER_2D_ARRAY",
    664 		"SAMPLER_2D_MULTISAMPLE",
    665 		"INT_SAMPLER_2D_MULTISAMPLE",
    666 		"UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE",
    667 		"IMAGE_2D",
    668 		"IMAGE_3D",
    669 		"IMAGE_CUBE",
    670 		"IMAGE_2D_ARRAY",
    671 		"INT_IMAGE_2D",
    672 		"INT_IMAGE_3D",
    673 		"INT_IMAGE_CUBE",
    674 		"INT_IMAGE_2D_ARRAY",
    675 		"UNSIGNED_INT_IMAGE_2D",
    676 		"UNSIGNED_INT_IMAGE_3D",
    677 		"UNSIGNED_INT_IMAGE_CUBE",
    678 		"UNSIGNED_INT_IMAGE_2D_ARRAY",
    679 		"UNSIGNED_INT_ATOMIC_COUNTER",
    680 		"SAMPLER_2D_MULTISAMPLE_ARRAY",
    681 		"INT_SAMPLER_2D_MULTISAMPLE_ARRAY",
    682 		"UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY",
    683 		"SAMPLER_BUFFER",
    684 		"INT_SAMPLER_BUFFER",
    685 		"UNSIGNED_INT_SAMPLER_BUFFER",
    686 		"IMAGE_BUFFER",
    687 		"INT_IMAGE_BUFFER",
    688 		"UNSIGNED_INT_IMAGE_BUFFER",
    689 		"SAMPLER_CUBE_MAP_ARRAY",
    690 		"SAMPLER_CUBE_MAP_ARRAY_SHADOW",
    691 		"INT_SAMPLER_CUBE_MAP_ARRAY",
    692 		"UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY",
    693 		"IMAGE_CUBE_MAP_ARRAY",
    694 		"INT_IMAGE_CUBE_MAP_ARRAY",
    695 		"UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY",
    696 	]),
    697 
    698 	# Shader params
    699 	("ShaderParam", [ "SHADER_TYPE", "DELETE_STATUS", "COMPILE_STATUS", "INFO_LOG_LENGTH", "SHADER_SOURCE_LENGTH"]),
    700 
    701 	# Vertex attribute queries
    702 	("VertexAttribParameterName", [
    703 		"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",
    704 		"VERTEX_ATTRIB_ARRAY_ENABLED",
    705 		"VERTEX_ATTRIB_ARRAY_SIZE",
    706 		"VERTEX_ATTRIB_ARRAY_STRIDE",
    707 		"VERTEX_ATTRIB_ARRAY_TYPE",
    708 		"VERTEX_ATTRIB_ARRAY_NORMALIZED",
    709 		"VERTEX_ATTRIB_ARRAY_INTEGER",
    710 		"VERTEX_ATTRIB_ARRAY_DIVISOR",
    711 		"CURRENT_VERTEX_ATTRIB",
    712 		"VERTEX_ATTRIB_BINDING",
    713 		"VERTEX_ATTRIB_RELATIVE_OFFSET",
    714 	]),
    715 
    716 	("Boolean", ["FALSE", "TRUE"]),
    717 
    718 	# GetPName
    719 	("GettableState", [
    720 		"ELEMENT_ARRAY_BUFFER_BINDING",				"ARRAY_BUFFER_BINDING",						"VERTEX_ARRAY_BINDING",								"VIEWPORT",									"DEPTH_RANGE",
    721 		"TRANSFORM_FEEDBACK_BINDING",				"LINE_WIDTH",								"CULL_FACE_MODE",									"FRONT_FACE",								"POLYGON_OFFSET_FACTOR",
    722 		"POLYGON_OFFSET_UNITS",						"SAMPLE_COVERAGE_VALUE",					"SAMPLE_COVERAGE_INVERT",							"ACTIVE_TEXTURE",							"TEXTURE_BINDING_1D",
    723 		"TEXTURE_BINDING_2D",						"TEXTURE_BINDING_3D",						"TEXTURE_BINDING_2D_ARRAY",
    724 		"TEXTURE_BINDING_CUBE_MAP",					"SAMPLER_BINDING",							"SCISSOR_BOX",										"STENCIL_FUNC",								"STENCIL_VALUE_MASK",
    725 		"STENCIL_REF",								"STENCIL_FAIL",								"STENCIL_PASS_DEPTH_FAIL",							"STENCIL_PASS_DEPTH_PASS",					"STENCIL_BACK_FUNC",
    726 		"STENCIL_BACK_VALUE_MASK",					"STENCIL_BACK_REF",							"STENCIL_BACK_FAIL",								"STENCIL_BACK_PASS_DEPTH_FAIL",				"STENCIL_BACK_PASS_DEPTH_PASS",
    727 		"DEPTH_FUNC",								"BLEND_SRC_RGB",							"BLEND_SRC_ALPHA",									"BLEND_DST_RGB",							"BLEND_DST_ALPHA",
    728 		"BLEND_EQUATION_RGB",						"BLEND_EQUATION_ALPHA",						"BLEND_COLOR",										"COLOR_WRITEMASK",							"DEPTH_WRITEMASK",
    729 		"STENCIL_WRITEMASK",						"STENCIL_BACK_WRITEMASK",					"COLOR_CLEAR_VALUE",								"DEPTH_CLEAR_VALUE",						"STENCIL_CLEAR_VALUE",
    730 		"DRAW_FRAMEBUFFER_BINDING",					"READ_FRAMEBUFFER_BINDING",					"RENDERBUFFER_BINDING",								"DRAW_BUFFER0",								"DRAW_BUFFER1",
    731 		"DRAW_BUFFER2",								"DRAW_BUFFER3",								"DRAW_BUFFER4",										"DRAW_BUFFER5",								"DRAW_BUFFER6",
    732 		"DRAW_BUFFER7",								"DRAW_BUFFER8",								"DRAW_BUFFER9",										"DRAW_BUFFER10",							"DRAW_BUFFER11",
    733 		"DRAW_BUFFER12",							"DRAW_BUFFER13",							"DRAW_BUFFER14",									"DRAW_BUFFER15",							"READ_BUFFER",
    734 		"UNPACK_IMAGE_HEIGHT",						"UNPACK_SKIP_IMAGES",						"UNPACK_ROW_LENGTH",								"UNPACK_SKIP_ROWS",							"UNPACK_SKIP_PIXELS",
    735 		"UNPACK_ALIGNMENT",							"PACK_ROW_LENGTH",							"PACK_SKIP_ROWS",									"PACK_SKIP_PIXELS",							"PACK_ALIGNMENT",
    736 		"PIXEL_PACK_BUFFER_BINDING",				"PIXEL_UNPACK_BUFFER_BINDING",				"CURRENT_PROGRAM",									"TRANSFORM_FEEDBACK_BUFFER_BINDING",		"TRANSFORM_FEEDBACK_PAUSED",
    737 		"TRANSFORM_FEEDBACK_ACTIVE",				"UNIFORM_BUFFER_BINDING",					"GENERATE_MIPMAP_HINT",								"FRAGMENT_SHADER_DERIVATIVE_HINT",			"MAX_ELEMENT_INDEX",
    738 		"SUBPIXEL_BITS",							"MAX_3D_TEXTURE_SIZE",						"MAX_TEXTURE_SIZE",									"MAX_ARRAY_TEXTURE_LAYERS",					"MAX_TEXTURE_LOD_BIAS",
    739 		"MAX_CUBE_MAP_TEXTURE_SIZE",				"MAX_RENDERBUFFER_SIZE",					"MAX_DRAW_BUFFERS",									"MAX_COLOR_ATTACHMENTS",					"MAX_VIEWPORT_DIMS",
    740 		"ALIASED_POINT_SIZE_RANGE",					"ALIASED_LINE_WIDTH_RANGE",					"MAX_ELEMENTS_INDICES",								"MAX_ELEMENTS_VERTICES",					"COMPRESSED_TEXTURE_FORMATS",
    741 		"NUM_COMPRESSED_TEXTURE_FORMATS",			"PROGRAM_BINARY_FORMATS",					"NUM_PROGRAM_BINARY_FORMATS",						"SHADER_BINARY_FORMATS",					"NUM_SHADER_BINARY_FORMATS",
    742 		"SHADER_COMPILER",							"MAX_SERVER_WAIT_TIMEOUT",					"NUM_EXTENSIONS",									"MAJOR_VERSION",							"MINOR_VERSION",
    743 		"MAX_VERTEX_ATTRIBS",						"MAX_VERTEX_UNIFORM_COMPONENTS",			"MAX_VERTEX_UNIFORM_VECTORS",						"MAX_VERTEX_UNIFORM_BLOCKS",				"MAX_VERTEX_OUTPUT_COMPONENTS",
    744 		"MAX_VERTEX_TEXTURE_IMAGE_UNITS",			"MAX_FRAGMENT_UNIFORM_COMPONENTS",			"MAX_FRAGMENT_UNIFORM_VECTORS",						"MAX_FRAGMENT_UNIFORM_BLOCKS",				"MAX_FRAGMENT_INPUT_COMPONENTS",
    745 		"MAX_TEXTURE_IMAGE_UNITS",					"MIN_PROGRAM_TEXEL_OFFSET",					"MAX_PROGRAM_TEXEL_OFFSET",							"MAX_UNIFORM_BUFFER_BINDINGS",				"MAX_UNIFORM_BLOCK_SIZE",
    746 		"UNIFORM_BUFFER_OFFSET_ALIGNMENT",			"MAX_COMBINED_UNIFORM_BLOCKS",				"MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",			"MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",	"MAX_VARYING_COMPONENTS",
    747 		"MAX_VARYING_VECTORS",						"MAX_COMBINED_TEXTURE_IMAGE_UNITS",			"MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",	"MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",	"MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
    748 		"SAMPLE_BUFFERS",							"SAMPLES",									"MAX_SAMPLES",										"DEPTH_BITS",								"STENCIL_BITS",
    749 		"IMPLEMENTATION_COLOR_READ_TYPE",			"IMPLEMENTATION_COLOR_READ_FORMAT",			"COPY_READ_BUFFER_BINDING",							"COPY_WRITE_BUFFER_BINDING",				"RED_BITS",
    750 		"GREEN_BITS",								"BLUE_BITS",								"ALPHA_BITS",										"MAX_COLOR_TEXTURE_SAMPLES",				"TIMESTAMP",
    751 		"MAX_DEPTH_TEXTURE_SAMPLES",				"MAX_INTEGER_SAMPLES",						"TEXTURE_BINDING_2D_MULTISAMPLE",					"TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY",		"MAX_VERTEX_ATTRIB_STRIDE",
    752 		"MAX_VERTEX_ATTRIB_BINDINGS",				"MAX_VERTEX_ATTRIB_RELATIVE_OFFSET",		"MIN_SAMPLE_SHADING_VALUE",							"FRAGMENT_INTERPOLATION_OFFSET_BITS",		"MAX_FRAGMENT_INTERPOLATION_OFFSET",
    753 		"MIN_FRAGMENT_INTERPOLATION_OFFSET",		"MAX_GEOMETRY_SHADER_INVOCATIONS",			"LAYER_PROVOKING_VERTEX",							"MAX_GEOMETRY_UNIFORM_COMPONENTS",			"MAX_GEOMETRY_SHADER_STORAGE_BLOCKS",
    754 		"MAX_GEOMETRY_UNIFORM_BLOCKS",				"MAX_GEOMETRY_INPUT_COMPONENTS",			"MAX_GEOMETRY_OUTPUT_COMPONENTS",					"MAX_GEOMETRY_IMAGE_UNIFORMS",				"MAX_GEOMETRY_TEXTURE_IMAGE_UNITS",
    755 		"MAX_GEOMETRY_OUTPUT_VERTICES",				"MAX_GEOMETRY_ATOMIC_COUNTERS",				"MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS",				"MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS",		"MAX_FRAMEBUFFER_LAYERS",
    756 		"PROVOKING_VERTEX",							"PRIMITIVE_RESTART_INDEX",					"MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS",				"MAX_FRAGMENT_ATOMIC_COUNTERS",				"MAX_FRAGMENT_IMAGE_UNIFORMS",
    757 		"MAX_COMPUTE_UNIFORM_BLOCKS",				"MAX_COMPUTE_TEXTURE_IMAGE_UNITS",			"MAX_COMPUTE_UNIFORM_COMPONENTS",					"MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS",		"MAX_COMPUTE_ATOMIC_COUNTERS",
    758 		"MAX_COMPUTE_IMAGE_UNIFORMS",				"MAX_COMPUTE_SHADER_STORAGE_BLOCKS",		"MAX_FRAGMENT_SHADER_STORAGE_BLOCKS",				"MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS",	"MAX_VERTEX_ATOMIC_COUNTER_BUFFERS",
    759 		"MAX_VERTEX_ATOMIC_COUNTERS",				"MAX_VERTEX_IMAGE_UNIFORMS",				"MAX_VERTEX_SHADER_STORAGE_BLOCKS",					"MAX_COMBINED_SHADER_OUTPUT_RESOURCES",		"MAX_ATOMIC_COUNTER_BUFFER_BINDINGS",
    760 		"MAX_ATOMIC_COUNTER_BUFFER_SIZE",			"MAX_IMAGE_UNITS",							"MAX_COMBINED_ATOMIC_COUNTER_BUFFERS",				"MAX_COMBINED_IMAGE_UNIFORMS",				"MAX_SHADER_STORAGE_BUFFER_BINDINGS",
    761 		"MAX_SHADER_STORAGE_BLOCK_SIZE",			"MAX_COMBINED_ATOMIC_COUNTERS",				"MAX_COMBINED_SHADER_STORAGE_BLOCKS",				"SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT",	"PRIMITIVE_BOUNDING_BOX_EXT",
    762 		"DRAW_INDIRECT_BUFFER_BINDING",				"MAX_SAMPLE_MASK_WORDS",					"PROGRAM_PIPELINE_BINDING",							"ATOMIC_COUNTER_BUFFER_BINDING",			"SHADER_STORAGE_BUFFER_BINDING",
    763 		"DISPATCH_INDIRECT_BUFFER_BINDING",			"MAX_FRAMEBUFFER_WIDTH",					"MAX_FRAMEBUFFER_HEIGHT",							"MAX_FRAMEBUFFER_SAMPLES",					"MAX_COMPUTE_SHARED_MEMORY_SIZE",
    764 		"MIN_PROGRAM_TEXTURE_GATHER_OFFSET",		"MAX_PROGRAM_TEXTURE_GATHER_OFFSET",		"MAX_COMPUTE_WORK_GROUP_INVOCATIONS",				"MAX_UNIFORM_LOCATIONS",					"MAX_DEBUG_MESSAGE_LENGTH",
    765 		"MAX_DEBUG_LOGGED_MESSAGES",				"MAX_DEBUG_GROUP_STACK_DEPTH",				"MAX_LABEL_LENGTH",									"CONTEXT_FLAGS",							"DEBUG_LOGGED_MESSAGES",
    766 		"DEBUG_NEXT_LOGGED_MESSAGE_LENGTH",			"DEBUG_GROUP_STACK_DEPTH",					"MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS",			"TEXTURE_BUFFER_OFFSET_ALIGNMENT",			"TEXTURE_BUFFER_BINDING",
    767 		"TEXTURE_BINDING_BUFFER",					"MAX_TEXTURE_BUFFER_SIZE",					"MAX_PATCH_VERTICES",								"MAX_TESS_GEN_LEVEL",						"MAX_TESS_CONTROL_UNIFORM_COMPONENTS",
    768 		"MAX_TESS_EVALUATION_UNIFORM_COMPONENTS",	"MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS",		"MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS",			"MAX_TESS_CONTROL_OUTPUT_COMPONENTS",		"MAX_TESS_PATCH_COMPONENTS",
    769 		"MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS",	"MAX_TESS_EVALUATION_OUTPUT_COMPONENTS",	"MAX_TESS_CONTROL_UNIFORM_BLOCKS",					"MAX_TESS_EVALUATION_UNIFORM_BLOCKS",		"MAX_TESS_CONTROL_INPUT_COMPONENTS",
    770 		"MAX_TESS_EVALUATION_INPUT_COMPONENTS",		"MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS",	"MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS",		"MAX_TESS_CONTROL_ATOMIC_COUNTERS",			"MAX_TESS_EVALUATION_ATOMIC_COUNTERS",
    771 		"MAX_TESS_CONTROL_IMAGE_UNIFORMS",			"MAX_TESS_EVALUATION_IMAGE_UNIFORMS",		"MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS",	"MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS","MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS",
    772 		"MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS",	"PATCH_VERTICES",							"PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED"
    773 	]),
    774 
    775 	("GettableIndexedState", [
    776 		"TRANSFORM_FEEDBACK_BUFFER_BINDING",
    777 		"UNIFORM_BUFFER_BINDING",
    778 		"TRANSFORM_FEEDBACK_BUFFER_START",
    779 		"TRANSFORM_FEEDBACK_BUFFER_SIZE",
    780 		"UNIFORM_BUFFER_START",
    781 		"UNIFORM_BUFFER_SIZE",
    782 		"SAMPLE_MASK_VALUE",
    783 		"VERTEX_BINDING_OFFSET",
    784 		"VERTEX_BINDING_STRIDE",
    785 		"VERTEX_BINDING_DIVISOR",
    786 		"VERTEX_BINDING_BUFFER",
    787 		"MAX_COMPUTE_WORK_GROUP_COUNT",
    788 		"MAX_COMPUTE_WORK_GROUP_SIZE",
    789 		"ATOMIC_COUNTER_BUFFER_BINDING",
    790 		"ATOMIC_COUNTER_BUFFER_START",
    791 		"ATOMIC_COUNTER_BUFFER_SIZE",
    792 		"SHADER_STORAGE_BUFFER_BINDING",
    793 		"SHADER_STORAGE_BUFFER_START",
    794 		"SHADER_STORAGE_BUFFER_SIZE",
    795 		"IMAGE_BINDING_NAME",
    796 		"IMAGE_BINDING_LEVEL",
    797 		"IMAGE_BINDING_LAYERED",
    798 		"IMAGE_BINDING_LAYER",
    799 		"IMAGE_BINDING_ACCESS",
    800 		"IMAGE_BINDING_FORMAT",
    801 		"BLEND_EQUATION_RGB",
    802 		"BLEND_EQUATION_ALPHA",
    803 		"BLEND_SRC_RGB",
    804 		"BLEND_SRC_ALPHA",
    805 		"BLEND_DST_RGB",
    806 		"BLEND_DST_ALPHA",
    807 		"COLOR_WRITEMASK",
    808 	]),
    809 
    810 	("GettableString", [
    811 		"EXTENSIONS",
    812 		"RENDERER",
    813 		"SHADING_LANGUAGE_VERSION",
    814 		"VENDOR",
    815 		"VERSION"
    816 	]),
    817 
    818 	("PointerState", [
    819 		"DEBUG_CALLBACK_FUNCTION",
    820 		"DEBUG_CALLBACK_USER_PARAM",
    821 	]),
    822 
    823 	("InternalFormatParameter", ["NUM_SAMPLE_COUNTS", "SAMPLES"]),
    824 	("InternalFormatTarget", [
    825 		"RENDERBUFFER",
    826 		"TEXTURE_2D_MULTISAMPLE",
    827 		"TEXTURE_2D_MULTISAMPLE_ARRAY",
    828 		"TEXTURE_2D",
    829 		"TEXTURE_3D",
    830 		"TEXTURE_2D_ARRAY",
    831 		"TEXTURE_CUBE_MAP",
    832 	]),
    833 
    834 	("MultisampleParameter", ["SAMPLE_POSITION"]),
    835 
    836 	# Occlusion and timer queries
    837 	("QueryTarget", [
    838 		"SAMPLES_PASSED",
    839 		"ANY_SAMPLES_PASSED",
    840 		"PRIMITIVES_GENERATED",
    841 		"TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
    842 		"TIME_ELAPSED",
    843 	]),
    844 
    845 	("QueryParam",			["CURRENT_QUERY", "QUERY_COUNTER_BITS"]),
    846 	("QueryObjectParam",	["QUERY_RESULT", "QUERY_RESULT_AVAILABLE"]),
    847 
    848 	("ImageAccess", ["READ_ONLY", "WRITE_ONLY", "READ_WRITE"]),
    849 
    850 	("ProgramInterface", [
    851 		"UNIFORM",
    852 		"UNIFORM_BLOCK",
    853 		"ATOMIC_COUNTER_BUFFER",
    854 		"PROGRAM_INPUT",
    855 		"PROGRAM_OUTPUT",
    856 		"TRANSFORM_FEEDBACK_VARYING",
    857 		"BUFFER_VARIABLE",
    858 		"SHADER_STORAGE_BLOCK",
    859 	]),
    860 
    861 	("ProgramResourceProperty", [
    862 		"ACTIVE_VARIABLES",
    863 		"BUFFER_BINDING",
    864 		"NUM_ACTIVE_VARIABLES",
    865 		"ARRAY_SIZE",
    866 		"ARRAY_STRIDE",
    867 		"BLOCK_INDEX",
    868 		"IS_ROW_MAJOR",
    869 		"MATRIX_STRIDE",
    870 		"ATOMIC_COUNTER_BUFFER_INDEX",
    871 		"BUFFER_DATA_SIZE",
    872 		"LOCATION",
    873 		"NAME_LENGTH",
    874 		"OFFSET",
    875 		"REFERENCED_BY_VERTEX_SHADER",
    876 		"REFERENCED_BY_FRAGMENT_SHADER",
    877 		"REFERENCED_BY_COMPUTE_SHADER",
    878 		"REFERENCED_BY_GEOMETRY_SHADER",
    879 		"REFERENCED_BY_TESS_CONTROL_SHADER",
    880 		"REFERENCED_BY_TESS_EVALUATION_SHADER",
    881 		"TOP_LEVEL_ARRAY_SIZE",
    882 		"TOP_LEVEL_ARRAY_STRIDE",
    883 		"TYPE",
    884 		"IS_PER_PATCH",
    885 	]),
    886 
    887 	("PrecisionFormatType", ["LOW_FLOAT", "MEDIUM_FLOAT", "HIGH_FLOAT", "LOW_INT", "MEDIUM_INT", "HIGH_INT"]),
    888 
    889 	("TransformFeedbackTarget", ["TRANSFORM_FEEDBACK"]),
    890 
    891 	("ProvokingVertex", ["FIRST_VERTEX_CONVENTION", "LAST_VERTEX_CONVENTION", "UNDEFINED_VERTEX"]),
    892 
    893 	("DebugMessageSource", [
    894 		"DEBUG_SOURCE_API",
    895 		"DEBUG_SOURCE_WINDOW_SYSTEM",
    896 		"DEBUG_SOURCE_SHADER_COMPILER",
    897 		"DEBUG_SOURCE_THIRD_PARTY",
    898 		"DEBUG_SOURCE_APPLICATION",
    899 		"DEBUG_SOURCE_OTHER", "DONT_CARE"
    900 	]),
    901 	("DebugMessageType", [
    902 		"DEBUG_TYPE_ERROR",
    903 		"DEBUG_TYPE_DEPRECATED_BEHAVIOR",
    904 		"DEBUG_TYPE_UNDEFINED_BEHAVIOR",
    905 		"DEBUG_TYPE_PORTABILITY",
    906 		"DEBUG_TYPE_PERFORMANCE",
    907 		"DEBUG_TYPE_OTHER",
    908 		"DEBUG_TYPE_MARKER",
    909 		"DEBUG_TYPE_PUSH_GROUP",
    910 		"DEBUG_TYPE_POP_GROUP",
    911 		"DONT_CARE"
    912 	]),
    913 	("DebugMessageSeverity", [
    914 		"DEBUG_SEVERITY_HIGH",
    915 		"DEBUG_SEVERITY_MEDIUM",
    916 		"DEBUG_SEVERITY_LOW",
    917 		"DEBUG_SEVERITY_NOTIFICATION",
    918 		"DONT_CARE"
    919 	]),
    920 
    921 	# Pipeline query
    922 	("PipelineParam", [
    923 		"ACTIVE_PROGRAM",
    924 		"INFO_LOG_LENGTH",
    925 		"VALIDATE_STATUS",
    926 		"VERTEX_SHADER",
    927 		"FRAGMENT_SHADER",
    928 		"COMPUTE_SHADER",
    929 		"GEOMETRY_SHADER",
    930 		"TESS_CONTROL_SHADER",
    931 		"TESS_EVALUATION_SHADER",
    932 	]),
    933 
    934 	("PatchParam", [
    935 		"PATCH_VERTICES",
    936 	]),
    937 
    938 	("TextureFormat", [
    939 		# generated: UncompressedTextureFormat + CompressedTextureFormat
    940 	]),
    941 
    942 	# GraphicsResetStatus
    943 	("GraphicsResetStatus", [
    944 		"NO_ERROR",
    945 		"GUILTY_CONTEXT_RESET",
    946 		"INNOCENT_CONTEXT_RESET",
    947 		"UNKNOWN_CONTEXT_RESET",
    948 	]),
    949 ]
    950 
    951 def getEnumGroupByName (name):
    952 	# \note: will raise an (index out of bounds) error if no such group
    953 	return [x for x in ENUM_GROUPS if x[0]==name][0][1]
    954 
    955 # EnableCap EnumGroups are also GettableState EnumGroups
    956 getEnumGroupByName("GettableState").extend(getEnumGroupByName("EnableCap"))
    957 
    958 # TextureFormat = UncompressedTextureFormat + CompressedTextureFormat
    959 getEnumGroupByName("TextureFormat").extend(getEnumGroupByName("UncompressedTextureFormat") + getEnumGroupByName("CompressedTextureFormat"))
    960 
    961 def genStrUtil (iface):
    962 	enumGroups		= addValuePrefix(ENUM_GROUPS, "GL_")
    963 	bitfieldGroups	= addValuePrefix(BITFIELD_GROUPS, "GL_")
    964 	prototypeFile	= os.path.join(OPENGL_DIR, "gluStrUtilPrototypes.inl")
    965 	implFile		= os.path.join(OPENGL_DIR, "gluStrUtil.inl")
    966 
    967 	writeInlFile(prototypeFile, indentLines(genStrUtilProtos(iface, enumGroups, bitfieldGroups)))
    968 	writeInlFile(implFile, genStrUtilImpls(iface, enumGroups, bitfieldGroups))
    969 
    970 if __name__ == "__main__":
    971 	genStrUtil(getHybridInterface())
    972