mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
render/gles2: add scissor-based clipping for tile-based renderers
Add an optional scissor-based clipping strategy to the GLES2 render pass, it is enabled with WLR_GLES2_SCISSOR_CLIP=1 env var. And it is disabled by default so it doesn't affect current users. On tile-based renderers like V3D (Broadcom VideoCore, used in Raspberry Pi), not using scissoring makes the GPU to render the full-surface. If scissor is applied only the tiles affected are load/render/stored reducing the GPU usage. Patch backported to wlroots 0.19 with labwc on Raspberry Pi OS with v3d running glxgear 300x300 on top left corner of screen: - Before: labwc uses 21.5% of GPU render availability. - After : labwc uses 3.3% of GPU render availability. This patch over wlroots master with sway on Raspberry Pi OS with v3d running glxgear half-screen and a terminal half screen: - Before: sway uses 23.5% of GPU render availability. - After : sway uses 13.6% of GPU render availability.
This commit is contained in:
parent
736c0f3f25
commit
f33853f861
3 changed files with 59 additions and 27 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include "render/egl.h"
|
||||
#include "render/gles2.h"
|
||||
#include "render/pixel_format.h"
|
||||
#include "util/env.h"
|
||||
#include "util/time.h"
|
||||
|
||||
#include "common_vert_src.h"
|
||||
|
|
@ -541,6 +542,11 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER));
|
||||
wlr_log(WLR_INFO, "Supported GLES2 extensions: %s", exts_str);
|
||||
|
||||
renderer->scissor = env_parse_bool("WLR_GLES2_SCISSOR_CLIP");
|
||||
if (renderer->scissor) {
|
||||
wlr_log(WLR_INFO, "Enabled scissoring clipping");
|
||||
}
|
||||
|
||||
if (!renderer->egl->exts.EXT_image_dma_buf_import) {
|
||||
wlr_log(WLR_ERROR, "EGL_EXT_image_dma_buf_import not supported");
|
||||
free(renderer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue