aboutsummaryrefslogtreecommitdiff
path: root/render/pass.c
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2023-07-19 09:26:28 -0400
committerSimon Ser <contact@emersion.fr>2023-08-23 18:28:58 +0000
commita94168b5fe640a10a001b5afe3ef4dc9bbfd3416 (patch)
tree9392f5e67948f328e29ca0c29586d651122410e1 /render/pass.c
parente5fc8cd4c734717c471567de98a77e2482a7015f (diff)
render: ensure wlr_render_rect_options->box is nonempty
This optimization also fixes an validation error with the Vulkan renderer by ensuring vkCmdClearAttachments does not receive empty regions.
Diffstat (limited to 'render/pass.c')
-rw-r--r--render/pass.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/render/pass.c b/render/pass.c
index 444f964e..6545bbfd 100644
--- a/render/pass.c
+++ b/render/pass.c
@@ -40,6 +40,9 @@ void wlr_render_pass_add_texture(struct wlr_render_pass *render_pass,
void wlr_render_pass_add_rect(struct wlr_render_pass *render_pass,
const struct wlr_render_rect_options *options) {
+ if (wlr_box_empty(&options->box)) {
+ return;
+ }
render_pass->impl->add_rect(render_pass, options);
}