tu: Use vk_features2_to_features

Sanitizes properties returned through GetPhysicalDeviceFormatProperties2.

Bit-31 is not valid to return in the original
vkGetPhysicalDeviceFormatProperties{2,}. Sanitize the bit returned from the
internal to ensure invalid bits aren't return to the application.

Falls in line with the other vulkan drivers.

Based on original commit by Ryan Houdek.

Closes: #8733
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
This commit is contained in:
Alyssa Rosenzweig
2023-03-30 11:56:57 -04:00
parent 4fa2924610
commit fd9c69218a
+7 -3
View File
@@ -8,6 +8,7 @@
#include "fdl/fd6_format_table.h"
#include "vk_enum_defines.h"
#include "vk_util.h"
#include "drm-uapi/drm_fourcc.h"
@@ -373,9 +374,12 @@ tu_GetPhysicalDeviceFormatProperties2(
physical_device, format, props3);
pFormatProperties->formatProperties = (VkFormatProperties) {
.linearTilingFeatures = props3->linearTilingFeatures,
.optimalTilingFeatures = props3->optimalTilingFeatures,
.bufferFeatures = props3->bufferFeatures,
.linearTilingFeatures =
vk_format_features2_to_features(props3->linearTilingFeatures),
.optimalTilingFeatures =
vk_format_features2_to_features(props3->optimalTilingFeatures),
.bufferFeatures =
vk_format_features2_to_features(props3->bufferFeatures),
};
VkDrmFormatModifierPropertiesListEXT *list =