1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
11 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_
12 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_
14 static const GLenum valid_attachment_table
[] = {
17 GL_STENCIL_ATTACHMENT
,
20 static const GLenum valid_backbuffer_attachment_table
[] = {
26 static const GLenum valid_blit_filter_table
[] = {
31 static const GLenum valid_buffer_parameter_table
[] = {
36 static const GLenum valid_buffer_target_table
[] = {
38 GL_ELEMENT_ARRAY_BUFFER
,
41 static const GLenum valid_buffer_usage_table
[] = {
47 static const GLenum valid_bufferfi_table
[] = {
51 static const GLenum valid_bufferfv_table
[] = {
56 static const GLenum valid_bufferiv_table
[] = {
61 static const GLenum valid_bufferuiv_table
[] = {
65 static const GLenum valid_capability_table
[] = {
70 GL_POLYGON_OFFSET_FILL
,
71 GL_SAMPLE_ALPHA_TO_COVERAGE
,
77 static const GLenum valid_cmp_function_table
[] = {
88 static const GLenum valid_draw_mode_table
[] = {
98 static const GLenum valid_dst_blend_factor_table
[] = {
102 GL_ONE_MINUS_SRC_COLOR
,
104 GL_ONE_MINUS_DST_COLOR
,
106 GL_ONE_MINUS_SRC_ALPHA
,
108 GL_ONE_MINUS_DST_ALPHA
,
110 GL_ONE_MINUS_CONSTANT_COLOR
,
112 GL_ONE_MINUS_CONSTANT_ALPHA
,
115 static const GLenum valid_equation_table
[] = {
118 GL_FUNC_REVERSE_SUBTRACT
,
121 static const GLenum valid_face_mode_table
[] = {
126 static const GLenum valid_face_type_table
[] = {
132 static const GLenum valid_frame_buffer_parameter_table
[] = {
133 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
134 GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
,
135 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
,
136 GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
,
139 static const GLenum valid_frame_buffer_target_table
[] = {
143 static const GLenum valid_g_l_state_table
[] = {
145 GL_ALIASED_LINE_WIDTH_RANGE
,
146 GL_ALIASED_POINT_SIZE_RANGE
,
148 GL_ARRAY_BUFFER_BINDING
,
150 GL_COMPRESSED_TEXTURE_FORMATS
,
154 GL_ELEMENT_ARRAY_BUFFER_BINDING
,
155 GL_FRAMEBUFFER_BINDING
,
156 GL_GENERATE_MIPMAP_HINT
,
158 GL_IMPLEMENTATION_COLOR_READ_FORMAT
,
159 GL_IMPLEMENTATION_COLOR_READ_TYPE
,
160 GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
,
161 GL_MAX_CUBE_MAP_TEXTURE_SIZE
,
162 GL_MAX_FRAGMENT_UNIFORM_VECTORS
,
163 GL_MAX_RENDERBUFFER_SIZE
,
164 GL_MAX_TEXTURE_IMAGE_UNITS
,
166 GL_MAX_VARYING_VECTORS
,
167 GL_MAX_VERTEX_ATTRIBS
,
168 GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
,
169 GL_MAX_VERTEX_UNIFORM_VECTORS
,
170 GL_MAX_VIEWPORT_DIMS
,
171 GL_NUM_COMPRESSED_TEXTURE_FORMATS
,
172 GL_NUM_SHADER_BINARY_FORMATS
,
175 GL_RENDERBUFFER_BINDING
,
177 GL_SAMPLE_COVERAGE_INVERT
,
178 GL_SAMPLE_COVERAGE_VALUE
,
181 GL_SHADER_BINARY_FORMATS
,
185 GL_TEXTURE_BINDING_2D
,
186 GL_TEXTURE_BINDING_CUBE_MAP
,
188 GL_UNPACK_FLIP_Y_CHROMIUM
,
189 GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM
,
190 GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM
,
191 GL_BIND_GENERATES_RESOURCE_CHROMIUM
,
192 GL_VERTEX_ARRAY_BINDING_OES
,
195 GL_BLEND_EQUATION_RGB
,
196 GL_BLEND_EQUATION_ALPHA
,
201 GL_COLOR_CLEAR_VALUE
,
202 GL_DEPTH_CLEAR_VALUE
,
203 GL_STENCIL_CLEAR_VALUE
,
210 GL_POLYGON_OFFSET_FACTOR
,
211 GL_POLYGON_OFFSET_UNITS
,
214 GL_STENCIL_VALUE_MASK
,
215 GL_STENCIL_BACK_FUNC
,
217 GL_STENCIL_BACK_VALUE_MASK
,
218 GL_STENCIL_WRITEMASK
,
219 GL_STENCIL_BACK_WRITEMASK
,
221 GL_STENCIL_PASS_DEPTH_FAIL
,
222 GL_STENCIL_PASS_DEPTH_PASS
,
223 GL_STENCIL_BACK_FAIL
,
224 GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
225 GL_STENCIL_BACK_PASS_DEPTH_PASS
,
230 GL_POLYGON_OFFSET_FILL
,
231 GL_SAMPLE_ALPHA_TO_COVERAGE
,
237 static const GLenum valid_get_max_index_type_table
[] = {
243 static const GLenum valid_get_tex_param_target_table
[] = {
248 static const GLenum valid_hint_mode_table
[] = {
254 static const GLenum valid_hint_target_table
[] = {
255 GL_GENERATE_MIPMAP_HINT
,
258 static const GLenum valid_image_internal_format_table
[] = {
263 static const GLenum valid_image_usage_table
[] = {
268 static const GLenum valid_index_type_table
[] = {
273 static const GLenum valid_indexed_buffer_target_table
[] = {
274 GL_TRANSFORM_FEEDBACK_BUFFER
,
278 static const GLenum valid_matrix_mode_table
[] = {
279 GL_PATH_PROJECTION_CHROMIUM
,
280 GL_PATH_MODELVIEW_CHROMIUM
,
283 static const GLenum valid_pixel_store_table
[] = {
286 GL_UNPACK_FLIP_Y_CHROMIUM
,
287 GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM
,
288 GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM
,
291 static const GLint valid_pixel_store_alignment_table
[] = {
298 static const GLenum valid_pixel_type_table
[] = {
300 GL_UNSIGNED_SHORT_5_6_5
,
301 GL_UNSIGNED_SHORT_4_4_4_4
,
302 GL_UNSIGNED_SHORT_5_5_5_1
,
305 static const GLenum valid_program_parameter_table
[] = {
311 GL_ACTIVE_ATTRIBUTES
,
312 GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
,
314 GL_ACTIVE_UNIFORM_MAX_LENGTH
,
317 static const GLenum valid_query_object_parameter_table
[] = {
319 GL_QUERY_RESULT_AVAILABLE_EXT
,
322 static const GLenum valid_query_parameter_table
[] = {
323 GL_CURRENT_QUERY_EXT
,
326 static const GLenum valid_query_target_table
[] = {
327 GL_ANY_SAMPLES_PASSED_EXT
,
328 GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT
,
329 GL_COMMANDS_ISSUED_CHROMIUM
,
330 GL_LATENCY_QUERY_CHROMIUM
,
331 GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM
,
332 GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM
,
333 GL_COMMANDS_COMPLETED_CHROMIUM
,
336 static const GLenum valid_read_pixel_format_table
[] = {
342 static const GLenum valid_read_pixel_type_table
[] = {
344 GL_UNSIGNED_SHORT_5_6_5
,
345 GL_UNSIGNED_SHORT_4_4_4_4
,
346 GL_UNSIGNED_SHORT_5_5_5_1
,
349 static const GLenum valid_render_buffer_format_table
[] = {
353 GL_DEPTH_COMPONENT16
,
357 static const GLenum valid_render_buffer_parameter_table
[] = {
358 GL_RENDERBUFFER_RED_SIZE
,
359 GL_RENDERBUFFER_GREEN_SIZE
,
360 GL_RENDERBUFFER_BLUE_SIZE
,
361 GL_RENDERBUFFER_ALPHA_SIZE
,
362 GL_RENDERBUFFER_DEPTH_SIZE
,
363 GL_RENDERBUFFER_STENCIL_SIZE
,
364 GL_RENDERBUFFER_WIDTH
,
365 GL_RENDERBUFFER_HEIGHT
,
366 GL_RENDERBUFFER_INTERNAL_FORMAT
,
369 static const GLenum valid_render_buffer_target_table
[] = {
373 static const GLenum valid_reset_status_table
[] = {
374 GL_GUILTY_CONTEXT_RESET_ARB
,
375 GL_INNOCENT_CONTEXT_RESET_ARB
,
376 GL_UNKNOWN_CONTEXT_RESET_ARB
,
379 static const GLenum valid_sampler_parameter_table
[] = {
380 GL_TEXTURE_MAG_FILTER
,
381 GL_TEXTURE_MIN_FILTER
,
387 GL_TEXTURE_COMPARE_MODE
,
388 GL_TEXTURE_COMPARE_FUNC
,
391 static const GLenum valid_shader_parameter_table
[] = {
396 GL_SHADER_SOURCE_LENGTH
,
397 GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE
,
400 static const GLenum valid_shader_precision_table
[] = {
409 static const GLenum valid_shader_type_table
[] = {
414 static const GLenum valid_src_blend_factor_table
[] = {
418 GL_ONE_MINUS_SRC_COLOR
,
420 GL_ONE_MINUS_DST_COLOR
,
422 GL_ONE_MINUS_SRC_ALPHA
,
424 GL_ONE_MINUS_DST_ALPHA
,
426 GL_ONE_MINUS_CONSTANT_COLOR
,
428 GL_ONE_MINUS_CONSTANT_ALPHA
,
429 GL_SRC_ALPHA_SATURATE
,
432 static const GLenum valid_stencil_op_table
[] = {
443 static const GLenum valid_string_type_table
[] = {
447 GL_SHADING_LANGUAGE_VERSION
,
451 static const GLenum valid_subscription_target_table
[] = {
452 GL_MOUSE_POSITION_CHROMIUM
,
455 static const GLenum valid_texture_3_d_target_table
[] = {
460 static const GLenum valid_texture_bind_target_table
[] = {
465 static const GLenum valid_texture_format_table
[] = {
473 static const GLenum valid_texture_internal_format_table
[] = {
481 static const GLenum valid_texture_internal_format_storage_table
[] = {
487 GL_LUMINANCE8_ALPHA8_EXT
,
492 static const GLenum valid_texture_mag_filter_mode_table
[] = {
497 static const GLenum valid_texture_min_filter_mode_table
[] = {
500 GL_NEAREST_MIPMAP_NEAREST
,
501 GL_LINEAR_MIPMAP_NEAREST
,
502 GL_NEAREST_MIPMAP_LINEAR
,
503 GL_LINEAR_MIPMAP_LINEAR
,
506 static const GLenum valid_texture_parameter_table
[] = {
507 GL_TEXTURE_MAG_FILTER
,
508 GL_TEXTURE_MIN_FILTER
,
509 GL_TEXTURE_POOL_CHROMIUM
,
514 static const GLenum valid_texture_pool_table
[] = {
515 GL_TEXTURE_POOL_MANAGED_CHROMIUM
,
516 GL_TEXTURE_POOL_UNMANAGED_CHROMIUM
,
519 static const GLenum valid_texture_target_table
[] = {
521 GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
522 GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
523 GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
524 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
525 GL_TEXTURE_CUBE_MAP_POSITIVE_Z
,
526 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
,
529 static const GLenum valid_texture_usage_table
[] = {
531 GL_FRAMEBUFFER_ATTACHMENT_ANGLE
,
534 static const GLenum valid_texture_wrap_mode_table
[] = {
540 static const GLenum valid_transform_feedback_bind_target_table
[] = {
541 GL_TRANSFORM_FEEDBACK
,
544 static const GLenum valid_transform_feedback_primitive_mode_table
[] = {
550 static const GLenum valid_value_buffer_target_table
[] = {
551 GL_SUBSCRIBED_VALUES_BUFFER_CHROMIUM
,
554 static const GLint valid_vertex_attrib_size_table
[] = {
561 static const GLenum valid_vertex_attrib_type_table
[] = {
569 static const GLenum valid_vertex_attribute_table
[] = {
570 GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
,
571 GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
572 GL_VERTEX_ATTRIB_ARRAY_ENABLED
,
573 GL_VERTEX_ATTRIB_ARRAY_SIZE
,
574 GL_VERTEX_ATTRIB_ARRAY_STRIDE
,
575 GL_VERTEX_ATTRIB_ARRAY_TYPE
,
576 GL_CURRENT_VERTEX_ATTRIB
,
579 static const GLenum valid_vertex_pointer_table
[] = {
580 GL_VERTEX_ATTRIB_ARRAY_POINTER
,
583 Validators::Validators()
584 : attachment(valid_attachment_table
, arraysize(valid_attachment_table
)),
585 backbuffer_attachment(valid_backbuffer_attachment_table
,
586 arraysize(valid_backbuffer_attachment_table
)),
587 blit_filter(valid_blit_filter_table
, arraysize(valid_blit_filter_table
)),
588 buffer_parameter(valid_buffer_parameter_table
,
589 arraysize(valid_buffer_parameter_table
)),
590 buffer_target(valid_buffer_target_table
,
591 arraysize(valid_buffer_target_table
)),
592 buffer_usage(valid_buffer_usage_table
,
593 arraysize(valid_buffer_usage_table
)),
594 bufferfi(valid_bufferfi_table
, arraysize(valid_bufferfi_table
)),
595 bufferfv(valid_bufferfv_table
, arraysize(valid_bufferfv_table
)),
596 bufferiv(valid_bufferiv_table
, arraysize(valid_bufferiv_table
)),
597 bufferuiv(valid_bufferuiv_table
, arraysize(valid_bufferuiv_table
)),
598 capability(valid_capability_table
, arraysize(valid_capability_table
)),
599 cmp_function(valid_cmp_function_table
,
600 arraysize(valid_cmp_function_table
)),
601 compressed_texture_format(),
602 draw_mode(valid_draw_mode_table
, arraysize(valid_draw_mode_table
)),
603 dst_blend_factor(valid_dst_blend_factor_table
,
604 arraysize(valid_dst_blend_factor_table
)),
605 equation(valid_equation_table
, arraysize(valid_equation_table
)),
606 face_mode(valid_face_mode_table
, arraysize(valid_face_mode_table
)),
607 face_type(valid_face_type_table
, arraysize(valid_face_type_table
)),
608 frame_buffer_parameter(valid_frame_buffer_parameter_table
,
609 arraysize(valid_frame_buffer_parameter_table
)),
610 frame_buffer_target(valid_frame_buffer_target_table
,
611 arraysize(valid_frame_buffer_target_table
)),
612 g_l_state(valid_g_l_state_table
, arraysize(valid_g_l_state_table
)),
613 get_max_index_type(valid_get_max_index_type_table
,
614 arraysize(valid_get_max_index_type_table
)),
615 get_tex_param_target(valid_get_tex_param_target_table
,
616 arraysize(valid_get_tex_param_target_table
)),
617 hint_mode(valid_hint_mode_table
, arraysize(valid_hint_mode_table
)),
618 hint_target(valid_hint_target_table
, arraysize(valid_hint_target_table
)),
619 image_internal_format(valid_image_internal_format_table
,
620 arraysize(valid_image_internal_format_table
)),
621 image_usage(valid_image_usage_table
, arraysize(valid_image_usage_table
)),
622 index_type(valid_index_type_table
, arraysize(valid_index_type_table
)),
623 indexed_buffer_target(valid_indexed_buffer_target_table
,
624 arraysize(valid_indexed_buffer_target_table
)),
625 matrix_mode(valid_matrix_mode_table
, arraysize(valid_matrix_mode_table
)),
626 pixel_store(valid_pixel_store_table
, arraysize(valid_pixel_store_table
)),
627 pixel_store_alignment(valid_pixel_store_alignment_table
,
628 arraysize(valid_pixel_store_alignment_table
)),
629 pixel_type(valid_pixel_type_table
, arraysize(valid_pixel_type_table
)),
630 program_parameter(valid_program_parameter_table
,
631 arraysize(valid_program_parameter_table
)),
632 query_object_parameter(valid_query_object_parameter_table
,
633 arraysize(valid_query_object_parameter_table
)),
634 query_parameter(valid_query_parameter_table
,
635 arraysize(valid_query_parameter_table
)),
636 query_target(valid_query_target_table
,
637 arraysize(valid_query_target_table
)),
638 read_pixel_format(valid_read_pixel_format_table
,
639 arraysize(valid_read_pixel_format_table
)),
640 read_pixel_type(valid_read_pixel_type_table
,
641 arraysize(valid_read_pixel_type_table
)),
642 render_buffer_format(valid_render_buffer_format_table
,
643 arraysize(valid_render_buffer_format_table
)),
644 render_buffer_parameter(valid_render_buffer_parameter_table
,
645 arraysize(valid_render_buffer_parameter_table
)),
646 render_buffer_target(valid_render_buffer_target_table
,
647 arraysize(valid_render_buffer_target_table
)),
648 reset_status(valid_reset_status_table
,
649 arraysize(valid_reset_status_table
)),
650 sampler_parameter(valid_sampler_parameter_table
,
651 arraysize(valid_sampler_parameter_table
)),
652 shader_binary_format(),
653 shader_parameter(valid_shader_parameter_table
,
654 arraysize(valid_shader_parameter_table
)),
655 shader_precision(valid_shader_precision_table
,
656 arraysize(valid_shader_precision_table
)),
657 shader_type(valid_shader_type_table
, arraysize(valid_shader_type_table
)),
658 src_blend_factor(valid_src_blend_factor_table
,
659 arraysize(valid_src_blend_factor_table
)),
660 stencil_op(valid_stencil_op_table
, arraysize(valid_stencil_op_table
)),
661 string_type(valid_string_type_table
, arraysize(valid_string_type_table
)),
662 subscription_target(valid_subscription_target_table
,
663 arraysize(valid_subscription_target_table
)),
664 texture_3_d_target(valid_texture_3_d_target_table
,
665 arraysize(valid_texture_3_d_target_table
)),
666 texture_bind_target(valid_texture_bind_target_table
,
667 arraysize(valid_texture_bind_target_table
)),
668 texture_format(valid_texture_format_table
,
669 arraysize(valid_texture_format_table
)),
670 texture_internal_format(valid_texture_internal_format_table
,
671 arraysize(valid_texture_internal_format_table
)),
672 texture_internal_format_storage(
673 valid_texture_internal_format_storage_table
,
674 arraysize(valid_texture_internal_format_storage_table
)),
675 texture_mag_filter_mode(valid_texture_mag_filter_mode_table
,
676 arraysize(valid_texture_mag_filter_mode_table
)),
677 texture_min_filter_mode(valid_texture_min_filter_mode_table
,
678 arraysize(valid_texture_min_filter_mode_table
)),
679 texture_parameter(valid_texture_parameter_table
,
680 arraysize(valid_texture_parameter_table
)),
681 texture_pool(valid_texture_pool_table
,
682 arraysize(valid_texture_pool_table
)),
683 texture_target(valid_texture_target_table
,
684 arraysize(valid_texture_target_table
)),
685 texture_usage(valid_texture_usage_table
,
686 arraysize(valid_texture_usage_table
)),
687 texture_wrap_mode(valid_texture_wrap_mode_table
,
688 arraysize(valid_texture_wrap_mode_table
)),
689 transform_feedback_bind_target(
690 valid_transform_feedback_bind_target_table
,
691 arraysize(valid_transform_feedback_bind_target_table
)),
692 transform_feedback_primitive_mode(
693 valid_transform_feedback_primitive_mode_table
,
694 arraysize(valid_transform_feedback_primitive_mode_table
)),
695 value_buffer_target(valid_value_buffer_target_table
,
696 arraysize(valid_value_buffer_target_table
)),
697 vertex_attrib_size(valid_vertex_attrib_size_table
,
698 arraysize(valid_vertex_attrib_size_table
)),
699 vertex_attrib_type(valid_vertex_attrib_type_table
,
700 arraysize(valid_vertex_attrib_type_table
)),
701 vertex_attribute(valid_vertex_attribute_table
,
702 arraysize(valid_vertex_attribute_table
)),
703 vertex_pointer(valid_vertex_pointer_table
,
704 arraysize(valid_vertex_pointer_table
)) {
707 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_