[fuchsia] Disable timeline semaphore support.
The goldfish-opengl ICD doesn't support Vulkan timeline support
properly; we should disable it unconditionally on Fuchsia.
Test: vkreadback on FEMU w/ latest roll.
Fixed: 325639938
Change-Id: I534c3558c5bbe232f7e6c31520d7759d09ed7e5f
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp
index 1fe25d2..cd0c3c4 100644
--- a/system/vulkan_enc/ResourceTracker.cpp
+++ b/system/vulkan_enc/ResourceTracker.cpp
@@ -1218,7 +1218,10 @@
"VK_KHR_shader_float16_int8",
// Timeline semaphores buggy in newer NVIDIA drivers
// (vkWaitSemaphoresKHR causes further vkCommandBuffer dispatches to deadlock)
-#ifndef VK_USE_PLATFORM_ANDROID_KHR
+ //
+ // TODO(https://fxbug.dev/330767177): Support timeline semaphore on
+ // Fuchsia and remove the #if statement for Fuchsia.
+#if (!defined(VK_USE_PLATFORM_ANDROID_KHR) && !defined(VK_USE_PLATFORM_FUCHSIA))
"VK_KHR_timeline_semaphore",
#endif
"VK_AMD_gpu_shader_half_float",
@@ -1525,6 +1528,22 @@
if (memoryReportFeaturesEXT) {
memoryReportFeaturesEXT->deviceMemoryReport = VK_TRUE;
}
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ // TODO(https://fxbug.dev/330767177): Support timeline semaphore on
+ // Fuchsia and remove this override.
+ VkPhysicalDeviceVulkan12Features* vulkan12Features =
+ vk_find_struct<VkPhysicalDeviceVulkan12Features>(pFeatures);
+ if (vulkan12Features) {
+ vulkan12Features->timelineSemaphore = VK_FALSE;
+ }
+
+ VkPhysicalDeviceTimelineSemaphoreFeatures* timelineSemaphoreFeatures =
+ vk_find_struct<VkPhysicalDeviceTimelineSemaphoreFeatures>(pFeatures);
+ if (timelineSemaphoreFeatures) {
+ timelineSemaphoreFeatures->timelineSemaphore = VK_FALSE;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
}
}
diff --git a/system/vulkan_enc/vk_struct_id.h b/system/vulkan_enc/vk_struct_id.h
index 32d6b86..bf32817 100644
--- a/system/vulkan_enc/vk_struct_id.h
+++ b/system/vulkan_enc/vk_struct_id.h
@@ -72,4 +72,9 @@
REGISTER_VK_STRUCT_ID(VkMemoryAllocateFlagsInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO);
REGISTER_VK_STRUCT_ID(VkMemoryOpaqueCaptureAddressAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO);
+#ifdef VK_VERSION_1_2
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceVulkan12Features, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES);
+REGISTER_VK_STRUCT_ID(VkPhysicalDeviceTimelineSemaphoreFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES);
+#endif // VK_VERSION_1_2
+
#undef REGISTER_VK_STRUCT_ID