OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 static GLenum string_ids[] = { | 160 static GLenum string_ids[] = { |
161 GL_VENDOR, | 161 GL_VENDOR, |
162 GL_RENDERER, | 162 GL_RENDERER, |
163 }; | 163 }; |
164 bool is_intel = false; | 164 bool is_intel = false; |
165 bool is_nvidia = false; | 165 bool is_nvidia = false; |
166 bool is_amd = false; | 166 bool is_amd = false; |
167 bool is_mesa = false; | 167 bool is_mesa = false; |
168 bool is_qualcomm = false; | 168 bool is_qualcomm = false; |
| 169 bool is_imagination = false; |
169 for (size_t ii = 0; ii < arraysize(string_ids); ++ii) { | 170 for (size_t ii = 0; ii < arraysize(string_ids); ++ii) { |
170 const char* str = reinterpret_cast<const char*>( | 171 const char* str = reinterpret_cast<const char*>( |
171 glGetString(string_ids[ii])); | 172 glGetString(string_ids[ii])); |
172 if (str) { | 173 if (str) { |
173 std::string lstr(StringToLowerASCII(std::string(str))); | 174 std::string lstr(StringToLowerASCII(std::string(str))); |
174 StringSet string_set(lstr); | 175 StringSet string_set(lstr); |
175 is_intel |= string_set.Contains("intel"); | 176 is_intel |= string_set.Contains("intel"); |
176 is_nvidia |= string_set.Contains("nvidia"); | 177 is_nvidia |= string_set.Contains("nvidia"); |
177 is_amd |= string_set.Contains("amd") || string_set.Contains("ati"); | 178 is_amd |= string_set.Contains("amd") || string_set.Contains("ati"); |
178 is_mesa |= string_set.Contains("mesa"); | 179 is_mesa |= string_set.Contains("mesa"); |
179 is_qualcomm |= string_set.Contains("qualcomm"); | 180 is_qualcomm |= string_set.Contains("qualcomm"); |
| 181 is_imagination |= string_set.Contains("imagination"); |
180 } | 182 } |
181 } | 183 } |
182 | 184 |
183 feature_flags_.disable_workarounds = | 185 feature_flags_.disable_workarounds = |
184 CommandLine::ForCurrentProcess()->HasSwitch( | 186 CommandLine::ForCurrentProcess()->HasSwitch( |
185 switches::kDisableGpuDriverBugWorkarounds); | 187 switches::kDisableGpuDriverBugWorkarounds); |
186 | 188 |
187 feature_flags_.enable_shader_name_hashing = | 189 feature_flags_.enable_shader_name_hashing = |
188 !CommandLine::ForCurrentProcess()->HasSwitch( | 190 !CommandLine::ForCurrentProcess()->HasSwitch( |
189 switches::kDisableShaderNameHashing); | 191 switches::kDisableShaderNameHashing); |
(...skipping 13 matching lines...) Expand all Loading... |
203 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); | 205 AddExtensionString("GL_CHROMIUM_pixel_transfer_buffer_object"); |
204 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); | 206 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); |
205 AddExtensionString("GL_CHROMIUM_resize"); | 207 AddExtensionString("GL_CHROMIUM_resize"); |
206 AddExtensionString("GL_CHROMIUM_resource_safe"); | 208 AddExtensionString("GL_CHROMIUM_resource_safe"); |
207 AddExtensionString("GL_CHROMIUM_set_visibility"); | 209 AddExtensionString("GL_CHROMIUM_set_visibility"); |
208 AddExtensionString("GL_CHROMIUM_strict_attribs"); | 210 AddExtensionString("GL_CHROMIUM_strict_attribs"); |
209 AddExtensionString("GL_CHROMIUM_stream_texture"); | 211 AddExtensionString("GL_CHROMIUM_stream_texture"); |
210 AddExtensionString("GL_CHROMIUM_texture_mailbox"); | 212 AddExtensionString("GL_CHROMIUM_texture_mailbox"); |
211 AddExtensionString("GL_EXT_debug_marker"); | 213 AddExtensionString("GL_EXT_debug_marker"); |
212 | 214 |
| 215 // Add extension to indicate fast-path texture uploads. This is |
| 216 // for IMG, where everything except async + non-power-of-two + |
| 217 // multiple-of-eight textures are brutally slow. |
| 218 if (is_imagination) |
| 219 AddExtensionString("GL_CHROMIUM_fast_NPOT_MO8_textures"); |
| 220 |
213 feature_flags_.chromium_stream_texture = true; | 221 feature_flags_.chromium_stream_texture = true; |
214 | 222 |
215 // OES_vertex_array_object is emulated if not present natively, | 223 // OES_vertex_array_object is emulated if not present natively, |
216 // so the extension string is always exposed. | 224 // so the extension string is always exposed. |
217 AddExtensionString("GL_OES_vertex_array_object"); | 225 AddExtensionString("GL_OES_vertex_array_object"); |
218 | 226 |
219 if (!disallowed_features_.gpu_memory_manager) | 227 if (!disallowed_features_.gpu_memory_manager) |
220 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); | 228 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); |
221 | 229 |
222 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { | 230 if (extensions.Contains("GL_ANGLE_translated_shader_source")) { |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 if (extensions_.find(str) == std::string::npos) { | 651 if (extensions_.find(str) == std::string::npos) { |
644 extensions_ += (extensions_.empty() ? "" : " ") + str; | 652 extensions_ += (extensions_.empty() ? "" : " ") + str; |
645 } | 653 } |
646 } | 654 } |
647 | 655 |
648 FeatureInfo::~FeatureInfo() { | 656 FeatureInfo::~FeatureInfo() { |
649 } | 657 } |
650 | 658 |
651 } // namespace gles2 | 659 } // namespace gles2 |
652 } // namespace gpu | 660 } // namespace gpu |
OLD | NEW |