From 0730552e858361256a9aea42cbfda0f93217df74 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 28 Nov 2022 10:22:56 +0100 Subject: [PATCH] render/vulkan: drop unused fields from wlr_vk_format_modifier_props export_imported is never used, and dmabuf_flags is already checked in query_modifier_support(). --- include/render/vulkan.h | 2 -- render/vulkan/pixel_format.c | 10 ---------- render/vulkan/texture.c | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/render/vulkan.h b/include/render/vulkan.h index 149161c26..4655acd4c 100644 --- a/include/render/vulkan.h +++ b/include/render/vulkan.h @@ -88,9 +88,7 @@ const struct wlr_vk_format *vulkan_get_format_from_drm(uint32_t drm_format); struct wlr_vk_format_modifier_props { VkDrmFormatModifierPropertiesEXT props; - VkExternalMemoryFeatureFlags dmabuf_flags; VkExtent2D max_extent; - bool export_imported; }; struct wlr_vk_format_props { diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c index f315c8f34..81c6a54e6 100644 --- a/render/vulkan/pixel_format.c +++ b/render/vulkan/pixel_format.c @@ -168,14 +168,9 @@ static bool query_modifier_support(struct wlr_vk_device *dev, VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT) { unsigned c = props->render_mod_count; VkExtent3D me = ifmtp.imageFormatProperties.maxExtent; - VkExternalMemoryProperties emp = efmtp.externalMemoryProperties; props->render_mods[c].props = m; props->render_mods[c].max_extent.width = me.width; props->render_mods[c].max_extent.height = me.height; - props->render_mods[c].dmabuf_flags = emp.externalMemoryFeatures; - props->render_mods[c].export_imported = - (emp.exportFromImportedHandleTypes & - VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT); ++props->render_mod_count; found = true; @@ -208,14 +203,9 @@ static bool query_modifier_support(struct wlr_vk_device *dev, VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT) { unsigned c = props->texture_mod_count; VkExtent3D me = ifmtp.imageFormatProperties.maxExtent; - VkExternalMemoryProperties emp = efmtp.externalMemoryProperties; props->texture_mods[c].props = m; props->texture_mods[c].max_extent.width = me.width; props->texture_mods[c].max_extent.height = me.height; - props->texture_mods[c].dmabuf_flags = emp.externalMemoryFeatures; - props->texture_mods[c].export_imported = - (emp.exportFromImportedHandleTypes & - VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT); ++props->texture_mod_count; found = true; diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c index 9437cafc3..6cea41b40 100644 --- a/render/vulkan/texture.c +++ b/render/vulkan/texture.c @@ -453,7 +453,7 @@ VkImage vulkan_import_dmabuf(struct wlr_vk_renderer *renderer, assert(plane_count < WLR_DMABUF_MAX_PLANES); struct wlr_vk_format_modifier_props *mod = vulkan_format_props_find_modifier(fmt, attribs->modifier, for_render); - if (!mod || !(mod->dmabuf_flags & VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT)) { + if (!mod) { wlr_log(WLR_ERROR, "Format %"PRIx32" (%.4s) can't be used with modifier " "%"PRIx64, attribs->format, (const char*) &attribs->format, attribs->modifier);