summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'gpu')
-rw-r--r--gpu/config/gpu_info_collector_win.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/gpu/config/gpu_info_collector_win.cc b/gpu/config/gpu_info_collector_win.cc
index 53343f6..eabf9b2 100644
--- a/gpu/config/gpu_info_collector_win.cc
+++ b/gpu/config/gpu_info_collector_win.cc
@@ -665,6 +665,45 @@ void MergeGPUInfo(GPUInfo* basic_gpu_info,
return;
}
+ // Track D3D Shader Model (if available)
+ const std::string& shader_version =
+ context_gpu_info.vertex_shader_version;
+
+ // Only gather if this is the first time we're seeing
+ // a non-empty shader version string.
+ if (!shader_version.empty() &&
+ basic_gpu_info->vertex_shader_version.empty()) {
+
+ // Note: do not reorder, used by UMA_HISTOGRAM below
+ enum ShaderModel {
+ SHADER_MODEL_UNKNOWN,
+ SHADER_MODEL_2_0,
+ SHADER_MODEL_3_0,
+ SHADER_MODEL_4_0,
+ SHADER_MODEL_4_1,
+ SHADER_MODEL_5_0,
+ NUM_SHADER_MODELS
+ };
+
+ ShaderModel shader_model = SHADER_MODEL_UNKNOWN;
+
+ if (shader_version == "5.0") {
+ shader_model = SHADER_MODEL_5_0;
+ } else if (shader_version == "4.1") {
+ shader_model = SHADER_MODEL_4_1;
+ } else if (shader_version == "4.0") {
+ shader_model = SHADER_MODEL_4_0;
+ } else if (shader_version == "3.0") {
+ shader_model = SHADER_MODEL_3_0;
+ } else if (shader_version == "2.0") {
+ shader_model = SHADER_MODEL_2_0;
+ }
+
+ UMA_HISTOGRAM_ENUMERATION("GPU.D3DShaderModel",
+ shader_model,
+ NUM_SHADER_MODELS);
+ }
+
MergeGPUInfoGL(basic_gpu_info, context_gpu_info);
basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics;