Commit 687fb754b1 for ffmpeg
commit 687fb754b17808133d0be8a57d1133fd3037cc4c
Author: Niklas Haas <git@haasn.dev>
Date: Tue Oct 20 00:31:38 2026 +0200
avutil/vulkan: export ff_vk_map_fmt_to_rep()
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 3987c33080..645fdc4209 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -1996,7 +1996,7 @@ FFVkImageViews *ff_vk_imageviews_alloc(FFVulkanContext *s, int nb_views)
return iv;
}
-static VkFormat map_fmt_to_rep(VkFormat fmt, enum FFVkShaderRepFormat rep_fmt)
+VkFormat ff_vk_map_fmt_to_rep(VkFormat fmt, enum FFVkShaderRepFormat rep_fmt)
{
#define REPS_FMT(fmt) \
[FF_VK_REP_NATIVE] = fmt ## _UINT, \
@@ -2118,7 +2118,7 @@ int ff_vk_create_imageview(FFVulkanContext *s,
.pNext = &view_usage_info,
.image = vkf->img[FFMIN(plane, nb_images - 1)],
.viewType = VK_IMAGE_VIEW_TYPE_2D,
- .format = map_fmt_to_rep(rep_fmts[plane], rep_fmt),
+ .format = ff_vk_map_fmt_to_rep(rep_fmts[plane], rep_fmt),
.components = ff_comp_identity_map,
.subresourceRange = {
.aspectMask = ff_vk_aspect_flag(f, plane),
@@ -2173,7 +2173,7 @@ int ff_vk_create_imageviews(FFVulkanContext *s, FFVkExecContext *e,
.pNext = &view_usage_info,
.image = vkf->img[FFMIN(i, nb_images - 1)],
.viewType = VK_IMAGE_VIEW_TYPE_2D,
- .format = map_fmt_to_rep(rep_fmts[i], rep_fmt),
+ .format = ff_vk_map_fmt_to_rep(rep_fmts[i], rep_fmt),
.components = ff_comp_identity_map,
.subresourceRange = {
.aspectMask = ff_vk_aspect_flag(f, i),
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index 30850c07d9..951052e59e 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -448,6 +448,12 @@ enum FFVkShaderRepFormat {
const char *ff_vk_shader_rep_fmt(enum AVPixelFormat pix_fmt,
enum FFVkShaderRepFormat rep_fmt);
+/**
+ * Returns the view format for the given representation of fmt, or
+ * VK_FORMAT_UNDEFINED if there is none.
+ */
+VkFormat ff_vk_map_fmt_to_rep(VkFormat fmt, enum FFVkShaderRepFormat rep_fmt);
+
/**
* Loads props/mprops/driver_props
*/