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_PROGRAM_USE, \ 16 clear_uniforms_before_program_use) \ 17 GPU_OP(DELETE_INSTEAD_OF_RESIZE_FBO, \ 18 delete_instead_of_resize_fbo) \ 19 GPU_OP(DISABLE_ANGLE_FRAMEBUFFER_MULTISAMPLE, \ 20 disable_angle_framebuffer_multisample) \ 21 GPU_OP(DISABLE_DEPTH_TEXTURE, \ 22 disable_depth_texture) \ 23 GPU_OP(DISABLE_EXT_DRAW_BUFFERS, \ 24 disable_ext_draw_buffers) \ 25 GPU_OP(DISABLE_EXT_OCCLUSION_QUERY, \ 26 disable_ext_occlusion_query) \ 27 GPU_OP(DISABLE_OES_STANDARD_DERIVATIVES, \ 28 disable_oes_standard_derivatives) \ 29 GPU_OP(ENABLE_CHROMIUM_FAST_NPOT_MO8_TEXTURES, \ 30 enable_chromium_fast_npot_mo8_textures) \ 31 GPU_OP(EXIT_ON_CONTEXT_LOST, \ 32 exit_on_context_lost) \ 33 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024, \ 34 max_cube_map_texture_size_limit_1024) \ 35 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096, \ 36 max_cube_map_texture_size_limit_4096) \ 37 GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512, \ 38 max_cube_map_texture_size_limit_512) \ 39 GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \ 40 max_texture_size_limit_4096) \ 41 GPU_OP(NEEDS_GLSL_BUILT_IN_FUNCTION_EMULATION, \ 42 needs_glsl_built_in_function_emulation) \ 43 GPU_OP(NEEDS_OFFSCREEN_BUFFER_WORKAROUND, \ 44 needs_offscreen_buffer_workaround) \ 45 GPU_OP(RESTORE_SCISSOR_ON_FBO_CHANGE, \ 46 restore_scissor_on_fbo_change) \ 47 GPU_OP(REVERSE_POINT_SPRITE_COORD_ORIGIN, \ 48 reverse_point_sprite_coord_origin) \ 49 GPU_OP(SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP, \ 50 set_texture_filter_before_generating_mipmap) \ 51 GPU_OP(UNBIND_FBO_ON_CONTEXT_SWITCH, \ 52 unbind_fbo_on_context_switch) \ 53 GPU_OP(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS, \ 54 use_client_side_arrays_for_stream_buffers) \ 55 GPU_OP(USE_CURRENT_PROGRAM_AFTER_SUCCESSFUL_LINK, \ 56 use_current_program_after_successful_link) \ 57 GPU_OP(USE_NON_ZERO_SIZE_FOR_CLIENT_SIDE_STREAM_BUFFERS, \ 58 use_non_zero_size_for_client_side_stream_buffers) \ 59 GPU_OP(DISABLE_ASYNC_READPIXELS, \ 60 disable_async_readpixels) \ 61 GPU_OP(DISABLE_D3D11, \ 62 disable_d3d11) \ 63 GPU_OP(SWIZZLE_RGBA_FOR_ASYNC_READPIXELS, \ 64 swizzle_rgba_for_async_readpixels) \ 65 GPU_OP(DISABLE_ANGLE_INSTANCED_ARRAYS, \ 66 disable_angle_instanced_arrays) \ 67 68 namespace gpu { 69 70 // Provides all types of GPU driver bug workarounds. 71 enum GPU_EXPORT GpuDriverBugWorkaroundType { 72 #define GPU_OP(type, name) type, 73 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 74 #undef GPU_OP 75 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES 76 }; 77 78 GPU_EXPORT std::string GpuDriverBugWorkaroundTypeToString( 79 GpuDriverBugWorkaroundType type); 80 81 } // namespace gpu 82 83 #endif // GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUND_TYPE_H_ 84