[email protected] | 84ad3a7 | 2012-02-07 00:29:45 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
avi | f15d60a | 2015-12-21 17:06:33 | [diff] [blame] | 5 | #include <stdint.h> |
| 6 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 7 | #include "gpu/config/gpu_info.h" |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 8 | |
Miguel Casas | 28ee90f | 2019-05-28 19:12:26 | [diff] [blame^] | 9 | #include "ui/gfx/buffer_format_util.h" |
| 10 | |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 11 | namespace { |
| 12 | |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 13 | void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device, |
| 14 | gpu::GPUInfo::Enumerator* enumerator) { |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 15 | enumerator->BeginGPUDevice(); |
| 16 | enumerator->AddInt("vendorId", device.vendor_id); |
| 17 | enumerator->AddInt("deviceId", device.device_id); |
[email protected] | 20e7cfc | 2014-04-02 17:33:13 | [diff] [blame] | 18 | enumerator->AddBool("active", device.active); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 19 | enumerator->AddString("vendorString", device.vendor_string); |
| 20 | enumerator->AddString("deviceString", device.device_string); |
Zhenyao Mo | fbea81d | 2018-06-01 17:29:27 | [diff] [blame] | 21 | enumerator->AddString("driverVendor", device.driver_vendor); |
| 22 | enumerator->AddString("driverVersion", device.driver_version); |
| 23 | enumerator->AddString("driverDate", device.driver_date); |
Olli Etuaho | 1241aea | 2018-08-09 07:49:15 | [diff] [blame] | 24 | enumerator->AddInt("cudaComputeCapabilityMajor", |
| 25 | device.cuda_compute_capability_major); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 26 | enumerator->EndGPUDevice(); |
| 27 | } |
| 28 | |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 29 | void EnumerateVideoDecodeAcceleratorSupportedProfile( |
| 30 | const gpu::VideoDecodeAcceleratorSupportedProfile& profile, |
| 31 | gpu::GPUInfo::Enumerator* enumerator) { |
| 32 | enumerator->BeginVideoDecodeAcceleratorSupportedProfile(); |
| 33 | enumerator->AddInt("profile", profile.profile); |
| 34 | enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); |
| 35 | enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); |
| 36 | enumerator->AddInt("minResolutionWidth", profile.min_resolution.width()); |
| 37 | enumerator->AddInt("minResolutionHeight", profile.min_resolution.height()); |
dalecurtis | 4708098a | 2016-03-19 04:54:11 | [diff] [blame] | 38 | enumerator->AddBool("encrypted_only", profile.encrypted_only); |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 39 | enumerator->EndVideoDecodeAcceleratorSupportedProfile(); |
| 40 | } |
| 41 | |
wuchengli | 7980832 | 2014-09-23 05:58:14 | [diff] [blame] | 42 | void EnumerateVideoEncodeAcceleratorSupportedProfile( |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 43 | const gpu::VideoEncodeAcceleratorSupportedProfile& profile, |
| 44 | gpu::GPUInfo::Enumerator* enumerator) { |
wuchengli | 7980832 | 2014-09-23 05:58:14 | [diff] [blame] | 45 | enumerator->BeginVideoEncodeAcceleratorSupportedProfile(); |
| 46 | enumerator->AddInt("profile", profile.profile); |
| 47 | enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); |
| 48 | enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); |
| 49 | enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator); |
| 50 | enumerator->AddInt("maxFramerateDenominator", |
| 51 | profile.max_framerate_denominator); |
| 52 | enumerator->EndVideoEncodeAcceleratorSupportedProfile(); |
| 53 | } |
| 54 | |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 55 | const char* ImageDecodeAcceleratorTypeToString( |
| 56 | gpu::ImageDecodeAcceleratorType type) { |
| 57 | switch (type) { |
| 58 | case gpu::ImageDecodeAcceleratorType::kJpeg: |
| 59 | return "JPEG"; |
| 60 | case gpu::ImageDecodeAcceleratorType::kUnknown: |
| 61 | return "Unknown"; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | const char* ImageDecodeAcceleratorSubsamplingToString( |
| 66 | gpu::ImageDecodeAcceleratorSubsampling subsampling) { |
| 67 | switch (subsampling) { |
| 68 | case gpu::ImageDecodeAcceleratorSubsampling::k420: |
| 69 | return "4:2:0"; |
| 70 | case gpu::ImageDecodeAcceleratorSubsampling::k422: |
| 71 | return "4:2:2"; |
Andres Calderon Jaramillo | 4fdf6c4 | 2019-03-21 15:45:06 | [diff] [blame] | 72 | case gpu::ImageDecodeAcceleratorSubsampling::k444: |
| 73 | return "4:4:4"; |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 74 | } |
| 75 | } |
| 76 | |
| 77 | void EnumerateImageDecodeAcceleratorSupportedProfile( |
| 78 | const gpu::ImageDecodeAcceleratorSupportedProfile& profile, |
| 79 | gpu::GPUInfo::Enumerator* enumerator) { |
| 80 | enumerator->BeginImageDecodeAcceleratorSupportedProfile(); |
| 81 | enumerator->AddString("imageType", |
| 82 | ImageDecodeAcceleratorTypeToString(profile.image_type)); |
| 83 | enumerator->AddString("minEncodedDimensions", |
| 84 | profile.min_encoded_dimensions.ToString()); |
| 85 | enumerator->AddString("maxEncodedDimensions", |
| 86 | profile.max_encoded_dimensions.ToString()); |
| 87 | std::string subsamplings; |
| 88 | for (size_t i = 0; i < profile.subsamplings.size(); i++) { |
| 89 | if (i > 0) |
| 90 | subsamplings += ", "; |
| 91 | subsamplings += |
| 92 | ImageDecodeAcceleratorSubsamplingToString(profile.subsamplings[i]); |
| 93 | } |
| 94 | enumerator->AddString("subsamplings", subsamplings); |
| 95 | enumerator->EndImageDecodeAcceleratorSupportedProfile(); |
| 96 | } |
| 97 | |
Sunny Sachanandani | fc66e9a | 2018-07-10 18:08:29 | [diff] [blame] | 98 | #if defined(OS_WIN) |
Zhenyao Mo | da88bdc | 2018-09-27 01:47:33 | [diff] [blame] | 99 | void EnumerateDx12VulkanVersionInfo(const gpu::Dx12VulkanVersionInfo& info, |
| 100 | gpu::GPUInfo::Enumerator* enumerator) { |
| 101 | enumerator->BeginDx12VulkanVersionInfo(); |
| 102 | enumerator->AddBool("supportsDx12", info.supports_dx12); |
| 103 | enumerator->AddBool("supportsVulkan", info.supports_vulkan); |
| 104 | enumerator->AddInt("dx12FeatureLevel", |
| 105 | static_cast<int>(info.d3d12_feature_level)); |
| 106 | enumerator->AddInt("vulkanVersion", static_cast<int>(info.vulkan_version)); |
| 107 | enumerator->EndDx12VulkanVersionInfo(); |
| 108 | } |
Sunny Sachanandani | fc66e9a | 2018-07-10 18:08:29 | [diff] [blame] | 109 | #endif |
| 110 | |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 111 | } // namespace |
| 112 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 113 | namespace gpu { |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 114 | |
Sunny Sachanandani | 3dcb5da | 2018-10-18 04:59:43 | [diff] [blame] | 115 | #if defined(OS_WIN) |
Zhenyao Mo | 4178e19 | 2019-05-16 21:46:11 | [diff] [blame] | 116 | const char* OverlaySupportToString(gpu::OverlaySupport support) { |
| 117 | switch (support) { |
| 118 | case gpu::OverlaySupport::kNone: |
| 119 | return "NONE"; |
| 120 | case gpu::OverlaySupport::kDirect: |
| 121 | return "DIRECT"; |
| 122 | case gpu::OverlaySupport::kScaling: |
| 123 | return "SCALING"; |
Sunny Sachanandani | fc66e9a | 2018-07-10 18:08:29 | [diff] [blame] | 124 | } |
Sunny Sachanandani | fc66e9a | 2018-07-10 18:08:29 | [diff] [blame] | 125 | } |
Zhenyao Mo | 4178e19 | 2019-05-16 21:46:11 | [diff] [blame] | 126 | #endif // OS_WIN |
Sunny Sachanandani | fc66e9a | 2018-07-10 18:08:29 | [diff] [blame] | 127 | |
liberato | 57587790 | 2015-12-10 17:16:26 | [diff] [blame] | 128 | VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities() |
| 129 | : flags(0) {} |
| 130 | |
vmpstr | 3b7b8b2 | 2016-03-01 23:00:20 | [diff] [blame] | 131 | VideoDecodeAcceleratorCapabilities::VideoDecodeAcceleratorCapabilities( |
| 132 | const VideoDecodeAcceleratorCapabilities& other) = default; |
| 133 | |
Chris Watkins | 8103077 | 2017-12-07 01:20:56 | [diff] [blame] | 134 | VideoDecodeAcceleratorCapabilities::~VideoDecodeAcceleratorCapabilities() = |
| 135 | default; |
liberato | 57587790 | 2015-12-10 17:16:26 | [diff] [blame] | 136 | |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 137 | ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile() |
| 138 | : image_type(ImageDecodeAcceleratorType::kUnknown) {} |
| 139 | |
| 140 | ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile( |
| 141 | const ImageDecodeAcceleratorSupportedProfile& other) = default; |
| 142 | |
| 143 | ImageDecodeAcceleratorSupportedProfile::ImageDecodeAcceleratorSupportedProfile( |
| 144 | ImageDecodeAcceleratorSupportedProfile&& other) = default; |
| 145 | |
| 146 | ImageDecodeAcceleratorSupportedProfile:: |
| 147 | ~ImageDecodeAcceleratorSupportedProfile() = default; |
| 148 | |
| 149 | ImageDecodeAcceleratorSupportedProfile& ImageDecodeAcceleratorSupportedProfile:: |
| 150 | operator=(const ImageDecodeAcceleratorSupportedProfile& other) = default; |
| 151 | |
| 152 | ImageDecodeAcceleratorSupportedProfile& ImageDecodeAcceleratorSupportedProfile:: |
| 153 | operator=(ImageDecodeAcceleratorSupportedProfile&& other) = default; |
| 154 | |
[email protected] | a094e2c | 2012-05-10 23:02:42 | [diff] [blame] | 155 | GPUInfo::GPUDevice::GPUDevice() |
| 156 | : vendor_id(0), |
[email protected] | 20e7cfc | 2014-04-02 17:33:13 | [diff] [blame] | 157 | device_id(0), |
Olli Etuaho | 1241aea | 2018-08-09 07:49:15 | [diff] [blame] | 158 | active(false), |
| 159 | cuda_compute_capability_major(0) {} |
[email protected] | a094e2c | 2012-05-10 23:02:42 | [diff] [blame] | 160 | |
Zhenyao Mo | fbea81d | 2018-06-01 17:29:27 | [diff] [blame] | 161 | GPUInfo::GPUDevice::GPUDevice(const GPUInfo::GPUDevice& other) = default; |
| 162 | |
| 163 | GPUInfo::GPUDevice::GPUDevice(GPUInfo::GPUDevice&& other) noexcept = default; |
| 164 | |
| 165 | GPUInfo::GPUDevice::~GPUDevice() noexcept = default; |
| 166 | |
| 167 | GPUInfo::GPUDevice& GPUInfo::GPUDevice::operator=( |
| 168 | const GPUInfo::GPUDevice& other) = default; |
| 169 | |
| 170 | GPUInfo::GPUDevice& GPUInfo::GPUDevice::operator=( |
| 171 | GPUInfo::GPUDevice&& other) noexcept = default; |
[email protected] | a094e2c | 2012-05-10 23:02:42 | [diff] [blame] | 172 | |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 173 | GPUInfo::GPUInfo() |
zmo | 84eae5e | 2014-09-05 01:36:23 | [diff] [blame] | 174 | : optimus(false), |
[email protected] | c32b0c2c | 2012-04-07 01:34:33 | [diff] [blame] | 175 | amd_switchable(false), |
[email protected] | 6c7784e | 2013-08-01 22:41:28 | [diff] [blame] | 176 | gl_reset_notification_strategy(0), |
[email protected] | fad3ccf | 2012-09-11 22:36:00 | [diff] [blame] | 177 | software_rendering(false), |
[email protected] | 4775298 | 2014-07-29 08:01:43 | [diff] [blame] | 178 | sandboxed(false), |
bajones | e3677b649ff | 2015-07-25 00:41:56 | [diff] [blame] | 179 | in_process_gpu(true), |
geofflang | 774e87a | 2016-12-05 16:29:01 | [diff] [blame] | 180 | passthrough_cmd_decoder(false), |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 181 | jpeg_decode_accelerator_supported(false), |
Antonio Gomes | 5b4d98e | 2017-08-24 05:53:07 | [diff] [blame] | 182 | #if defined(USE_X11) |
thomasanderson | 62ba78ff | 2016-10-01 02:03:42 | [diff] [blame] | 183 | system_visual(0), |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 184 | rgba_visual(0), |
thomasanderson | 62ba78ff | 2016-10-01 02:03:42 | [diff] [blame] | 185 | #endif |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 186 | oop_rasterization_supported(false) { |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 187 | } |
| 188 | |
vmpstr | 3b7b8b2 | 2016-03-01 23:00:20 | [diff] [blame] | 189 | GPUInfo::GPUInfo(const GPUInfo& other) = default; |
| 190 | |
Chris Watkins | 8103077 | 2017-12-07 01:20:56 | [diff] [blame] | 191 | GPUInfo::~GPUInfo() = default; |
[email protected] | a80f5ece | 2011-10-20 23:56:55 | [diff] [blame] | 192 | |
Zhenyao Mo | fbea81d | 2018-06-01 17:29:27 | [diff] [blame] | 193 | GPUInfo::GPUDevice& GPUInfo::active_gpu() { |
| 194 | return const_cast<GPUInfo::GPUDevice&>( |
| 195 | const_cast<const GPUInfo&>(*this).active_gpu()); |
| 196 | } |
| 197 | |
ccameron | 8c3b0dd13 | 2017-05-16 19:30:50 | [diff] [blame] | 198 | const GPUInfo::GPUDevice& GPUInfo::active_gpu() const { |
Zhenyao Mo | c4f79c3 | 2018-01-27 02:44:13 | [diff] [blame] | 199 | if (gpu.active || secondary_gpus.empty()) |
ccameron | 8c3b0dd13 | 2017-05-16 19:30:50 | [diff] [blame] | 200 | return gpu; |
Zhenyao Mo | fbea81d | 2018-06-01 17:29:27 | [diff] [blame] | 201 | for (const auto& secondary_gpu : secondary_gpus) { |
ccameron | 8c3b0dd13 | 2017-05-16 19:30:50 | [diff] [blame] | 202 | if (secondary_gpu.active) |
| 203 | return secondary_gpu; |
| 204 | } |
Zhenyao Mo | fbea81d | 2018-06-01 17:29:27 | [diff] [blame] | 205 | DVLOG(2) << "No active GPU found, returning primary GPU."; |
ccameron | 8c3b0dd13 | 2017-05-16 19:30:50 | [diff] [blame] | 206 | return gpu; |
| 207 | } |
| 208 | |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 209 | bool GPUInfo::IsInitialized() const { |
| 210 | return gpu.vendor_id != 0 || !gl_vendor.empty(); |
| 211 | } |
| 212 | |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 213 | void GPUInfo::EnumerateFields(Enumerator* enumerator) const { |
| 214 | struct GPUInfoKnownFields { |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 215 | base::TimeDelta initialization_time; |
| 216 | bool optimus; |
| 217 | bool amd_switchable; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 218 | GPUDevice gpu; |
| 219 | std::vector<GPUDevice> secondary_gpus; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 220 | std::string pixel_shader_version; |
| 221 | std::string vertex_shader_version; |
senorblanco | b7a64d57 | 2015-04-08 16:59:02 | [diff] [blame] | 222 | std::string max_msaa_samples; |
[email protected] | 2ac8e51c | 2014-04-21 20:54:13 | [diff] [blame] | 223 | std::string machine_model_name; |
| 224 | std::string machine_model_version; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 225 | std::string gl_version_string; |
| 226 | std::string gl_vendor; |
| 227 | std::string gl_renderer; |
| 228 | std::string gl_extensions; |
| 229 | std::string gl_ws_vendor; |
| 230 | std::string gl_ws_version; |
| 231 | std::string gl_ws_extensions; |
avi | f15d60a | 2015-12-21 17:06:33 | [diff] [blame] | 232 | uint32_t gl_reset_notification_strategy; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 233 | bool software_rendering; |
Jonathan Backer | 0129383 | 2019-03-20 20:27:10 | [diff] [blame] | 234 | std::string direct_rendering_version; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 235 | bool sandboxed; |
bajones | e3677b649ff | 2015-07-25 00:41:56 | [diff] [blame] | 236 | bool in_process_gpu; |
geofflang | 774e87a | 2016-12-05 16:29:01 | [diff] [blame] | 237 | bool passthrough_cmd_decoder; |
Bo Liu | 9cad099c | 2017-07-06 14:45:27 | [diff] [blame] | 238 | bool can_support_threaded_texture_mailbox; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 239 | #if defined(OS_WIN) |
Sunny Sachanandani | 6e844c4 | 2018-11-09 20:27:12 | [diff] [blame] | 240 | bool direct_composition; |
| 241 | bool supports_overlays; |
Zhenyao Mo | 4178e19 | 2019-05-16 21:46:11 | [diff] [blame] | 242 | OverlaySupport yuy2_overlay_support; |
| 243 | OverlaySupport nv12_overlay_support; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 244 | DxDiagNode dx_diagnostics; |
Zhenyao Mo | da88bdc | 2018-09-27 01:47:33 | [diff] [blame] | 245 | Dx12VulkanVersionInfo dx12_vulkan_version_info; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 246 | #endif |
Maggie Chen | 35d65e4a | 2018-04-12 21:15:25 | [diff] [blame] | 247 | |
liberato | 57587790 | 2015-12-10 17:16:26 | [diff] [blame] | 248 | VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities; |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 249 | VideoEncodeAcceleratorSupportedProfiles |
wuchengli | 7980832 | 2014-09-23 05:58:14 | [diff] [blame] | 250 | video_encode_accelerator_supported_profiles; |
henryhsu | 74f6ef1 | 2015-07-23 08:34:37 | [diff] [blame] | 251 | bool jpeg_decode_accelerator_supported; |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 252 | |
| 253 | ImageDecodeAcceleratorSupportedProfiles |
| 254 | image_decode_accelerator_supported_profiles; |
| 255 | |
Miguel Casas | 28ee90f | 2019-05-28 19:12:26 | [diff] [blame^] | 256 | std::vector<gfx::BufferFormat> |
| 257 | supported_buffer_formats_for_allocation_and_texturing; |
| 258 | |
Antonio Gomes | 5b4d98e | 2017-08-24 05:53:07 | [diff] [blame] | 259 | #if defined(USE_X11) |
thomasanderson | 62ba78ff | 2016-10-01 02:03:42 | [diff] [blame] | 260 | VisualID system_visual; |
| 261 | VisualID rgba_visual; |
| 262 | #endif |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 263 | |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 264 | bool oop_rasterization_supported; |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 265 | }; |
| 266 | |
| 267 | // If this assert fails then most likely something below needs to be updated. |
| 268 | // Note that this assert is only approximate. If a new field is added to |
| 269 | // GPUInfo which fits within the current padding then it will not be caught. |
mostynb | 7f03209 | 2014-12-20 00:36:44 | [diff] [blame] | 270 | static_assert( |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 271 | sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), |
mostynb | 7f03209 | 2014-12-20 00:36:44 | [diff] [blame] | 272 | "fields have changed in GPUInfo, GPUInfoKnownFields must be updated"); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 273 | |
| 274 | // Required fields (according to DevTools protocol) first. |
[email protected] | 2ac8e51c | 2014-04-21 20:54:13 | [diff] [blame] | 275 | enumerator->AddString("machineModelName", machine_model_name); |
| 276 | enumerator->AddString("machineModelVersion", machine_model_version); |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 277 | EnumerateGPUDevice(gpu, enumerator); |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 278 | for (const auto& secondary_gpu : secondary_gpus) |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 279 | EnumerateGPUDevice(secondary_gpu, enumerator); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 280 | |
| 281 | enumerator->BeginAuxAttributes(); |
Miguel Casas | 28ee90f | 2019-05-28 19:12:26 | [diff] [blame^] | 282 | enumerator->AddTimeDeltaInSecondsF("initializationTime", initialization_time); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 283 | enumerator->AddBool("optimus", optimus); |
| 284 | enumerator->AddBool("amdSwitchable", amd_switchable); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 285 | enumerator->AddString("pixelShaderVersion", pixel_shader_version); |
| 286 | enumerator->AddString("vertexShaderVersion", vertex_shader_version); |
senorblanco | b7a64d57 | 2015-04-08 16:59:02 | [diff] [blame] | 287 | enumerator->AddString("maxMsaaSamples", max_msaa_samples); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 288 | enumerator->AddString("glVersion", gl_version); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 289 | enumerator->AddString("glVendor", gl_vendor); |
| 290 | enumerator->AddString("glRenderer", gl_renderer); |
| 291 | enumerator->AddString("glExtensions", gl_extensions); |
| 292 | enumerator->AddString("glWsVendor", gl_ws_vendor); |
| 293 | enumerator->AddString("glWsVersion", gl_ws_version); |
| 294 | enumerator->AddString("glWsExtensions", gl_ws_extensions); |
| 295 | enumerator->AddInt( |
| 296 | "glResetNotificationStrategy", |
| 297 | static_cast<int>(gl_reset_notification_strategy)); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 298 | // TODO(kbr): add performance_stats. |
| 299 | enumerator->AddBool("softwareRendering", software_rendering); |
Jonathan Backer | 0129383 | 2019-03-20 20:27:10 | [diff] [blame] | 300 | enumerator->AddString("directRenderingVersion", direct_rendering_version); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 301 | enumerator->AddBool("sandboxed", sandboxed); |
bajones | e3677b649ff | 2015-07-25 00:41:56 | [diff] [blame] | 302 | enumerator->AddBool("inProcessGpu", in_process_gpu); |
geofflang | 774e87a | 2016-12-05 16:29:01 | [diff] [blame] | 303 | enumerator->AddBool("passthroughCmdDecoder", passthrough_cmd_decoder); |
Bo Liu | 9cad099c | 2017-07-06 14:45:27 | [diff] [blame] | 304 | enumerator->AddBool("canSupportThreadedTextureMailbox", |
| 305 | can_support_threaded_texture_mailbox); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 306 | // TODO(kbr): add dx_diagnostics on Windows. |
Maggie Chen | 35d65e4a | 2018-04-12 21:15:25 | [diff] [blame] | 307 | #if defined(OS_WIN) |
Sunny Sachanandani | 6e844c4 | 2018-11-09 20:27:12 | [diff] [blame] | 308 | enumerator->AddBool("directComposition", direct_composition); |
| 309 | enumerator->AddBool("supportsOverlays", supports_overlays); |
Zhenyao Mo | 4178e19 | 2019-05-16 21:46:11 | [diff] [blame] | 310 | enumerator->AddString("yuy2OverlaySupport", |
| 311 | OverlaySupportToString(yuy2_overlay_support)); |
| 312 | enumerator->AddString("nv12OverlaySupport", |
| 313 | OverlaySupportToString(nv12_overlay_support)); |
Zhenyao Mo | da88bdc | 2018-09-27 01:47:33 | [diff] [blame] | 314 | EnumerateDx12VulkanVersionInfo(dx12_vulkan_version_info, enumerator); |
Maggie Chen | 35d65e4a | 2018-04-12 21:15:25 | [diff] [blame] | 315 | #endif |
liberato | 57587790 | 2015-12-10 17:16:26 | [diff] [blame] | 316 | enumerator->AddInt("videoDecodeAcceleratorFlags", |
| 317 | video_decode_accelerator_capabilities.flags); |
Miguel Casas | 28ee90f | 2019-05-28 19:12:26 | [diff] [blame^] | 318 | |
| 319 | // TODO(crbug.com/966839): Fix the two supported profile dumping below. |
liberato | 57587790 | 2015-12-10 17:16:26 | [diff] [blame] | 320 | for (const auto& profile : |
| 321 | video_decode_accelerator_capabilities.supported_profiles) |
henryhsu | d118544 | 2015-04-10 06:39:14 | [diff] [blame] | 322 | EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator); |
| 323 | for (const auto& profile : video_encode_accelerator_supported_profiles) |
| 324 | EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator); |
henryhsu | 74f6ef1 | 2015-07-23 08:34:37 | [diff] [blame] | 325 | enumerator->AddBool("jpegDecodeAcceleratorSupported", |
| 326 | jpeg_decode_accelerator_supported); |
Andres Calderon Jaramillo | c68cd914 | 2019-02-16 00:43:33 | [diff] [blame] | 327 | for (const auto& profile : image_decode_accelerator_supported_profiles) |
| 328 | EnumerateImageDecodeAcceleratorSupportedProfile(profile, enumerator); |
Antonio Gomes | 5b4d98e | 2017-08-24 05:53:07 | [diff] [blame] | 329 | #if defined(USE_X11) |
thomasanderson | 62ba78ff | 2016-10-01 02:03:42 | [diff] [blame] | 330 | enumerator->AddInt64("systemVisual", system_visual); |
| 331 | enumerator->AddInt64("rgbaVisual", rgba_visual); |
| 332 | #endif |
Jonathan Backer | a57031b | 2018-06-04 15:44:32 | [diff] [blame] | 333 | enumerator->AddBool("oopRasterizationSupported", oop_rasterization_supported); |
Miguel Casas | 28ee90f | 2019-05-28 19:12:26 | [diff] [blame^] | 334 | std::string supported_formats; |
| 335 | for (const auto& format : |
| 336 | supported_buffer_formats_for_allocation_and_texturing) { |
| 337 | supported_formats += gfx::BufferFormatToString(format); |
| 338 | supported_formats += " "; |
| 339 | } |
| 340 | enumerator->AddString("supportedBufferFormatsForAllocationAndTexturing", |
| 341 | supported_formats); |
[email protected] | fd4dcc5 | 2013-08-15 11:37:43 | [diff] [blame] | 342 | enumerator->EndAuxAttributes(); |
| 343 | } |
| 344 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 345 | } // namespace gpu |