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_ASYNC_READPIXELS, \ 22 disable_async_readpixels) \ 23 GPU_OP(DISABLE_D3D11, \ 24 disable_d3d11) \ 25 GPU_OP(DISABLE_DEPTH_TEXTURE, \ 26 disable_depth_texture) \ 27 GPU_OP(DISABLE_EXT_DISCARD_FRAMEBUFFER, \ 28 disable_ext_discard_framebuffer) \ 29 GPU_OP(DISABLE_EXT_DRAW_BUFFERS, \ 30 disable_ext_draw_buffers) \ 31 GPU_OP(DISABLE_EXT_OCCLUSION_QUERY, \ 32 disable_ext_occlusion_query) \ 33 GPU_OP(DISABLE_FRAMEBUFFER_MULTISAMPLE, \ 34 disable_framebuffer_multisample) \ 35 GPU_OP(DISABLE_MULTIMONITOR_MULTISAMPLING, \ 36 disable_multimonitor_multisampling) \ 37 GPU_OP(DISABLE_OES_STANDARD_DERIVATIVES, \ 38 disable_oes_standard_derivatives) \ 39 GPU_OP(ENABLE_CHROMIUM_FAST_NPOT_MO8_TEXTURES, \ 40 enable_chromium_fast_npot_mo8_textures) \ 41 GPU_OP(EXIT_ON_CONTEXT_LOST, \ 42 exit_on_context_lost) \ 43 GPU_OP(FORCE_DISCRETE_GPU, \ 44 force_discrete_gpu) \ 45 GPU_OP(FORCE_INTEGRATED_GPU, \ 46 force_integrated_gpu) \ 47 GPU_OP(INIT_GL_POSITION_IN_VERTEX_SHADER, \ 48 init_gl_position_in_vertex_shader) \ 49 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024, \ 50 max_cube_map_texture_size_limit_1024) \ 51 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096, \ 52 max_cube_map_texture_size_limit_4096) \ 53 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512, \ 54 max_cube_map_texture_size_limit_512) \ 55 GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \ 56 max_texture_size_limit_4096) \ 57 GPU_OP(NEEDS_GLSL_BUILT_IN_FUNCTION_EMULATION, \ 58 needs_glsl_built_in_function_emulation) \ 59 GPU_OP(NEEDS_OFFSCREEN_BUFFER_WORKAROUND, \ 60 needs_offscreen_buffer_workaround) \ 61 GPU_OP(RELEASE_IMAGE_AFTER_USE, \ 62 release_image_after_use) \ 63 GPU_OP(RESTORE_SCISSOR_ON_FBO_CHANGE, \ 64 restore_scissor_on_fbo_change) \ 65 GPU_OP(REVERSE_POINT_SPRITE_COORD_ORIGIN, \ 66 reverse_point_sprite_coord_origin) \ 67 GPU_OP(SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP, \ 68 set_texture_filter_before_generating_mipmap) \ 69 GPU_OP(SWIZZLE_RGBA_FOR_ASYNC_READPIXELS, \ 70 swizzle_rgba_for_async_readpixels) \ 71 GPU_OP(TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D, \ 72 texsubimage2d_faster_than_teximage2d) \ 73 GPU_OP(UNBIND_FBO_ON_CONTEXT_SWITCH, \ 74 unbind_fbo_on_context_switch) \ 75 GPU_OP(UNFOLD_SHORT_CIRCUIT_AS_TERNARY_OPERATION, \ 76 unfold_short_circuit_as_ternary_operation) \ 77 GPU_OP(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS, \ 78 use_client_side_arrays_for_stream_buffers) \ 79 GPU_OP(USE_CURRENT_PROGRAM_AFTER_SUCCESSFUL_LINK, \ 80 use_current_program_after_successful_link) \ 81 GPU_OP(USE_NON_ZERO_SIZE_FOR_CLIENT_SIDE_STREAM_BUFFERS, \ 82 use_non_zero_size_for_client_side_stream_buffers) \ 83 GPU_OP(USE_VIRTUALIZED_GL_CONTEXTS, \ 84 use_virtualized_gl_contexts) \ 85 GPU_OP(VALIDATE_MULTISAMPLE_BUFFER_ALLOCATION, \ 86 validate_multisample_buffer_allocation) \ 87 GPU_OP(WAKE_UP_GPU_BEFORE_DRAWING, \ 88 wake_up_gpu_before_drawing) \ 89 90 namespace gpu { 91 92 // Provides all types of GPU driver bug workarounds. 93 enum GPU_EXPORT GpuDriverBugWorkaroundType { 94 #define GPU_OP(type, name) type, 95 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 96 #undef GPU_OP 97 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES 98 }; 99 100 GPU_EXPORT std::string GpuDriverBugWorkaroundTypeToString( 101 GpuDriverBugWorkaroundType type); 102 103 } // namespace gpu 104 105 #endif // GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUND_TYPE_H_ 106