mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
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.
This commit is contained in:
parent
7ad60a7c5e
commit
0f3e25cb0a
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user