diff options
author | Lingfeng Yang <lfy@google.com> | 2021-06-23 16:02:17 -0700 |
---|---|---|
committer | Lingfeng Yang <lfy@google.com> | 2021-06-25 13:10:14 -0700 |
commit | 1ebf4087e85a54a9695daae5b0980eef9481a9c3 (patch) | |
tree | 79a500143998566ca2a4e8822bcf6cad649ee44f | |
parent | 68b584f970048e2dd542941684abe48a95dad28b (diff) | |
download | goldfish-opengl-1ebf4087e85a54a9695daae5b0980eef9481a9c3.tar.gz |
swiftshader vk: pass through cpu device type
This lets us pass some more CtsGraphicsTestCases on swiftshader vk
Bug: 191488892
Change-Id: Ied3303397d03809e0cbfc0a4bc1d10e75dacc35a
-rw-r--r-- | system/vulkan_enc/ResourceTracker.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp index 3fa037a5..2e89e28e 100644 --- a/system/vulkan_enc/ResourceTracker.cpp +++ b/system/vulkan_enc/ResourceTracker.cpp @@ -1595,8 +1595,13 @@ public: void*, VkPhysicalDevice, VkPhysicalDeviceProperties* pProperties) { + // We have host properties at this point if (pProperties) { - pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; + // We need this to ignore some cts tests when using Swiftshader Vk + if (pProperties->deviceType != VK_PHYSICAL_DEVICE_TYPE_CPU) { + // Otherwise, if not CPU type, mark as virtual type + pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; + } } } @@ -1605,8 +1610,11 @@ public: VkPhysicalDevice, VkPhysicalDeviceProperties2* pProperties) { if (pProperties) { - pProperties->properties.deviceType = - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; + // We need this to ignore some cts tests when using Swiftshader Vk + if (pProperties->properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_CPU) { + // Otherwise, if not CPU type, mark as virtual type + pProperties->properties.deviceType = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU; + } VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* memoryReportFeaturesEXT = vk_find_struct<VkPhysicalDeviceDeviceMemoryReportFeaturesEXT>(pProperties); |