mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
render: optionally clear buffer before rendering
It's suboptimal to do it separately, and some drivers can do it for free this way Prevents UNASSIGNED-BestPractices-vkCmdClearAttachments-clear-after-load warning
This commit is contained in:
parent
ce89f49b7a
commit
534266b3f8
4 changed files with 37 additions and 10 deletions
|
|
@ -307,6 +307,13 @@ static struct wlr_render_pass *pixman_begin_buffer_pass(struct wlr_renderer *wlr
|
|||
if (pass == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (options->clear_buffer) {
|
||||
wlr_render_pass_add_rect(&pass->base, &(struct wlr_render_rect_options){
|
||||
.box = { .width = buffer->buffer->width, .height = buffer->buffer->height },
|
||||
.color = options->clear_color,
|
||||
.blend_mode = WLR_RENDER_BLEND_MODE_NONE,
|
||||
});
|
||||
}
|
||||
return &pass->base;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue