Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / gpu / config / gpu_driver_bug_workaround_type.h
1 // Copyright (c) 2013 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.
4
5 #ifndef GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUND_TYPE_H_
6 #define GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUND_TYPE_H_
7
8 #include <string>
9
10 #include "gpu/gpu_export.h"
11
12 #define GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)                   \
13   GPU_OP(CLEAR_ALPHA_IN_READPIXELS,                          \
14          clear_alpha_in_readpixels)                          \
15   GPU_OP(CLEAR_UNIFORMS_BEFORE_FIRST_PROGRAM_USE,            \
16          clear_uniforms_before_first_program_use)            \
17   GPU_OP(COUNT_ALL_IN_VARYINGS_PACKING,                      \
18          count_all_in_varyings_packing)                      \
19   GPU_OP(DISABLE_ANGLE_INSTANCED_ARRAYS,                     \
20          disable_angle_instanced_arrays)                     \
21   GPU_OP(DISABLE_ARB_SYNC,                                   \
22          disable_arb_sync)                                   \
23   GPU_OP(DISABLE_ASYNC_READPIXELS,                           \
24          disable_async_readpixels)                           \
25   GPU_OP(DISABLE_D3D11,                                      \
26          disable_d3d11)                                      \
27   GPU_OP(DISABLE_DEPTH_TEXTURE,                              \
28          disable_depth_texture)                              \
29   GPU_OP(DISABLE_EGL_KHR_FENCE_SYNC,                         \
30          disable_egl_khr_fence_sync)                         \
31   GPU_OP(DISABLE_EXT_DISCARD_FRAMEBUFFER,                    \
32          disable_ext_discard_framebuffer)                    \
33   GPU_OP(DISABLE_EXT_DRAW_BUFFERS,                           \
34          disable_ext_draw_buffers)                           \
35   GPU_OP(DISABLE_EXT_OCCLUSION_QUERY,                        \
36          disable_ext_occlusion_query)                        \
37   GPU_OP(DISABLE_MULTIMONITOR_MULTISAMPLING,                 \
38          disable_multimonitor_multisampling)                 \
39   GPU_OP(DISABLE_MULTISAMPLING,                              \
40          disable_multisampling)                              \
41   GPU_OP(DISABLE_OES_STANDARD_DERIVATIVES,                   \
42          disable_oes_standard_derivatives)                   \
43   GPU_OP(DISABLE_POST_SUB_BUFFERS_FOR_ONSCREEN_SURFACES,     \
44          disable_post_sub_buffers_for_onscreen_surfaces)     \
45   GPU_OP(EXIT_ON_CONTEXT_LOST,                               \
46          exit_on_context_lost)                               \
47   GPU_OP(FORCE_DISCRETE_GPU,                                 \
48          force_discrete_gpu)                                 \
49   GPU_OP(FORCE_GL_FINISH_AFTER_COMPOSITING,                  \
50          force_gl_finish_after_compositing)                  \
51   GPU_OP(FORCE_INTEGRATED_GPU,                               \
52          force_integrated_gpu)                               \
53   GPU_OP(INIT_GL_POSITION_IN_VERTEX_SHADER,                  \
54          init_gl_position_in_vertex_shader)                  \
55   GPU_OP(INIT_TEXTURE_MAX_ANISOTROPY,                        \
56          init_texture_max_anisotropy)                        \
57   GPU_OP(INIT_VARYINGS_WITHOUT_STATIC_USE,                   \
58          init_varyings_without_static_use)                   \
59   GPU_OP(INIT_VERTEX_ATTRIBUTES,                             \
60          init_vertex_attributes)                             \
61   GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024,               \
62          max_cube_map_texture_size_limit_1024)               \
63   GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096,               \
64          max_cube_map_texture_size_limit_4096)               \
65   GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512,                \
66          max_cube_map_texture_size_limit_512)                \
67   GPU_OP(MAX_FRAGMENT_UNIFORM_VECTORS_32,                    \
68          max_fragment_uniform_vectors_32)                    \
69   GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096,                        \
70          max_texture_size_limit_4096)                        \
71   GPU_OP(MAX_VARYING_VECTORS_16,                             \
72          max_varying_vectors_16)                             \
73   GPU_OP(MAX_VERTEX_UNIFORM_VECTORS_256,                     \
74          max_vertex_uniform_vectors_256)                     \
75   GPU_OP(NEEDS_GLSL_BUILT_IN_FUNCTION_EMULATION,             \
76          needs_glsl_built_in_function_emulation)             \
77   GPU_OP(NEEDS_OFFSCREEN_BUFFER_WORKAROUND,                  \
78          needs_offscreen_buffer_workaround)                  \
79   GPU_OP(RELEASE_IMAGE_AFTER_USE,                            \
80          release_image_after_use)                            \
81   GPU_OP(RESTORE_SCISSOR_ON_FBO_CHANGE,                      \
82          restore_scissor_on_fbo_change)                      \
83   GPU_OP(REVERSE_POINT_SPRITE_COORD_ORIGIN,                  \
84          reverse_point_sprite_coord_origin)                  \
85   GPU_OP(SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS,             \
86          scalarize_vec_and_mat_constructor_args)             \
87   GPU_OP(SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP,        \
88          set_texture_filter_before_generating_mipmap)        \
89   GPU_OP(SWIZZLE_RGBA_FOR_ASYNC_READPIXELS,                  \
90          swizzle_rgba_for_async_readpixels)                  \
91   GPU_OP(TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D,               \
92          texsubimage2d_faster_than_teximage2d)               \
93   GPU_OP(UNBIND_FBO_ON_CONTEXT_SWITCH,                       \
94          unbind_fbo_on_context_switch)                       \
95   GPU_OP(UNFOLD_SHORT_CIRCUIT_AS_TERNARY_OPERATION,          \
96          unfold_short_circuit_as_ternary_operation)          \
97   GPU_OP(UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX,           \
98          unroll_for_loop_with_sampler_array_index)           \
99   GPU_OP(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS,          \
100          use_client_side_arrays_for_stream_buffers)          \
101   GPU_OP(USE_CURRENT_PROGRAM_AFTER_SUCCESSFUL_LINK,          \
102          use_current_program_after_successful_link)          \
103   GPU_OP(USE_NON_ZERO_SIZE_FOR_CLIENT_SIDE_STREAM_BUFFERS,   \
104          use_non_zero_size_for_client_side_stream_buffers)   \
105   GPU_OP(USE_VIRTUALIZED_GL_CONTEXTS,                        \
106          use_virtualized_gl_contexts)                        \
107   GPU_OP(VALIDATE_MULTISAMPLE_BUFFER_ALLOCATION,             \
108          validate_multisample_buffer_allocation)             \
109   GPU_OP(WAKE_UP_GPU_BEFORE_DRAWING,                         \
110          wake_up_gpu_before_drawing)                         \
111
112 namespace gpu {
113
114 // Provides all types of GPU driver bug workarounds.
115 enum GPU_EXPORT GpuDriverBugWorkaroundType {
116 #define GPU_OP(type, name) type,
117   GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
118 #undef GPU_OP
119   NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES
120 };
121
122 GPU_EXPORT std::string GpuDriverBugWorkaroundTypeToString(
123     GpuDriverBugWorkaroundType type);
124
125 }  // namespace gpu
126
127 #endif  // GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUND_TYPE_H_