Commit graph

17 commits

Author SHA1 Message Date
Jose Maria Casanova Crespo
f33853f861 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.
2026-03-12 22:00:03 +01:00
YaoBing Xiao
55bb69e2c4 render/gles: use optimized clears for unblended rects 2026-03-03 11:02:08 +00:00
Simon Ser
639ca05d35 matrix: move to util/
wlr_matrix is not a standalone type like other headers in types/,
it's more of an internal utility. Move it to the appropriate place.
2025-01-27 17:48:18 +01:00
Simon Ser
9b55737cf5 Make wlr_matrix private API
36cc698bc5 ("matrix: deprecate") has deprecated wlr_matrix more
than one year ago. It's now time to drop it from our public API.
2025-01-26 17:46:50 +01:00
YaoBing Xiao
0db4df4c8e gles2/pass: remove duplicate variable declarations 2024-08-27 20:25:18 +08:00
Simon Ser
d2374b3e4e render/gles2: implement explicit sync API 2024-08-06 17:37:06 +00:00
Simon Ser
842093bb84 Define _POSIX_C_SOURCE globally
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.
2024-02-15 15:41:12 +01:00
Simon Ser
e8b187cc92 render/gles2: save/restore context when creating/submitting a render pass
This is useful for e.g. lazily blitting a texture for readback
purposes while rendering.
2023-11-30 17:47:11 +01:00
Alexander Orzechowski
0d9cd6932a render/gles2: Lazily create buffer fbo 2023-11-30 10:13:18 -05:00
Simon Ser
9e702e9cfe util/transform: move over wl_output_transform helpers
These aren't really tied to wlr_output.
2023-11-23 11:03:57 +01:00
JiDe Zhang
8ebfeffdc8 Remove unnecessary code
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.
2023-10-31 15:59:38 +00:00
Alexander Orzechowski
e9706e62f5 renderer: Use wlr_render_rect_options_get_box
Fixes: #3697
2023-09-21 02:25:34 -04:00
Simon Ser
1205f03ec9 render/gles2: wrap timer setup in push_gles2_debug()
With this, errors should be properly wrapped in the debug scope.
2023-07-12 06:38:02 +00:00
Alexander Orzechowski
2044cc2311 render: Introduce wlr_render_texture_options.blend_mode 2023-06-19 13:16:34 -04:00
Alexander Orzechowski
6bd44c4fcd renderer: Introduce wlr_scale_filter_mode 2023-06-19 12:25:38 -04:00
Rose Hudson
45ca284eee render/gles2: implement timer API 2023-06-05 19:50:07 +00:00
Alexander Orzechowski
8af00d5534 renderer/gles2: Implement render pass interface 2023-05-28 14:53:34 -04:00