| 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/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
| 6 | 6 |
| 7 // This has to be included before windows.h. | 7 // This has to be included before windows.h. |
| 8 #include "third_party/re2/re2/re2.h" | 8 #include "third_party/re2/re2/re2.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 658 |
| 659 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 659 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
| 660 const GPUInfo& context_gpu_info) { | 660 const GPUInfo& context_gpu_info) { |
| 661 DCHECK(basic_gpu_info); | 661 DCHECK(basic_gpu_info); |
| 662 | 662 |
| 663 if (context_gpu_info.software_rendering) { | 663 if (context_gpu_info.software_rendering) { |
| 664 basic_gpu_info->software_rendering = true; | 664 basic_gpu_info->software_rendering = true; |
| 665 return; | 665 return; |
| 666 } | 666 } |
| 667 | 667 |
| 668 // Track D3D Shader Model (if available) |
| 669 const std::string& shader_version = |
| 670 context_gpu_info.vertex_shader_version; |
| 671 |
| 672 // Only gather if this is the first time we're seeing |
| 673 // a non-empty shader version string. |
| 674 if (!shader_version.empty() && |
| 675 basic_gpu_info->vertex_shader_version.empty()) { |
| 676 |
| 677 // Note: do not reorder, used by UMA_HISTOGRAM below |
| 678 enum ShaderModel { |
| 679 SHADER_MODEL_UNKNOWN, |
| 680 SHADER_MODEL_2_0, |
| 681 SHADER_MODEL_3_0, |
| 682 SHADER_MODEL_4_0, |
| 683 SHADER_MODEL_4_1, |
| 684 SHADER_MODEL_5_0, |
| 685 NUM_SHADER_MODELS |
| 686 }; |
| 687 |
| 688 ShaderModel shader_model = SHADER_MODEL_UNKNOWN; |
| 689 |
| 690 if (shader_version == "5.0") { |
| 691 shader_model = SHADER_MODEL_5_0; |
| 692 } else if (shader_version == "4.1") { |
| 693 shader_model = SHADER_MODEL_4_1; |
| 694 } else if (shader_version == "4.0") { |
| 695 shader_model = SHADER_MODEL_4_0; |
| 696 } else if (shader_version == "3.0") { |
| 697 shader_model = SHADER_MODEL_3_0; |
| 698 } else if (shader_version == "2.0") { |
| 699 shader_model = SHADER_MODEL_2_0; |
| 700 } |
| 701 |
| 702 UMA_HISTOGRAM_ENUMERATION("GPU.D3DShaderModel", |
| 703 shader_model, |
| 704 NUM_SHADER_MODELS); |
| 705 } |
| 706 |
| 668 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 707 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 669 | 708 |
| 670 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; | 709 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; |
| 671 } | 710 } |
| 672 | 711 |
| 673 } // namespace gpu | 712 } // namespace gpu |
| OLD | NEW |