From ff6e4fc335f7a997ae68a795ba38cc3b4511a6df Mon Sep 17 00:00:00 2001 From: gyeyoung Date: Mon, 25 May 2026 19:21:08 +0900 Subject: [PATCH] panvk: fix flags2-only bit leak in legacy format features VkFormatProperties uses VkFormatFeatureFlags, whose valid bits are limited to VK_ALL_FORMAT_FEATURE_FLAG_BITS (0x7fffffffu). Without this mask, the last bit leaks out. Use vk_format_features2_to_features() helper when filling VkFormatProperties so flags2-only bits are not leaked through legacy feature fields. Cc: mesa-stable Signed-off-by: Gyeyoung Baek Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/vulkan/panvk_physical_device.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c index 7e5c21391c6..fcf11025b71 100644 --- a/src/panfrost/vulkan/panvk_physical_device.c +++ b/src/panfrost/vulkan/panvk_physical_device.c @@ -19,6 +19,7 @@ #include "vk_android.h" #include "vk_device.h" #include "vk_drm_syncobj.h" +#include "vk_enum_defines.h" #include "vk_format.h" #include "vk_log.h" #include "vk_physical_device.h" @@ -952,10 +953,14 @@ panvk_GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormatFeatureFlags2 buffer = get_buffer_format_features(physical_device, format); + VkFormatFeatureFlags tex_legacy = vk_format_features2_to_features(tex); + VkFormatFeatureFlags buffer_legacy = + vk_format_features2_to_features(buffer); + pFormatProperties->formatProperties = (VkFormatProperties){ - .linearTilingFeatures = tex, - .optimalTilingFeatures = tex, - .bufferFeatures = buffer, + .linearTilingFeatures = tex_legacy, + .optimalTilingFeatures = tex_legacy, + .bufferFeatures = buffer_legacy, }; VkFormatProperties3 *formatProperties3 =