diff options
author | Simon Ser <contact@emersion.fr> | 2022-10-10 14:39:47 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-10-10 14:39:47 +0200 |
commit | 221ee83d440fb7dcbfd141ef3a459a5a973331b6 (patch) | |
tree | 7bee7f86aa351cf46859bbb81abbedabdb326b6e /render/vulkan | |
parent | 650f955507a95c5af2fda1628eafc28ef6d99543 (diff) |
render/vulkan: drop wlr_vk_instance.extensions
This was unused. Even if it was, it'd be better to have bool fields
instead.
Diffstat (limited to 'render/vulkan')
-rw-r--r-- | render/vulkan/vulkan.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/render/vulkan/vulkan.c b/render/vulkan/vulkan.c index 133ba8a9..cbd1035c 100644 --- a/render/vulkan/vulkan.c +++ b/render/vulkan/vulkan.c @@ -131,9 +131,9 @@ struct wlr_vk_instance *vulkan_instance_create(size_t ext_count, return NULL; } - bool debug_utils_found = false; - ini->extensions = calloc(1 + ext_count, sizeof(*ini->extensions)); - if (!ini->extensions) { + size_t extensions_len = 0; + const char **extensions = calloc(1 + ext_count, sizeof(*extensions)); + if (extensions) { wlr_log_errno(WLR_ERROR, "allocation failed"); goto error; } @@ -146,14 +146,15 @@ struct wlr_vk_instance *vulkan_instance_create(size_t ext_count, continue; } - ini->extensions[ini->extension_count++] = exts[i]; + extensions[extensions_len++] = exts[i]; } + bool debug_utils_found = false; if (debug) { const char *name = VK_EXT_DEBUG_UTILS_EXTENSION_NAME; if (find_extensions(avail_ext_props, avail_extc, &name, 1) == NULL) { debug_utils_found = true; - ini->extensions[ini->extension_count++] = name; + extensions[extensions_len++] = name; } } @@ -174,8 +175,8 @@ struct wlr_vk_instance *vulkan_instance_create(size_t ext_count, VkInstanceCreateInfo instance_info = {0}; instance_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; instance_info.pApplicationInfo = &application_info; - instance_info.enabledExtensionCount = ini->extension_count; - instance_info.ppEnabledExtensionNames = ini->extensions; + instance_info.enabledExtensionCount = extensions_len; + instance_info.ppEnabledExtensionNames = extensions; instance_info.enabledLayerCount = layer_count; instance_info.ppEnabledLayerNames = layers; @@ -209,6 +210,8 @@ struct wlr_vk_instance *vulkan_instance_create(size_t ext_count, goto error; } + free(extensions); + // debug callback if (debug_utils_found) { ini->api.createDebugUtilsMessengerEXT = @@ -247,7 +250,6 @@ void vulkan_instance_destroy(struct wlr_vk_instance *ini) { vkDestroyInstance(ini->instance, NULL); } - free(ini->extensions); free(ini); } |