diff options
author | puttaraju.r@samsung.com <puttaraju.r@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-16 16:49:52 +0000 |
---|---|---|
committer | puttaraju.r@samsung.com <puttaraju.r@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-16 16:49:52 +0000 |
commit | c5e97c352e3dd683e6a9de052e4ed6fbd64b0d57 (patch) | |
tree | 8e70777ef8ef20d048b56b17f2b4218bb6ef63d0 /gpu | |
parent | d7f7d692fc1b9734354913a5563ed004852968e9 (diff) | |
download | chromium_src-c5e97c352e3dd683e6a9de052e4ed6fbd64b0d57.zip chromium_src-c5e97c352e3dd683e6a9de052e4ed6fbd64b0d57.tar.gz chromium_src-c5e97c352e3dd683e6a9de052e4ed6fbd64b0d57.tar.bz2 |
Move vertex and fragment shader uniform vector workarounds to gpu driver bug list.
BUG=none
Review URL: https://codereview.chromium.org/224233003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/context_group.cc | 28 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 12 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info.h | 3 | ||||
-rw-r--r-- | gpu/config/gpu_driver_bug_list_json.cc | 16 | ||||
-rw-r--r-- | gpu/config/gpu_driver_bug_workaround_type.h | 6 |
5 files changed, 52 insertions, 13 deletions
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc index fb97daf..ba0437b 100644 --- a/gpu/command_buffer/service/context_group.cc +++ b/gpu/command_buffer/service/context_group.cc @@ -223,18 +223,24 @@ bool ContextGroup::Initialize( return false; } - // TODO(gman): Use workarounds similar to max_texture_size above to implement. - if (gfx::GetGLImplementation() == gfx::kGLImplementationOSMesaGL) { - // Some shaders in Skia needed more than the min. - max_fragment_uniform_vectors_ = - std::min(static_cast<uint32>(kMinFragmentUniformVectors * 2), - max_fragment_uniform_vectors_); - max_varying_vectors_ = - std::min(static_cast<uint32>(kMinVaryingVectors * 2), - max_varying_vectors_); + // Some shaders in Skia need more than the min available vertex and + // fragment shader uniform vectors in case of OSMesa GL Implementation + if (feature_info_->workarounds().max_fragment_uniform_vectors) { + max_fragment_uniform_vectors_ = std::min( + max_fragment_uniform_vectors_, + static_cast<uint32>( + feature_info_->workarounds().max_fragment_uniform_vectors)); + } + if (feature_info_->workarounds().max_varying_vectors) { + max_varying_vectors_ = std::min( + max_varying_vectors_, + static_cast<uint32>(feature_info_->workarounds().max_varying_vectors)); + } + if (feature_info_->workarounds().max_vertex_uniform_vectors) { max_vertex_uniform_vectors_ = - std::min(static_cast<uint32>(kMinVertexUniformVectors * 2), - max_vertex_uniform_vectors_); + std::min(max_vertex_uniform_vectors_, + static_cast<uint32>( + feature_info_->workarounds().max_vertex_uniform_vectors)); } program_manager_.reset(new ProgramManager( diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index b488318..15d8ca0 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -95,6 +95,13 @@ void StringToWorkarounds( workarounds->max_cube_map_texture_size = 1024; if (workarounds->max_cube_map_texture_size_limit_512) workarounds->max_cube_map_texture_size = 512; + + if (workarounds->max_fragment_uniform_vectors_32) + workarounds->max_fragment_uniform_vectors = 32; + if (workarounds->max_varying_vectors_16) + workarounds->max_varying_vectors = 16; + if (workarounds->max_vertex_uniform_vectors_256) + workarounds->max_vertex_uniform_vectors = 256; } } // anonymous namespace. @@ -144,7 +151,10 @@ FeatureInfo::Workarounds::Workarounds() : GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) #undef GPU_OP max_texture_size(0), - max_cube_map_texture_size(0) { + max_cube_map_texture_size(0), + max_fragment_uniform_vectors(0), + max_varying_vectors(0), + max_vertex_uniform_vectors(0) { } FeatureInfo::FeatureInfo() { diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index b9ac853..8e9c07c 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h @@ -81,6 +81,9 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { // Note: 0 here means use driver limit. GLint max_texture_size; GLint max_cube_map_texture_size; + GLint max_fragment_uniform_vectors; + GLint max_varying_vectors; + GLint max_vertex_uniform_vectors; }; // Constructor with workarounds taken from the current process's CommandLine diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc index aee1325..be3dbfd 100644 --- a/gpu/config/gpu_driver_bug_list_json.cc +++ b/gpu/config/gpu_driver_bug_list_json.cc @@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST( { "name": "gpu driver bug list", // Please update the version number whenever you change this file. - "version": "4.10", + "version": "4.11", "entries": [ { "id": 1, @@ -919,6 +919,20 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST( "features": [ "disable_post_sub_buffers_for_onscreen_surfaces" ] + }, + { + "id": 69, + "description": "Some shaders in Skia need more than the min available vertex and fragment shader uniform vectors in case of OSMesa", + "cr_bugs": [174845], + "driver_vendor": { + "op": "=", + "value": "osmesa" + }, + "features": [ + "max_fragment_uniform_vectors_32", + "max_varying_vectors_16", + "max_vertex_uniform_vectors_256" + ] } ] } diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h index 85776e2..06fa15b 100644 --- a/gpu/config/gpu_driver_bug_workaround_type.h +++ b/gpu/config/gpu_driver_bug_workaround_type.h @@ -62,8 +62,14 @@ max_cube_map_texture_size_limit_4096) \ GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512, \ max_cube_map_texture_size_limit_512) \ + GPU_OP(MAX_FRAGMENT_UNIFORM_VECTORS_32, \ + max_fragment_uniform_vectors_32) \ GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \ max_texture_size_limit_4096) \ + GPU_OP(MAX_VARYING_VECTORS_16, \ + max_varying_vectors_16) \ + GPU_OP(MAX_VERTEX_UNIFORM_VECTORS_256, \ + max_vertex_uniform_vectors_256) \ GPU_OP(NEEDS_GLSL_BUILT_IN_FUNCTION_EMULATION, \ needs_glsl_built_in_function_emulation) \ GPU_OP(NEEDS_OFFSCREEN_BUFFER_WORKAROUND, \ |