From d0015ebbab924ef01512a6c4ad72aad72ab0897e Mon Sep 17 00:00:00 2001 From: "duncan.hopkins" Date: Fri, 27 Oct 2023 11:50:20 +0100 Subject: [PATCH] zink: use portability EXT on Apple. Vulkan behaviour has changed to require VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR and VK_KHR_portability_enumeration to be used on layered Vulkan implementations. These are enbaled on macOS/Apple as MoltenVK is the only implmentation (time of writing) and newer version require this. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_instance.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/zink/zink_instance.py b/src/gallium/drivers/zink/zink_instance.py index 6b657931bf7..8f3b47aee32 100644 --- a/src/gallium/drivers/zink/zink_instance.py +++ b/src/gallium/drivers/zink/zink_instance.py @@ -28,6 +28,7 @@ from os import path from xml.etree import ElementTree from zink_extensions import Extension,Layer,ExtensionRegistry,Version import sys +import platform # constructor: Extension(name, conditions=[], nonstandard=False) # The attributes: @@ -50,6 +51,11 @@ EXTENSIONS = [ Extension("VK_KHR_win32_surface"), ] +if platform.system() == "Darwin": + EXTENSIONS += [ + Extension("VK_KHR_portability_enumeration"), + ] + # constructor: Layer(name, conditions=[]) # - conditions: See documentation of EXTENSIONS. LAYERS = [ @@ -246,6 +252,9 @@ zink_create_instance(struct zink_screen *screen, bool display_dev) VkInstanceCreateInfo ici = {0}; ici.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; +#ifdef __APPLE__ + ici.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; +#endif ici.pApplicationInfo = &ai; ici.ppEnabledExtensionNames = extensions; ici.enabledExtensionCount = num_extensions;