From 9839535691005f6637ab28be79714058860e153a Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Wed, 11 Mar 2026 15:13:08 -0400 Subject: [PATCH] render/gles2: scissor region on render pass The scissor step in the rendering has been drop when moving from the legacy rendering API to the current render pass API. Clipping on the CPU allows smaller draws, which can improve both GPU and IO bandwidth on tiled renderer GPUs like on the Raspberry PI. --- render/gles2/pass.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/render/gles2/pass.c b/render/gles2/pass.c index a70ea1320..cce989a5e 100644 --- a/render/gles2/pass.c +++ b/render/gles2/pass.c @@ -90,6 +90,10 @@ static void render(const struct wlr_box *box, const pixman_region32_t *clip, GLi return; } + glEnable(GL_SCISSOR_TEST); + glScissor(region.extents.x1, region.extents.y1, region.extents.x2 - region.extents.x1, + region.extents.y2 - region.extents.y1); + glEnableVertexAttribArray(attrib); for (int i = 0; i < rects_len;) { @@ -120,6 +124,7 @@ static void render(const struct wlr_box *box, const pixman_region32_t *clip, GLi } glDisableVertexAttribArray(attrib); + glDisable(GL_SCISSOR_TEST); pixman_region32_fini(®ion); }