Skip to content

Commit ef531e1

Browse files
llyyrkasper93
authored andcommitted
vulkan/context: remove pl_swapchain_resize in set_color
ref: https://code.videolan.org/videolan/libplacebo/-/merge_requests/811
1 parent 4f9f1ff commit ef531e1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

video/out/vulkan/context.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,12 @@ static bool set_color(struct ra_swapchain *sw, struct mp_image_params *params)
536536
bool supported = PL_API_VER >= 361 || !waylandvk;
537537
if (supported && p->params.set_color) {
538538
if (waylandvk && params) {
539-
// Request VK_COLOR_SPACE_PASS_THROUGH_EXT
540-
pl_swapchain_colorspace_hint(p->vk->swapchain, &(struct pl_color_space){0});
541-
// Do the resize in case surface format needs to change.
542-
pl_swapchain_resize(p->vk->swapchain, &(int){0}, &(int){0});
539+
// Request VK_COLOR_SPACE_PASS_THROUGH_EXT, and also force immediate
540+
// cleanup of swapchain retired by pl_swapchain_colorspace_hint,
541+
// otherwise there's a possibility the Wayland color surface will be
542+
// held while we try to create a new one.
543+
pl_swapchain_colorspace_hint(p->vk->swapchain,
544+
&(struct pl_color_space){0});
543545
}
544546
bool ret = p->params.set_color(sw->ctx, params);
545547
// To avoid ping-pong between VK_COLOR_SPACE_PASS_THROUGH_EXT and others,

0 commit comments

Comments
 (0)