mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
output: destroy swapchain when disabled
This avoids consuming GPU memory when an output is disabled.
This commit is contained in:
parent
6bfb930aa7
commit
456b971099
1 changed files with 9 additions and 0 deletions
|
@ -715,6 +715,15 @@ bool wlr_output_commit(struct wlr_output *output) {
|
||||||
wlr_output_schedule_done(output);
|
wlr_output_schedule_done(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Destroy the swapchains when an output is disabled
|
||||||
|
if ((output->pending.committed & WLR_OUTPUT_STATE_ENABLED) &&
|
||||||
|
!output->pending.enabled) {
|
||||||
|
wlr_swapchain_destroy(output->swapchain);
|
||||||
|
output->swapchain = NULL;
|
||||||
|
wlr_swapchain_destroy(output->cursor_swapchain);
|
||||||
|
output->cursor_swapchain = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Unset the front-buffer when a new buffer will replace it or when the
|
// Unset the front-buffer when a new buffer will replace it or when the
|
||||||
// output is getting disabled
|
// output is getting disabled
|
||||||
if ((output->pending.committed & WLR_OUTPUT_STATE_BUFFER) ||
|
if ((output->pending.committed & WLR_OUTPUT_STATE_BUFFER) ||
|
||||||
|
|
Loading…
Reference in a new issue