From 95fabff8dea94eb8dfb49871034df8fc390d0e68 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 15 Feb 2022 17:08:14 +0200 Subject: [PATCH] turnip: Set drmFormatModifierTilingFeatures From Vulkan spec for VkDrmFormatModifierProperties2EXT: "drmFormatModifierTilingFeatures is a bitmask of VkFormatFeatureFlagBits that are supported by any image created with format and drmFormatModifier." "The returned drmFormatModifierTilingFeatures must contain at least one bit." "Therefore, if the returned drmFormatModifier is DRM_FORMAT_MOD_LINEAR, then drmFormatModifierPlaneCount must equal the format planecount, and drmFormatModifierTilingFeatures must be identical to the VkFormatProperties2::linearTilingFeatures returned in the same pNext chain." Relevant tests: dEQP-VK.drm_format_modifiers.* Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/vulkan/tu_formats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index 4ebc8eb..536bff0 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -317,6 +317,8 @@ tu_GetPhysicalDeviceFormatProperties2( vk_outarray_append(&out, mod_props) { mod_props->drmFormatModifier = DRM_FORMAT_MOD_LINEAR; mod_props->drmFormatModifierPlaneCount = 1; + mod_props->drmFormatModifierTilingFeatures = + pFormatProperties->formatProperties.linearTilingFeatures; } } @@ -327,6 +329,8 @@ tu_GetPhysicalDeviceFormatProperties2( vk_outarray_append(&out, mod_props) { mod_props->drmFormatModifier = DRM_FORMAT_MOD_QCOM_COMPRESSED; mod_props->drmFormatModifierPlaneCount = 1; + mod_props->drmFormatModifierTilingFeatures = + pFormatProperties->formatProperties.optimalTilingFeatures; } } } -- 2.7.4