mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-26 00:52:21 +00:00
output: fix modifier stripping
DRM formats with an empty modifier list are invalid. Instead of emptying the list, reduce it to { INVALID }. Add a check to make sure the renderer and backend support implicit modifiers, so that we don't fallback on e.g. Vulkan. Closes: https://github.com/swaywm/sway/issues/6692
This commit is contained in:
parent
1bf9676e87
commit
0d32118a80
@ -74,7 +74,14 @@ static bool output_create_swapchain(struct wlr_output *output,
|
|||||||
format->format, output->name);
|
format->format, output->name);
|
||||||
|
|
||||||
if (!allow_modifiers && (format->len != 1 || format->modifiers[0] != DRM_FORMAT_MOD_LINEAR)) {
|
if (!allow_modifiers && (format->len != 1 || format->modifiers[0] != DRM_FORMAT_MOD_LINEAR)) {
|
||||||
|
if (!wlr_drm_format_has(format, DRM_FORMAT_MOD_INVALID)) {
|
||||||
|
wlr_log(WLR_DEBUG, "Implicit modifiers not supported");
|
||||||
|
free(format);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
format->len = 0;
|
format->len = 0;
|
||||||
|
wlr_drm_format_add(&format, DRM_FORMAT_MOD_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_swapchain *swapchain =
|
struct wlr_swapchain *swapchain =
|
||||||
|
Loading…
Reference in New Issue
Block a user