aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2021-06-23 16:02:17 -0700
committerLingfeng Yang <lfy@google.com>2021-06-25 13:10:14 -0700
commit1ebf4087e85a54a9695daae5b0980eef9481a9c3 (patch)
tree79a500143998566ca2a4e8822bcf6cad649ee44f
parent68b584f970048e2dd542941684abe48a95dad28b (diff)
downloadgoldfish-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.cpp14
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);