diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 22:40:18 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 22:40:18 +0000 |
commit | 5189e43c9a57b101b378f4f759ac186180b04a13 (patch) | |
tree | 1d01c31ac48a894b35f9d6578c4e9aa99e7fa9c8 /gpu | |
parent | 260c32123634579ad9cb0013a20680cefbda443e (diff) | |
download | chromium_src-5189e43c9a57b101b378f4f759ac186180b04a13.zip chromium_src-5189e43c9a57b101b378f4f759ac186180b04a13.tar.gz chromium_src-5189e43c9a57b101b378f4f759ac186180b04a13.tar.bz2 |
Revert FeatureInfo::Workarounds setup in command buffer.
This is a temporary solution so we can move forward with green gl_tests, until we migrate the setup code from src/content to src/gpu.
Note that in regular chrome codepath, kGpuDriverBugWorkarounds is always passed down to gpu process, so the code path in this CL is never triggered: it is for testing only.
BUG=228979
TEST=gl_tests,gpu_unittests
Review URL: https://codereview.chromium.org/14186003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 82 | ||||
-rw-r--r-- | gpu/command_buffer/service/test_helper.cc | 6 |
2 files changed, 85 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 068a132..d9df6f6 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -180,6 +180,74 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { StringSet extensions( reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))); + // This is a temporary fix to turn gl_tests green on Linux and Android bots. + // Once we migrate blacklisting stuff from src/content to src/gpu, we can + // get the workarounds from json file. Then we should remove this block. + // See crbug.com/228979. + bool is_intel = false; + bool is_nvidia = false; + bool is_amd = false; + bool is_mesa = false; + bool is_qualcomm = false; + bool is_imagination = false; + bool is_arm = false; + const char* gl_strings[2]; + gl_strings[0] = reinterpret_cast<const char*>(glGetString(GL_VENDOR)); + gl_strings[1] = reinterpret_cast<const char*>(glGetString(GL_RENDERER)); + if (!command_line.HasSwitch(switches::kGpuDriverBugWorkarounds) && + !command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { + for (size_t ii = 0; ii < arraysize(gl_strings); ++ii) { + const char* str = gl_strings[ii]; + if (str) { + std::string lstr(StringToLowerASCII(std::string(str))); + StringSet string_set(lstr); + is_intel |= string_set.Contains("intel"); + is_nvidia |= string_set.Contains("nvidia"); + is_amd |= string_set.Contains("amd") || string_set.Contains("ati"); + is_mesa |= string_set.Contains("mesa"); + is_qualcomm |= string_set.Contains("qualcomm"); + is_imagination |= string_set.Contains("imagination"); + is_arm |= string_set.Contains("arm"); + } + } + + workarounds_.set_texture_filter_before_generating_mipmap = true; + workarounds_.clear_alpha_in_readpixels = true; + if (is_nvidia) { + workarounds_.use_current_program_after_successful_link = true; + } + if (is_qualcomm) { + workarounds_.restore_scissor_on_fbo_change = true; + workarounds_.flush_on_context_switch = true; + workarounds_.delete_instead_of_resize_fbo = true; + } +#if defined(OS_MACOSX) + workarounds_.needs_offscreen_buffer_workaround = is_nvidia; + workarounds_.needs_glsl_built_in_function_emulation = is_amd; + if ((is_amd || is_intel) && + gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { + workarounds_.reverse_point_sprite_coord_origin = true; + } + if (is_intel) { + workarounds_.max_texture_size = 4096; + workarounds_.max_cube_map_texture_size = 1024; + int32 major = 0; + int32 minor = 0; + int32 bugfix = 0; + base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); + if (major < 10 || + (major == 10 && ((minor == 7 && bugfix < 3) || (minor < 7)))) + workarounds_.max_cube_map_texture_size = 512; + } + if (is_amd) { + workarounds_.max_texture_size = 4096; + workarounds_.max_cube_map_texture_size = 4096; + } +#elif defined(OS_WIN) + workarounds_.exit_on_context_lost = true; +#endif + } + if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) { std::string types = command_line.GetSwitchValueASCII( switches::kGpuDriverBugWorkarounds); @@ -210,7 +278,8 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { AddExtensionString("GL_CHROMIUM_texture_mailbox"); AddExtensionString("GL_EXT_debug_marker"); - if (workarounds_.enable_chromium_fast_npot_mo8_textures) + if (workarounds_.enable_chromium_fast_npot_mo8_textures || + is_imagination) AddExtensionString("GL_CHROMIUM_fast_NPOT_MO8_textures"); feature_flags_.chromium_stream_texture = true; @@ -295,7 +364,7 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { // get rid of it. // bool enable_depth_texture = false; - if (!workarounds_.disable_depth_texture && + if ((!workarounds_.disable_depth_texture && !is_qualcomm) && (extensions.Contains("GL_ARB_depth_texture") || extensions.Contains("GL_OES_depth_texture") || extensions.Contains("GL_ANGLE_depth_texture"))) { @@ -332,6 +401,10 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { feature_flags_.native_vertex_array_object = true; } + if (is_arm || is_imagination) { + workarounds_.use_client_side_arrays_for_stream_buffers = true; + } + // If we're using client_side_arrays we have to emulate // vertex array objects since vertex array objects do not work // with client side arrays. @@ -452,7 +525,7 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { // Check for multisample support bool ext_has_multisample = extensions.Contains("GL_EXT_framebuffer_multisample"); - if (!workarounds_.disable_angle_framebuffer_multisample) { + if (!is_qualcomm && !workarounds_.disable_angle_framebuffer_multisample) { ext_has_multisample |= extensions.Contains("GL_ANGLE_framebuffer_multisample"); } @@ -570,6 +643,9 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) { extensions.Contains("GL_ARB_occlusion_query"); if (!workarounds_.disable_ext_occlusion_query && +#if defined(OS_LINUX) + !is_intel && +#endif (have_ext_occlusion_query_boolean || have_arb_occlusion_query2 || have_arb_occlusion_query)) { diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc index b881d13..06c2fd7 100644 --- a/gpu/command_buffer/service/test_helper.cc +++ b/gpu/command_buffer/service/test_helper.cc @@ -285,6 +285,12 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( EXPECT_CALL(*gl, GetString(GL_EXTENSIONS)) .WillOnce(Return(reinterpret_cast<const uint8*>(extensions))) .RetiresOnSaturation(); + EXPECT_CALL(*gl, GetString(GL_VENDOR)) + .WillOnce(Return(reinterpret_cast<const uint8*>(""))) + .RetiresOnSaturation(); + EXPECT_CALL(*gl, GetString(GL_RENDERER)) + .WillOnce(Return(reinterpret_cast<const uint8*>(""))) + .RetiresOnSaturation(); EXPECT_CALL(*gl, GetString(GL_VERSION)) .WillOnce(Return(reinterpret_cast<const uint8*>(version))) .RetiresOnSaturation(); |