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
|
|
@ -27,9 +27,23 @@ struct wlr_render_pass;
|
|||
*/
|
||||
struct wlr_render_timer;
|
||||
|
||||
/**
|
||||
* A color value.
|
||||
*
|
||||
* Each channel has values between 0 and 1 inclusive. The R, G, B
|
||||
* channels need to be pre-multiplied by A.
|
||||
*/
|
||||
struct wlr_render_color {
|
||||
float r, g, b, a;
|
||||
};
|
||||
|
||||
struct wlr_buffer_pass_options {
|
||||
/* Timer to measure the duration of the render pass */
|
||||
struct wlr_render_timer *timer;
|
||||
/* Clear the buffer before rendering into it */
|
||||
bool clear_buffer;
|
||||
/* If clearing the buffer, what color to clear it with */
|
||||
struct wlr_render_color clear_color;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -93,16 +107,6 @@ struct wlr_render_texture_options {
|
|||
void wlr_render_pass_add_texture(struct wlr_render_pass *render_pass,
|
||||
const struct wlr_render_texture_options *options);
|
||||
|
||||
/**
|
||||
* A color value.
|
||||
*
|
||||
* Each channel has values between 0 and 1 inclusive. The R, G, B
|
||||
* channels need to be pre-multiplied by A.
|
||||
*/
|
||||
struct wlr_render_color {
|
||||
float r, g, b, a;
|
||||
};
|
||||
|
||||
struct wlr_render_rect_options {
|
||||
/* Rectangle coordinates */
|
||||
struct wlr_box box;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue