Merge "Disable usage of VVL in MoltenVK path" into main
diff --git a/host/vulkan/VulkanDispatch.cpp b/host/vulkan/VulkanDispatch.cpp
index 8494528..450eb25 100644
--- a/host/vulkan/VulkanDispatch.cpp
+++ b/host/vulkan/VulkanDispatch.cpp
@@ -100,6 +100,14 @@
         //  submitted to a queue will give the same result as if they had been run in
         //  submission order.
         android::base::setEnvironmentVariable("MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE", "0");
+
+        // TODO(b/351765838): VVL won't work with MoltenVK due to the current
+        //  way of external memory handling, add it into disable list to
+        //  avoid users enabling it implicitly (i.e. via vkconfig).
+        //  It can be enabled with VK_LOADER_LAYERS_ALLOW=VK_LAYER_KHRONOS_validation
+        INFO("Vulkan Validation Layers won't be enabled with MoltenVK");
+        android::base::setEnvironmentVariable("VK_LOADER_LAYERS_DISABLE",
+                                              "VK_LAYER_KHRONOS_validation");
 #else
         // By default, on other platforms, just use whatever the system
         // is packing.