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.
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.
Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).
Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
Not needs set GL_DEPTH_TEST, Because when rendering to a framebuffer
that has no depth buffer, depth testing always behaves as though
the test is disabled, The initial value for each capability with
the exception of GL_DITHER is GL_FALSE.