summaryrefslogtreecommitdiffstats
path: root/video/out/hwdec/hwdec_vulkan.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2023-10-25 19:51:25 -0700
committerPhilip Langdale <github.philipl@overt.org>2023-10-26 09:51:47 -0700
commit7a58763ad96aba8dc3f64a92615927242221b634 (patch)
treee4056acc95c613b9b3d95381d287d0f4caa19f65 /video/out/hwdec/hwdec_vulkan.c
parentb9c42755a75d74f5cd48737e714d31589fcac6a0 (diff)
downloadmpv-7a58763ad96aba8dc3f64a92615927242221b634.tar.bz2
mpv-7a58763ad96aba8dc3f64a92615927242221b634.tar.xz
Revert "hwdec_vulkan: account for vulkan frames now using presentation size"
ffmpeg is again setting the frame dimensions to the coded size, so we need to reintroduce our work-around to get the logical frame dimensions from the frames_ctx rather than the frame itself. ffmpeg commit: * https://github.com/FFmpeg/FFmpeg/commit/9ee4f47c94083b4fe38d4e217a7d65055d3ad53f This reverts commit c40bd888729212f698156b57e49391d3b51f8f07.
Diffstat (limited to 'video/out/hwdec/hwdec_vulkan.c')
-rw-r--r--video/out/hwdec/hwdec_vulkan.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/video/out/hwdec/hwdec_vulkan.c b/video/out/hwdec/hwdec_vulkan.c
index f08e3380f1..cd9b43698c 100644
--- a/video/out/hwdec/hwdec_vulkan.c
+++ b/video/out/hwdec/hwdec_vulkan.c
@@ -236,6 +236,16 @@ static int mapper_map(struct ra_hwdec_mapper *mapper)
const AVVulkanFramesContext *vkfc = hwfc->hwctx;
AVVkFrame *vkf = (AVVkFrame *) mapper->src->planes[0];
+ /*
+ * We need to use the dimensions from the HW Frames Context for the
+ * textures, as the underlying images may be larger than the logical frame
+ * size. This most often happens with 1080p content where the actual frame
+ * height is 1088.
+ */
+ struct mp_image raw_layout;
+ mp_image_setfmt(&raw_layout, p->layout.params.imgfmt);
+ mp_image_set_size(&raw_layout, hwfc->width, hwfc->height);
+
int num_images;
for (num_images = 0; (vkf->img[num_images] != NULL); num_images++);
const VkFormat *vk_fmt = av_vkfmt_from_pixfmt(hwfc->sw_format);
@@ -269,8 +279,8 @@ static int mapper_map(struct ra_hwdec_mapper *mapper)
*tex = pl_vulkan_wrap(p_owner->gpu, pl_vulkan_wrap_params(
.image = vkf->img[index],
- .width = mp_image_plane_w(&p->layout, i),
- .height = mp_image_plane_h(&p->layout, i),
+ .width = mp_image_plane_w(&raw_layout, i),
+ .height = mp_image_plane_h(&raw_layout, i),
.format = vk_fmt[i],
.usage = vkfc->usage,
.aspect = aspect,