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 <gye976@gmail.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41772>
This commit is contained in:
gyeyoung 2026-05-25 19:21:08 +09:00 committed by Marge Bot
parent afad83afed
commit ff6e4fc335

View file

@ -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 =