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 // It is included by context_state.h
12 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_AUTOGEN_H_
13 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_AUTOGEN_H_
20 bool cached_cull_face
;
22 bool cached_depth_test
;
25 bool polygon_offset_fill
;
26 bool cached_polygon_offset_fill
;
27 bool sample_alpha_to_coverage
;
28 bool cached_sample_alpha_to_coverage
;
30 bool cached_sample_coverage
;
32 bool cached_scissor_test
;
34 bool cached_stencil_test
;
35 bool rasterizer_discard
;
36 bool cached_rasterizer_discard
;
37 bool primitive_restart_fixed_index
;
38 bool cached_primitive_restart_fixed_index
;
41 GLfloat blend_color_red
;
42 GLfloat blend_color_green
;
43 GLfloat blend_color_blue
;
44 GLfloat blend_color_alpha
;
45 GLenum blend_equation_rgb
;
46 GLenum blend_equation_alpha
;
47 GLenum blend_source_rgb
;
48 GLenum blend_dest_rgb
;
49 GLenum blend_source_alpha
;
50 GLenum blend_dest_alpha
;
51 GLfloat color_clear_red
;
52 GLfloat color_clear_green
;
53 GLfloat color_clear_blue
;
54 GLfloat color_clear_alpha
;
57 GLboolean color_mask_red
;
58 GLboolean cached_color_mask_red
;
59 GLboolean color_mask_green
;
60 GLboolean cached_color_mask_green
;
61 GLboolean color_mask_blue
;
62 GLboolean cached_color_mask_blue
;
63 GLboolean color_mask_alpha
;
64 GLboolean cached_color_mask_alpha
;
68 GLboolean cached_depth_mask
;
72 GLenum hint_generate_mipmap
;
73 GLenum hint_fragment_shader_derivative
;
75 GLfloat modelview_matrix
[16];
76 GLfloat projection_matrix
[16];
77 GLenum stencil_path_func
;
78 GLint stencil_path_ref
;
79 GLuint stencil_path_mask
;
81 GLint unpack_alignment
;
82 GLfloat polygon_offset_factor
;
83 GLfloat polygon_offset_units
;
84 GLclampf sample_coverage_value
;
85 GLboolean sample_coverage_invert
;
88 GLsizei scissor_width
;
89 GLsizei scissor_height
;
90 GLenum stencil_front_func
;
91 GLint stencil_front_ref
;
92 GLuint stencil_front_mask
;
93 GLenum stencil_back_func
;
94 GLint stencil_back_ref
;
95 GLuint stencil_back_mask
;
96 GLuint stencil_front_writemask
;
97 GLuint cached_stencil_front_writemask
;
98 GLuint stencil_back_writemask
;
99 GLuint cached_stencil_back_writemask
;
100 GLenum stencil_front_fail_op
;
101 GLenum stencil_front_z_fail_op
;
102 GLenum stencil_front_z_pass_op
;
103 GLenum stencil_back_fail_op
;
104 GLenum stencil_back_z_fail_op
;
105 GLenum stencil_back_z_pass_op
;
108 GLsizei viewport_width
;
109 GLsizei viewport_height
;
111 inline void SetDeviceCapabilityState(GLenum cap
, bool enable
) {
114 if (enable_flags
.cached_blend
== enable
&& !ignore_cached_state
)
116 enable_flags
.cached_blend
= enable
;
119 if (enable_flags
.cached_cull_face
== enable
&& !ignore_cached_state
)
121 enable_flags
.cached_cull_face
= enable
;
124 if (enable_flags
.cached_depth_test
== enable
&& !ignore_cached_state
)
126 enable_flags
.cached_depth_test
= enable
;
129 if (enable_flags
.cached_dither
== enable
&& !ignore_cached_state
)
131 enable_flags
.cached_dither
= enable
;
133 case GL_POLYGON_OFFSET_FILL
:
134 if (enable_flags
.cached_polygon_offset_fill
== enable
&&
135 !ignore_cached_state
)
137 enable_flags
.cached_polygon_offset_fill
= enable
;
139 case GL_SAMPLE_ALPHA_TO_COVERAGE
:
140 if (enable_flags
.cached_sample_alpha_to_coverage
== enable
&&
141 !ignore_cached_state
)
143 enable_flags
.cached_sample_alpha_to_coverage
= enable
;
145 case GL_SAMPLE_COVERAGE
:
146 if (enable_flags
.cached_sample_coverage
== enable
&& !ignore_cached_state
)
148 enable_flags
.cached_sample_coverage
= enable
;
150 case GL_SCISSOR_TEST
:
151 if (enable_flags
.cached_scissor_test
== enable
&& !ignore_cached_state
)
153 enable_flags
.cached_scissor_test
= enable
;
155 case GL_STENCIL_TEST
:
156 if (enable_flags
.cached_stencil_test
== enable
&& !ignore_cached_state
)
158 enable_flags
.cached_stencil_test
= enable
;
160 case GL_RASTERIZER_DISCARD
:
161 if (enable_flags
.cached_rasterizer_discard
== enable
&&
162 !ignore_cached_state
)
164 enable_flags
.cached_rasterizer_discard
= enable
;
166 case GL_PRIMITIVE_RESTART_FIXED_INDEX
:
167 if (enable_flags
.cached_primitive_restart_fixed_index
== enable
&&
168 !ignore_cached_state
)
170 enable_flags
.cached_primitive_restart_fixed_index
= enable
;
181 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_AUTOGEN_H_