Validate glClearBuffer*v function |buffer| param on the client side

Otherwise we could read out-of-bounds even if an invalid |buffer| is passed
in and in theory we should not read the buffer at all.

BUG=908749
TEST=gl_tests in ASAN build
R=piman@chromium.org

Change-Id: I94b69b56ce3358ff9bfc0e21f0618aec4371d1ec
Reviewed-on: https://chromium-review.googlesource.com/c/1354571
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612023}
int GLES2Util::GLGetNumValuesReturned(int id) const {
  switch (id) {
    case GL_ACTIVE_TEXTURE:
      return 1;
    case GL_ALIASED_LINE_WIDTH_RANGE:
      return 2;
    case GL_ALIASED_POINT_SIZE_RANGE:
      return 2;
    case GL_ALPHA_BITS:
      return 1;
    case GL_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_BLEND:
      return 1;
    case GL_BLEND_COLOR:
      return 4;
    case GL_BLEND_DST_ALPHA:
      return 1;
    case GL_BLEND_DST_RGB:
      return 1;
    case GL_BLEND_EQUATION_ALPHA:
      return 1;
    case GL_BLEND_EQUATION_RGB:
      return 1;
    case GL_BLEND_SRC_ALPHA:
      return 1;
    case GL_BLEND_SRC_RGB:
      return 1;
    case GL_BLUE_BITS:
      return 1;
    case GL_COLOR_CLEAR_VALUE:
      return 4;
    case GL_COLOR_WRITEMASK:
      return 4;
    case GL_COMPRESSED_TEXTURE_FORMATS:
      return num_compressed_texture_formats_;
    case GL_CULL_FACE:
      return 1;
    case GL_CULL_FACE_MODE:
      return 1;
    case GL_CURRENT_PROGRAM:
      return 1;
    case GL_DEPTH_BITS:
      return 1;
    case GL_DEPTH_CLEAR_VALUE:
      return 1;
    case GL_DEPTH_FUNC:
      return 1;
    case GL_DEPTH_RANGE:
      return 2;
    case GL_DEPTH_TEST:
      return 1;
    case GL_DEPTH_WRITEMASK:
      return 1;
    case GL_DITHER:
      return 1;
    case GL_ELEMENT_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_FRAMEBUFFER_BINDING:
      return 1;
    case GL_FRONT_FACE:
      return 1;
    case GL_GENERATE_MIPMAP_HINT:
      return 1;
    case GL_GREEN_BITS:
      return 1;
    case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
      return 1;
    case GL_IMPLEMENTATION_COLOR_READ_TYPE:
      return 1;
    case GL_LINE_WIDTH:
      return 1;
    case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
      return 1;
    case GL_MAX_RENDERBUFFER_SIZE:
      return 1;
    case GL_MAX_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_TEXTURE_SIZE:
      return 1;
    case GL_MAX_VARYING_VECTORS:
      return 1;
    case GL_MAX_VERTEX_ATTRIBS:
      return 1;
    case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_VECTORS:
      return 1;
    case GL_MAX_VIEWPORT_DIMS:
      return 2;
    case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
      return 1;
    case GL_NUM_SHADER_BINARY_FORMATS:
      return 1;
    case GL_PACK_ALIGNMENT:
      return 1;
    case GL_POLYGON_OFFSET_FACTOR:
      return 1;
    case GL_POLYGON_OFFSET_FILL:
      return 1;
    case GL_POLYGON_OFFSET_UNITS:
      return 1;
    case GL_RED_BITS:
      return 1;
    case GL_RENDERBUFFER_BINDING:
      return 1;
    case GL_SAMPLE_BUFFERS:
      return 1;
    case GL_SAMPLE_COVERAGE_INVERT:
      return 1;
    case GL_SAMPLE_COVERAGE_VALUE:
      return 1;
    case GL_SAMPLES:
      return 1;
    case GL_SCISSOR_BOX:
      return 4;
    case GL_SCISSOR_TEST:
      return 1;
    case GL_SHADER_BINARY_FORMATS:
      return num_shader_binary_formats_;
    case GL_SHADER_COMPILER:
      return 1;
    case GL_STENCIL_BACK_FAIL:
      return 1;
    case GL_STENCIL_BACK_FUNC:
      return 1;
    case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
      return 1;
    case GL_STENCIL_BACK_PASS_DEPTH_PASS:
      return 1;
    case GL_STENCIL_BACK_REF:
      return 1;
    case GL_STENCIL_BACK_VALUE_MASK:
      return 1;
    case GL_STENCIL_BACK_WRITEMASK:
      return 1;
    case GL_STENCIL_BITS:
      return 1;
    case GL_STENCIL_CLEAR_VALUE:
      return 1;
    case GL_STENCIL_FAIL:
      return 1;
    case GL_STENCIL_FUNC:
      return 1;
    case GL_STENCIL_PASS_DEPTH_FAIL:
      return 1;
    case GL_STENCIL_PASS_DEPTH_PASS:
      return 1;
    case GL_STENCIL_REF:
      return 1;
    case GL_STENCIL_TEST:
      return 1;
    case GL_STENCIL_VALUE_MASK:
      return 1;
    case GL_STENCIL_WRITEMASK:
      return 1;
    case GL_SUBPIXEL_BITS:
      return 1;
    case GL_TEXTURE_BINDING_2D:
      return 1;
    case GL_TEXTURE_BINDING_CUBE_MAP:
      return 1;
    case GL_TEXTURE_BINDING_EXTERNAL_OES:
      return 1;
    case GL_TEXTURE_BINDING_RECTANGLE_ARB:
      return 1;
    case GL_UNPACK_ALIGNMENT:
      return 1;
    case GL_VIEWPORT:
      return 4;

    case GL_COPY_READ_BUFFER_BINDING:
      return 1;
    case GL_COPY_WRITE_BUFFER_BINDING:
      return 1;
    case GL_MAX_3D_TEXTURE_SIZE:
      return 1;
    case GL_MAX_ARRAY_TEXTURE_LAYERS:
      return 1;
    case GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_COMBINED_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_ELEMENT_INDEX:
      return 1;
    case GL_MAX_ELEMENTS_INDICES:
      return 1;
    case GL_MAX_ELEMENTS_VERTICES:
      return 1;
    case GL_MAX_FRAGMENT_INPUT_COMPONENTS:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_PROGRAM_TEXEL_OFFSET:
      return 1;
    case GL_MAX_SERVER_WAIT_TIMEOUT:
      return 1;
    case GL_MAX_TEXTURE_LOD_BIAS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
      return 1;
    case GL_MAX_UNIFORM_BLOCK_SIZE:
      return 1;
    case GL_MAX_UNIFORM_BUFFER_BINDINGS:
      return 1;
    case GL_MAX_VARYING_COMPONENTS:
      return 1;
    case GL_MAX_VERTEX_OUTPUT_COMPONENTS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_COMPONENTS:
      return 1;
    case GL_MIN_PROGRAM_TEXEL_OFFSET:
      return 1;
    case GL_PIXEL_PACK_BUFFER_BINDING:
      return 1;
    case GL_PIXEL_UNPACK_BUFFER_BINDING:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_START:
      return 1;
    case GL_UNIFORM_BUFFER_BINDING:
      return 1;
    case GL_UNIFORM_BUFFER_SIZE:
      return 1;
    case GL_UNIFORM_BUFFER_START:
      return 1;
    case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
      return 1;

    case GL_ATOMIC_COUNTER_BUFFER_BINDING:
      return 1;
    case GL_ATOMIC_COUNTER_BUFFER_SIZE:
      return 1;
    case GL_ATOMIC_COUNTER_BUFFER_START:
      return 1;
    case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
      return 1;
    case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_BINDING:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_SIZE:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_START:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
      return 1;

    case GL_MAX_SAMPLES_EXT:
      return 1;
    case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
      return 1;

    case GL_WINDOW_RECTANGLE_MODE_EXT:
      return 1;
    case GL_MAX_WINDOW_RECTANGLES_EXT:
      return 1;
    case GL_NUM_WINDOW_RECTANGLES_EXT:
      return 1;

    case GL_BUFFER_SIZE:
      return 1;
    case GL_BUFFER_USAGE:
      return 1;

    case GL_BUFFER_MAPPED:
      return 1;
    case GL_BUFFER_ACCESS_FLAGS:
      return 1;
    case GL_BUFFER_MAP_LENGTH:
      return 1;
    case GL_BUFFER_MAP_OFFSET:
      return 1;

    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
      return 1;

    case GL_DELETE_STATUS:
      return 1;
    case GL_LINK_STATUS:
      return 1;
    case GL_VALIDATE_STATUS:
      return 1;
    case GL_INFO_LOG_LENGTH:
      return 1;
    case GL_ATTACHED_SHADERS:
      return 1;
    case GL_ACTIVE_ATTRIBUTES:
      return 1;
    case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
      return 1;
    case GL_ACTIVE_UNIFORMS:
      return 1;
    case GL_ACTIVE_UNIFORM_MAX_LENGTH:
      return 1;

    case GL_RENDERBUFFER_WIDTH:
      return 1;
    case GL_RENDERBUFFER_HEIGHT:
      return 1;
    case GL_RENDERBUFFER_INTERNAL_FORMAT:
      return 1;
    case GL_RENDERBUFFER_RED_SIZE:
      return 1;
    case GL_RENDERBUFFER_GREEN_SIZE:
      return 1;
    case GL_RENDERBUFFER_BLUE_SIZE:
      return 1;
    case GL_RENDERBUFFER_ALPHA_SIZE:
      return 1;
    case GL_RENDERBUFFER_DEPTH_SIZE:
      return 1;
    case GL_RENDERBUFFER_STENCIL_SIZE:
      return 1;
    case GL_RENDERBUFFER_SAMPLES_EXT:
      return 1;

    case GL_SHADER_TYPE:
      return 1;
    case GL_COMPILE_STATUS:
      return 1;
    case GL_SHADER_SOURCE_LENGTH:
      return 1;
    case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE:
      return 1;

    case GL_TEXTURE_MAG_FILTER:
      return 1;
    case GL_TEXTURE_MIN_FILTER:
      return 1;
    case GL_TEXTURE_WRAP_R:
      return 1;
    case GL_TEXTURE_WRAP_S:
      return 1;
    case GL_TEXTURE_WRAP_T:
      return 1;
    case GL_TEXTURE_COMPARE_FUNC:
      return 1;
    case GL_TEXTURE_COMPARE_MODE:
      return 1;
    case GL_TEXTURE_MAX_LOD:
      return 1;
    case GL_TEXTURE_MIN_LOD:
      return 1;
    case GL_TEXTURE_BASE_LEVEL:
      return 1;
    case GL_TEXTURE_MAX_LEVEL:
      return 1;
    case GL_TEXTURE_IMMUTABLE_FORMAT:
      return 1;
    case GL_TEXTURE_IMMUTABLE_LEVELS:
      return 1;
    case GL_TEXTURE_MAX_ANISOTROPY_EXT:
      return 1;
    case GL_TEXTURE_SWIZZLE_R:
      return 1;
    case GL_TEXTURE_SWIZZLE_G:
      return 1;
    case GL_TEXTURE_SWIZZLE_B:
      return 1;
    case GL_TEXTURE_SWIZZLE_A:
      return 1;

    case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_SIZE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_TYPE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
      return 1;
    case GL_CURRENT_VERTEX_ATTRIB:
      return 4;
    case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_DIVISOR:
      return 1;

    case GL_OBJECT_TYPE:
      return 1;
    case GL_SYNC_STATUS:
      return 1;
    case GL_SYNC_CONDITION:
      return 1;
    case GL_SYNC_FLAGS:
      return 1;

    case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
      return 1;

    case GL_BIND_GENERATES_RESOURCE_CHROMIUM:
      return 1;

    default:
      return 0;
  }
}

int GLES2Util::GLGetNumValuesReturned(int id) const {
  switch (id) {
    case GL_ACTIVE_TEXTURE:
      return 1;
    case GL_ALIASED_LINE_WIDTH_RANGE:
      return 2;
    case GL_ALIASED_POINT_SIZE_RANGE:
      return 2;
    case GL_ALPHA_BITS:
      return 1;
    case GL_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_BLEND:
      return 1;
    case GL_BLEND_COLOR:
      return 4;
    case GL_BLEND_DST_ALPHA:
      return 1;
    case GL_BLEND_DST_RGB:
      return 1;
    case GL_BLEND_EQUATION_ALPHA:
      return 1;
    case GL_BLEND_EQUATION_RGB:
      return 1;
    case GL_BLEND_SRC_ALPHA:
      return 1;
    case GL_BLEND_SRC_RGB:
      return 1;
    case GL_BLUE_BITS:
      return 1;
    case GL_COLOR_CLEAR_VALUE:
      return 4;
    case GL_COLOR_WRITEMASK:
      return 4;
    case GL_COMPRESSED_TEXTURE_FORMATS:
      return num_compressed_texture_formats_;
    case GL_CULL_FACE:
      return 1;
    case GL_CULL_FACE_MODE:
      return 1;
    case GL_CURRENT_PROGRAM:
      return 1;
    case GL_DEPTH_BITS:
      return 1;
    case GL_DEPTH_CLEAR_VALUE:
      return 1;
    case GL_DEPTH_FUNC:
      return 1;
    case GL_DEPTH_RANGE:
      return 2;
    case GL_DEPTH_TEST:
      return 1;
    case GL_DEPTH_WRITEMASK:
      return 1;
    case GL_DITHER:
      return 1;
    case GL_ELEMENT_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_FRAMEBUFFER_BINDING:
      return 1;
    case GL_FRONT_FACE:
      return 1;
    case GL_GENERATE_MIPMAP_HINT:
      return 1;
    case GL_GREEN_BITS:
      return 1;
    case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
      return 1;
    case GL_IMPLEMENTATION_COLOR_READ_TYPE:
      return 1;
    case GL_LINE_WIDTH:
      return 1;
    case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
      return 1;
    case GL_MAX_RENDERBUFFER_SIZE:
      return 1;
    case GL_MAX_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_TEXTURE_SIZE:
      return 1;
    case GL_MAX_VARYING_VECTORS:
      return 1;
    case GL_MAX_VERTEX_ATTRIBS:
      return 1;
    case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_VECTORS:
      return 1;
    case GL_MAX_VIEWPORT_DIMS:
      return 2;
    case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
      return 1;
    case GL_NUM_SHADER_BINARY_FORMATS:
      return 1;
    case GL_PACK_ALIGNMENT:
      return 1;
    case GL_POLYGON_OFFSET_FACTOR:
      return 1;
    case GL_POLYGON_OFFSET_FILL:
      return 1;
    case GL_POLYGON_OFFSET_UNITS:
      return 1;
    case GL_RED_BITS:
      return 1;
    case GL_RENDERBUFFER_BINDING:
      return 1;
    case GL_SAMPLE_BUFFERS:
      return 1;
    case GL_SAMPLE_COVERAGE_INVERT:
      return 1;
    case GL_SAMPLE_COVERAGE_VALUE:
      return 1;
    case GL_SAMPLES:
      return 1;
    case GL_SCISSOR_BOX:
      return 4;
    case GL_SCISSOR_TEST:
      return 1;
    case GL_SHADER_BINARY_FORMATS:
      return num_shader_binary_formats_;
    case GL_SHADER_COMPILER:
      return 1;
    case GL_STENCIL_BACK_FAIL:
      return 1;
    case GL_STENCIL_BACK_FUNC:
      return 1;
    case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
      return 1;
    case GL_STENCIL_BACK_PASS_DEPTH_PASS:
      return 1;
    case GL_STENCIL_BACK_REF:
      return 1;
    case GL_STENCIL_BACK_VALUE_MASK:
      return 1;
    case GL_STENCIL_BACK_WRITEMASK:
      return 1;
    case GL_STENCIL_BITS:
      return 1;
    case GL_STENCIL_CLEAR_VALUE:
      return 1;
    case GL_STENCIL_FAIL:
      return 1;
    case GL_STENCIL_FUNC:
      return 1;
    case GL_STENCIL_PASS_DEPTH_FAIL:
      return 1;
    case GL_STENCIL_PASS_DEPTH_PASS:
      return 1;
    case GL_STENCIL_REF:
      return 1;
    case GL_STENCIL_TEST:
      return 1;
    case GL_STENCIL_VALUE_MASK:
      return 1;
    case GL_STENCIL_WRITEMASK:
      return 1;
    case GL_SUBPIXEL_BITS:
      return 1;
    case GL_TEXTURE_BINDING_2D:
      return 1;
    case GL_TEXTURE_BINDING_CUBE_MAP:
      return 1;
    case GL_TEXTURE_BINDING_EXTERNAL_OES:
      return 1;
    case GL_TEXTURE_BINDING_RECTANGLE_ARB:
      return 1;
    case GL_UNPACK_ALIGNMENT:
      return 1;
    case GL_VIEWPORT:
      return 4;

    case GL_COPY_READ_BUFFER_BINDING:
      return 1;
    case GL_COPY_WRITE_BUFFER_BINDING:
      return 1;
    case GL_MAX_3D_TEXTURE_SIZE:
      return 1;
    case GL_MAX_ARRAY_TEXTURE_LAYERS:
      return 1;
    case GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_COMBINED_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_ELEMENT_INDEX:
      return 1;
    case GL_MAX_ELEMENTS_INDICES:
      return 1;
    case GL_MAX_ELEMENTS_VERTICES:
      return 1;
    case GL_MAX_FRAGMENT_INPUT_COMPONENTS:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:
      return 1;
    case GL_MAX_PROGRAM_TEXEL_OFFSET:
      return 1;
    case GL_MAX_SERVER_WAIT_TIMEOUT:
      return 1;
    case GL_MAX_TEXTURE_LOD_BIAS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
      return 1;
    case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
      return 1;
    case GL_MAX_UNIFORM_BLOCK_SIZE:
      return 1;
    case GL_MAX_UNIFORM_BUFFER_BINDINGS:
      return 1;
    case GL_MAX_VARYING_COMPONENTS:
      return 1;
    case GL_MAX_VERTEX_OUTPUT_COMPONENTS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_BLOCKS:
      return 1;
    case GL_MAX_VERTEX_UNIFORM_COMPONENTS:
      return 1;
    case GL_MIN_PROGRAM_TEXEL_OFFSET:
      return 1;
    case GL_PIXEL_PACK_BUFFER_BINDING:
      return 1;
    case GL_PIXEL_UNPACK_BUFFER_BINDING:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
      return 1;
    case GL_TRANSFORM_FEEDBACK_BUFFER_START:
      return 1;
    case GL_UNIFORM_BUFFER_BINDING:
      return 1;
    case GL_UNIFORM_BUFFER_SIZE:
      return 1;
    case GL_UNIFORM_BUFFER_START:
      return 1;
    case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
      return 1;

    case GL_ATOMIC_COUNTER_BUFFER_BINDING:
      return 1;
    case GL_ATOMIC_COUNTER_BUFFER_SIZE:
      return 1;
    case GL_ATOMIC_COUNTER_BUFFER_START:
      return 1;
    case GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:
      return 1;
    case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_BINDING:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_SIZE:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_START:
      return 1;
    case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
      return 1;

    case GL_MAX_SAMPLES_EXT:
      return 1;
    case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
      return 1;

    case GL_WINDOW_RECTANGLE_MODE_EXT:
      return 1;
    case GL_MAX_WINDOW_RECTANGLES_EXT:
      return 1;
    case GL_NUM_WINDOW_RECTANGLES_EXT:
      return 1;

    case GL_BUFFER_SIZE:
      return 1;
    case GL_BUFFER_USAGE:
      return 1;

    case GL_BUFFER_MAPPED:
      return 1;
    case GL_BUFFER_ACCESS_FLAGS:
      return 1;
    case GL_BUFFER_MAP_LENGTH:
      return 1;
    case GL_BUFFER_MAP_OFFSET:
      return 1;

    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
      return 1;
    case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
      return 1;

    case GL_DELETE_STATUS:
      return 1;
    case GL_LINK_STATUS:
      return 1;
    case GL_VALIDATE_STATUS:
      return 1;
    case GL_INFO_LOG_LENGTH:
      return 1;
    case GL_ATTACHED_SHADERS:
      return 1;
    case GL_ACTIVE_ATTRIBUTES:
      return 1;
    case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
      return 1;
    case GL_ACTIVE_UNIFORMS:
      return 1;
    case GL_ACTIVE_UNIFORM_MAX_LENGTH:
      return 1;

    case GL_RENDERBUFFER_WIDTH:
      return 1;
    case GL_RENDERBUFFER_HEIGHT:
      return 1;
    case GL_RENDERBUFFER_INTERNAL_FORMAT:
      return 1;
    case GL_RENDERBUFFER_RED_SIZE:
      return 1;
    case GL_RENDERBUFFER_GREEN_SIZE:
      return 1;
    case GL_RENDERBUFFER_BLUE_SIZE:
      return 1;
    case GL_RENDERBUFFER_ALPHA_SIZE:
      return 1;
    case GL_RENDERBUFFER_DEPTH_SIZE:
      return 1;
    case GL_RENDERBUFFER_STENCIL_SIZE:
      return 1;
    case GL_RENDERBUFFER_SAMPLES_EXT:
      return 1;

    case GL_SHADER_TYPE:
      return 1;
    case GL_COMPILE_STATUS:
      return 1;
    case GL_SHADER_SOURCE_LENGTH:
      return 1;
    case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE:
      return 1;

    case GL_TEXTURE_MAG_FILTER:
      return 1;
    case GL_TEXTURE_MIN_FILTER:
      return 1;
    case GL_TEXTURE_WRAP_R:
      return 1;
    case GL_TEXTURE_WRAP_S:
      return 1;
    case GL_TEXTURE_WRAP_T:
      return 1;
    case GL_TEXTURE_COMPARE_FUNC:
      return 1;
    case GL_TEXTURE_COMPARE_MODE:
      return 1;
    case GL_TEXTURE_MAX_LOD:
      return 1;
    case GL_TEXTURE_MIN_LOD:
      return 1;
    case GL_TEXTURE_BASE_LEVEL:
      return 1;
    case GL_TEXTURE_MAX_LEVEL:
      return 1;
    case GL_TEXTURE_IMMUTABLE_FORMAT:
      return 1;
    case GL_TEXTURE_IMMUTABLE_LEVELS:
      return 1;
    case GL_TEXTURE_MAX_ANISOTROPY_EXT:
      return 1;
    case GL_TEXTURE_SWIZZLE_R:
      return 1;
    case GL_TEXTURE_SWIZZLE_G:
      return 1;
    case GL_TEXTURE_SWIZZLE_B:
      return 1;
    case GL_TEXTURE_SWIZZLE_A:
      return 1;

    case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_SIZE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_TYPE:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
      return 1;
    case GL_CURRENT_VERTEX_ATTRIB:
      return 4;
    case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
      return 1;
    case GL_VERTEX_ATTRIB_ARRAY_DIVISOR:
      return 1;

    case GL_OBJECT_TYPE:
      return 1;
    case GL_SYNC_STATUS:
      return 1;
    case GL_SYNC_CONDITION:
      return 1;
    case GL_SYNC_FLAGS:
      return 1;

    case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
      return 1;

    case GL_BIND_GENERATES_RESOURCE_CHROMIUM:
      return 1;

    default:
      return 0;
  }
}
