From 0f3e25cb0a65bf614440080d9880c8293761842f Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 19 Oct 2018 16:50:06 +0200 Subject: 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. --- video/out/vulkan/ra_vk.c | 1 + 1 file changed, 1 insertion(+) 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; } } -- cgit v1.2.3