aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar Niklas Haas <git@haasn.xyz>2018-10-19 16:50:06 +0200
committerGravatar sfan5 <sfan5@live.de>2018-10-19 22:58:16 +0200
commit0f3e25cb0a65bf614440080d9880c8293761842f (patch)
treedc6dfaaedc7c536a761b2f3f5911520e5386a431 /video
parent7ad60a7c5e8dd05e6097fd24e43d0f3458201eeb (diff)
vo_gpu: vulkan: fix the buffer size on partial upload
This was pased on the texture height, which was a mistake. In some cases it could exceed the actual size of the buffer, leading to a vulkan API error. This didn't seem to cause any problems in practice, since a too-large synchronization is just bad for performance and shouldn't do any harm internally, but either way, it was still undefined behavior to submit a barrier outside of the buffer size. Fix the calculation, thus fixing this issue.
Diffstat (limited to 'video')
-rw-r--r--video/out/vulkan/ra_vk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c
index cffb895cfd..236287d7d3 100644
--- a/video/out/vulkan/ra_vk.c
+++ b/video/out/vulkan/ra_vk.c
@@ -886,6 +886,7 @@ static bool vk_tex_upload(struct ra *ra,
struct mp_rect *rc = params->rc;
region.imageOffset = (VkOffset3D){rc->x0, rc->y0, 0};
region.imageExtent = (VkExtent3D){mp_rect_w(*rc), mp_rect_h(*rc), 1};
+ region.bufferImageHeight = region.imageExtent.height;
}
}