Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index acf8c7b9d091467586f84da7dabd818dfbefaa32..97514fd4dc603a3f9d6c102b1cf8e4a5385ef91e 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -80,50 +80,6 @@ class StringSet {
std::set<std::string> string_set_;
};
-// Process a string of wordaround type IDs (seperated by ',') and set up
-// the corresponding Workaround flags.
-void StringToWorkarounds(
- const std::string& types, FeatureInfo::Workarounds* workarounds) {
- DCHECK(workarounds);
- for (const base::StringPiece& piece :
- base::SplitStringPiece(
- types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
- int number = 0;
- bool succeed = base::StringToInt(piece, &number);
- DCHECK(succeed);
- switch (number) {
-#define GPU_OP(type, name) \
- case gpu::type: \
- workarounds->name = true; \
- break;
- GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
-#undef GPU_OP
- default:
- NOTIMPLEMENTED();
- }
- }
- if (workarounds->max_texture_size_limit_4096)
- workarounds->max_texture_size = 4096;
- if (workarounds->max_cube_map_texture_size_limit_4096)
- workarounds->max_cube_map_texture_size = 4096;
- if (workarounds->max_cube_map_texture_size_limit_1024)
- 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;
-
- if (workarounds->max_copy_texture_chromium_size_1048576)
- workarounds->max_copy_texture_chromium_size = 1048576;
- if (workarounds->max_copy_texture_chromium_size_262144)
- workarounds->max_copy_texture_chromium_size = 262144;
-}
-
} // anonymous namespace.
FeatureInfo::FeatureFlags::FeatureFlags()
@@ -181,25 +137,24 @@ FeatureInfo::FeatureFlags::FeatureFlags()
ext_blend_func_extended(false),
ext_read_format_bgra(false) {}
-FeatureInfo::Workarounds::Workarounds() :
-#define GPU_OP(type, name) name(false),
- GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
-#undef GPU_OP
- max_texture_size(0),
- max_cube_map_texture_size(0),
- max_fragment_uniform_vectors(0),
- max_varying_vectors(0),
- max_vertex_uniform_vectors(0),
- max_copy_texture_chromium_size(0) {
+FeatureInfo::FeatureInfo() {
+ InitializeBasicState(base::CommandLine::InitializedForCurrentProcess()
+ ? base::CommandLine::ForCurrentProcess()
+ : nullptr);
}
-FeatureInfo::FeatureInfo() {
+FeatureInfo::FeatureInfo(
+ const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds)
+ : workarounds_(gpu_driver_bug_workarounds) {
InitializeBasicState(base::CommandLine::InitializedForCurrentProcess()
? base::CommandLine::ForCurrentProcess()
: nullptr);
}
-FeatureInfo::FeatureInfo(const base::CommandLine& command_line) {
+FeatureInfo::FeatureInfo(
+ const base::CommandLine& command_line,
+ const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds)
+ : workarounds_(gpu_driver_bug_workarounds) {
InitializeBasicState(&command_line);
}
@@ -207,11 +162,6 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
if (!command_line)
return;
- if (command_line->HasSwitch(switches::kGpuDriverBugWorkarounds)) {
- std::string types = command_line->GetSwitchValueASCII(
- switches::kGpuDriverBugWorkarounds);
- StringToWorkarounds(types, &workarounds_);
- }
feature_flags_.enable_shader_name_hashing =
!command_line->HasSwitch(switches::kDisableShaderNameHashing);
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698