Commit 85bca753 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Enable info_collection RunDX12VulkanTest in gpu integration test

This test collects supports_dx12 and supports_vulkan from GPU info
and compares them with the expected values according to the test bot
configurations.

Bug:977034

Change-Id: I12969114f8af72b0f6e90c37b219ec7d04b85299
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828121Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700915}
parent 9a3ba05f
......@@ -274,6 +274,47 @@ class GpuIntegrationTest(
config['nv12_overlay_support'] = 'SCALING'
return config
def GetDx12VulkanBotConfig(self):
"""Returns expected bot config for DX12 and Vulkan support.
This configuration is collected on Windows platform only.
The rules to determine bot config are:
1) DX12: Win7 doesn't support DX12. Only Win10 supports DX12
2) Vulkan: All bots support Vulkan except for Win FYI AMD bots
"""
if self.browser is None:
raise Exception("Browser doesn't exist")
system_info = self.browser.GetSystemInfo()
if system_info is None:
raise Exception("Browser doesn't support GetSystemInfo")
gpu = system_info.gpu.devices[0]
if gpu is None:
raise Exception("System Info doesn't have a gpu")
gpu_vendor_id = gpu.vendor_id
gpu_device_id = gpu.device_id
assert gpu_vendor_id in _SUPPORTED_WIN_GPU_VENDORS
os_version = self.browser.platform.GetOSVersionName()
if os_version is None:
raise Exception("browser.platform.GetOSVersionName() returns None")
os_version = os_version.lower()
assert os_version in _SUPPORTED_WIN_VERSIONS
config = {
'supports_dx12': True,
'supports_vulkan': True,
}
if os_version == 'win7':
config['supports_dx12'] = False
# "Win7 FYI Release (AMD)" and "Win7 FYI Debug (AMD)" bots
if (os_version == 'win7' and gpu_vendor_id == 0x1002
and gpu_device_id == 0x6613):
config['supports_vulkan'] = False
return config
@classmethod
def GenerateTags(cls, finder_options, possible_browser):
# If no expectations file paths are returned from cls.ExpectationsFiles()
......
......@@ -89,7 +89,7 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
self.fail('%s mismatch, expected %s but got %s.' %
(field, self._ValueToStr(expected), self._ValueToStr(detected)))
def _RunDX12VulkanTest(self, gpu, unused_arg_0, unused_arg_1):
def _RunDX12VulkanTest(self, unused_arg_0, unused_arg_1, unused_arg_2):
os_name = self.browser.platform.GetOSName()
if os_name and os_name.lower() == 'win':
self.RestartBrowserIfNecessaryWithArgs([
......@@ -98,7 +98,19 @@ class InfoCollectionTest(gpu_integration_test.GpuIntegrationTest):
system_info = self.browser.GetSystemInfo()
if not system_info:
self.fail("Browser doesn't support GetSystemInfo")
# TODO(zmo): Verify Win GPU bots DX12/Vulkan supports are as expected.
gpu = system_info.gpu
if gpu is None:
raise Exception("System Info doesn't have a gpu")
aux_attributes = gpu.aux_attributes
if not aux_attributes:
self.fail('GPU info does not have aux_attributes.')
dx12_vulkan_bot_config = self.GetDx12VulkanBotConfig()
for field, expected in dx12_vulkan_bot_config.iteritems():
detected = aux_attributes.get(field)
if expected != detected:
self.fail('%s mismatch, expected %s but got %s.' %
(field, self._ValueToStr(expected), self._ValueToStr(detected)))
@staticmethod
def _ValueToStr(value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment