mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
vulkan/wsi/wayland: make needs_color_surface_old check if surface exists
Otherwise we end up removing refcount even when we don't have a color
surface already for applications going from SRGB_NONLINEAR to
PASS_THROUGH dring runtime.
To reproduce the bug, start mpv with "--target-colorspace-hint=yes" then
set it to "no" during runtime with a keybind
Fixes: 789507c99c ("vulkan/wsi: implement the Wayland color management protocol")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34708>
This commit is contained in:
parent
2212865ce0
commit
033ce1bae1
1 changed files with 3 additions and 2 deletions
|
|
@ -1238,8 +1238,9 @@ wsi_wl_swapchain_update_colorspace(struct wsi_wl_swapchain *chain)
|
|||
|
||||
bool new_color_surface = !surface->color.color_surface;
|
||||
bool needs_color_surface_new = needs_color_surface(display, chain->color.colorspace);
|
||||
bool needs_color_surface_old = needs_color_surface(display, surface->color.colorspace);
|
||||
if ((new_color_surface || !needs_color_surface_old) && needs_color_surface_new) {
|
||||
bool needs_color_surface_old = surface->color.color_surface &&
|
||||
needs_color_surface(display, surface->color.colorspace);
|
||||
if (!needs_color_surface_old && needs_color_surface_new) {
|
||||
wsi_wl_surface_add_color_refcount(surface);
|
||||
} else if (needs_color_surface_old && !needs_color_surface_new) {
|
||||
wsi_wl_surface_remove_color_refcount(surface);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue