Extension("VK_EXT_debug_utils"),
Extension("VK_KHR_get_physical_device_properties2"),
Extension("VK_KHR_external_memory_capabilities"),
+ Extension("VK_MVK_moltenvk"),
]
LAYERS = [
%for layer in layers:
bool have_layer_${layer.pure_name()};
%endfor
-
-#if defined(MVK_VERSION)
- bool have_moltenvk_layer_ext;
- bool have_moltenvk_layer;
- bool have_moltenvk;
-#endif
};
VkInstance
%endfor
#if defined(MVK_VERSION)
- bool have_moltenvk_layer_ext = false;
bool have_moltenvk_layer = false;
- bool have_moltenvk = false;
#endif
// Build up the extensions from the reported ones but only for the unnamed layer
if (vkEnumerateInstanceExtensionProperties(NULL, &extension_count, extension_props) == VK_SUCCESS) {
for (uint32_t i = 0; i < extension_count; i++) {
%for ext in extensions:
- if (!strcmp(extension_props[i].extensionName, ${ext.extension_name()})) {
+ if (!strcmp(extension_props[i].extensionName, ${ext.extension_name_literal()})) {
have_${ext.name_with_vendor()} = true;
- extensions[num_extensions++] = ${ext.extension_name()};
+ extensions[num_extensions++] = ${ext.extension_name_literal()};
}
%endfor
-#if defined(MVK_VERSION)
- if (!strcmp(extension_props[i].extensionName, VK_MVK_MOLTENVK_EXTENSION_NAME)) {
- have_moltenvk_layer_ext = true;
- extensions[num_extensions++] = VK_MVK_MOLTENVK_EXTENSION_NAME;
- }
-#endif
}
}
free(extension_props);
}
%endfor
-#if defined(MVK_VERSION)
- screen->instance_info.have_moltenvk_layer_ext = have_moltenvk_layer_ext;
- screen->instance_info.have_moltenvk_layer = have_moltenvk_layer;
- screen->have_moltenvk = have_moltenvk_layer_ext && have_moltenvk_layer;
-#endif
-
VkApplicationInfo ai = {};
ai.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
return true;
}
-#if defined(MVK_VERSION)
static bool
zink_internal_setup_moltenvk(struct zink_screen *screen)
{
- if (!screen->have_moltenvk)
+#if defined(MVK_VERSION)
+ if (!screen->have_MVK_moltenvk)
return true;
GET_PROC_ADDR_INSTANCE(GetMoltenVKConfigurationMVK);
(*screen->vk_SetMoltenVKConfigurationMVK)(screen->instance, &molten_config, &molten_config_size);
}
}
+#endif // MVK_VERSION
return true;
}
-#endif // MVK_VERSION
static void
check_device_needs_mesa_wsi(struct zink_screen *screen)
*/
check_device_needs_mesa_wsi(screen);
-#if defined(MVK_VERSION)
zink_internal_setup_moltenvk(screen);
-#endif
screen->dev = zink_create_logical_device(screen);
if (!screen->dev)