OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/config/gpu_driver_bug_workarounds.h" | 5 #include "gpu/config/gpu_driver_bug_workarounds.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "gpu/config/gpu_switches.h" | 10 #include "gpu/config/gpu_switches.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 workarounds->name = true; \ | 26 workarounds->name = true; \ |
27 break; | 27 break; |
28 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 28 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
29 #undef GPU_OP | 29 #undef GPU_OP |
30 default: | 30 default: |
31 NOTIMPLEMENTED(); | 31 NOTIMPLEMENTED(); |
32 } | 32 } |
33 } | 33 } |
34 if (workarounds->max_texture_size_limit_4096) | 34 if (workarounds->max_texture_size_limit_4096) |
35 workarounds->max_texture_size = 4096; | 35 workarounds->max_texture_size = 4096; |
36 if (workarounds->max_cube_map_texture_size_limit_4096) | |
37 workarounds->max_cube_map_texture_size = 4096; | |
38 if (workarounds->max_cube_map_texture_size_limit_1024) | |
39 workarounds->max_cube_map_texture_size = 1024; | |
40 if (workarounds->max_cube_map_texture_size_limit_512) | |
41 workarounds->max_cube_map_texture_size = 512; | |
42 | 36 |
43 if (workarounds->max_fragment_uniform_vectors_32) | 37 if (workarounds->max_fragment_uniform_vectors_32) |
44 workarounds->max_fragment_uniform_vectors = 32; | 38 workarounds->max_fragment_uniform_vectors = 32; |
45 if (workarounds->max_varying_vectors_16) | 39 if (workarounds->max_varying_vectors_16) |
46 workarounds->max_varying_vectors = 16; | 40 workarounds->max_varying_vectors = 16; |
47 if (workarounds->max_vertex_uniform_vectors_256) | 41 if (workarounds->max_vertex_uniform_vectors_256) |
48 workarounds->max_vertex_uniform_vectors = 256; | 42 workarounds->max_vertex_uniform_vectors = 256; |
49 | 43 |
50 if (workarounds->max_copy_texture_chromium_size_1048576) | 44 if (workarounds->max_copy_texture_chromium_size_1048576) |
51 workarounds->max_copy_texture_chromium_size = 1048576; | 45 workarounds->max_copy_texture_chromium_size = 1048576; |
52 if (workarounds->max_copy_texture_chromium_size_262144) | 46 if (workarounds->max_copy_texture_chromium_size_262144) |
53 workarounds->max_copy_texture_chromium_size = 262144; | 47 workarounds->max_copy_texture_chromium_size = 262144; |
54 } | 48 } |
55 | 49 |
56 } // anonymous namespace | 50 } // anonymous namespace |
57 | 51 |
58 namespace gpu { | 52 namespace gpu { |
59 | 53 |
60 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds() | 54 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds() |
61 : | 55 : |
62 #define GPU_OP(type, name) name(false), | 56 #define GPU_OP(type, name) name(false), |
63 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 57 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
64 #undef GPU_OP | 58 #undef GPU_OP |
65 max_texture_size(0), | 59 max_texture_size(0), |
66 max_cube_map_texture_size(0), | |
67 max_fragment_uniform_vectors(0), | 60 max_fragment_uniform_vectors(0), |
68 max_varying_vectors(0), | 61 max_varying_vectors(0), |
69 max_vertex_uniform_vectors(0), | 62 max_vertex_uniform_vectors(0), |
70 max_copy_texture_chromium_size(0) { | 63 max_copy_texture_chromium_size(0) { |
71 } | 64 } |
72 | 65 |
73 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( | 66 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( |
74 const base::CommandLine* command_line) | 67 const base::CommandLine* command_line) |
75 : | 68 : |
76 #define GPU_OP(type, name) name(false), | 69 #define GPU_OP(type, name) name(false), |
77 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 70 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
78 #undef GPU_OP | 71 #undef GPU_OP |
79 max_texture_size(0), | 72 max_texture_size(0), |
80 max_cube_map_texture_size(0), | |
81 max_fragment_uniform_vectors(0), | 73 max_fragment_uniform_vectors(0), |
82 max_varying_vectors(0), | 74 max_varying_vectors(0), |
83 max_vertex_uniform_vectors(0), | 75 max_vertex_uniform_vectors(0), |
84 max_copy_texture_chromium_size(0) { | 76 max_copy_texture_chromium_size(0) { |
85 if (!command_line) | 77 if (!command_line) |
86 return; | 78 return; |
87 | 79 |
88 std::string types = | 80 std::string types = |
89 command_line->GetSwitchValueASCII(switches::kGpuDriverBugWorkarounds); | 81 command_line->GetSwitchValueASCII(switches::kGpuDriverBugWorkarounds); |
90 StringToWorkarounds(types, this); | 82 StringToWorkarounds(types, this); |
91 } | 83 } |
92 | 84 |
93 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( | 85 GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( |
94 const GpuDriverBugWorkarounds& other) = default; | 86 const GpuDriverBugWorkarounds& other) = default; |
95 | 87 |
96 GpuDriverBugWorkarounds::~GpuDriverBugWorkarounds() {} | 88 GpuDriverBugWorkarounds::~GpuDriverBugWorkarounds() {} |
97 | 89 |
98 } // namespace gpu | 90 } // namespace gpu |
OLD | NEW |