[FFmpeg-cvslog] avutil/hwcontext_vulkan: get VkFormatFeatureFlagBits2

Víctor Manuel Jáquez Leal git at videolan.org
Thu Nov 9 10:17:14 EET 2023


ffmpeg | branch: release/6.1 | Víctor Manuel Jáquez Leal <vjaquez at igalia.com> | Thu Nov  2 14:00:03 2023 +0100| [d4041282f4c29333fa63999242374d934fd4577b] | committer: Lynne

avutil/hwcontext_vulkan: get VkFormatFeatureFlagBits2

Rather than the VkFormatFeatureFlagBits enum

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez at igalia.com>
(cherry picked from commit 854012ec59623736a12db0b5f99ca4b602fb5206)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4041282f4c29333fa63999242374d934fd4577b
---

 libavutil/hwcontext_vulkan.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 8481427b42..506a218a42 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -298,8 +298,12 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p,
 
     for (int i = 0; i < nb_vk_formats_list; i++) {
         if (vk_formats_list[i].pixfmt == p) {
+            VkFormatProperties3 fprops = {
+                .sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3,
+            };
             VkFormatProperties2 prop = {
                 .sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
+                .pNext = &fprops,
             };
             VkFormatFeatureFlagBits2 feats_primary, feats_secondary;
             int basics_primary = 0, basics_secondary = 0;
@@ -310,8 +314,7 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p,
                                                    &prop);
 
             feats_primary = tiling == VK_IMAGE_TILING_LINEAR ?
-                             prop.formatProperties.linearTilingFeatures :
-                             prop.formatProperties.optimalTilingFeatures;
+                             fprops.linearTilingFeatures : fprops.optimalTilingFeatures;
             basics_primary = (feats_primary & basic_flags) == basic_flags;
             storage_primary = !!(feats_primary & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT);
 
@@ -320,8 +323,7 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p,
                                                        vk_formats_list[i].fallback[0],
                                                        &prop);
                 feats_secondary = tiling == VK_IMAGE_TILING_LINEAR ?
-                                  prop.formatProperties.linearTilingFeatures :
-                                  prop.formatProperties.optimalTilingFeatures;
+                                  fprops.linearTilingFeatures : fprops.optimalTilingFeatures;
                 basics_secondary = (feats_secondary & basic_flags) == basic_flags;
                 storage_secondary = !!(feats_secondary & VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT);
             } else {



More information about the ffmpeg-cvslog mailing list