Commit Graph

16 Commits

Author SHA1 Message Date
Thomas Hebb ea77cc5cb2 render/gles2: don't constrain shm formats to ones that support reading
commit 44e8451cd9 ("render/gles2: hide shm formats without GL
support") added the is_gles2_pixel_format_supported() function to
render/gles2/pixel_format.c, whose stated purpose is to "check whether
the renderer has the needed GL extensions to read a given pixel format."
It then used that function to filter the pixel formats returned by
get_gles2_shm_formats().

The result of this change is that RGB formats are no longer reported for
GL drivers that don't implement EXT_read_format_bgra, even when those
formats are supported for rendering (which they have to be for
wlr_gles2_renderer_create() to succeed). This is a pretty clear
regression, since wlr_renderer_init_wl_shm() fails when either of
WL_SHM_FORMAT_ARGB8888 or WL_SHM_FORMAT_XRGB8888 are missing.

To fix the regression, change is_gles2_pixel_format_supported() to
accept all pixel formats that support rendering, regardless of whether
we can read them or not, and move the check for EXT_read_format_bgra
back into gles2_read_pixels(). (There's already a check for this
extension in gles2_preferred_read_format(), so we're not breaking any
abstraction that wasn't already broken.)

Tested on the NVIDIA 495.46 proprietary driver, which doesn't support
EXT_read_format_bgra.

Fixes: 44e8451cd9 ("render/gles2: hide shm formats without GL support")
(cherry picked from commit 59b9518f072527ac59593e51df7f5d5331a34f0e)
2022-02-02 20:08:17 +01:00
Manuel Stoeckl f5df956c18 render/gles2: add a few 10-bit and FP16 formats
The half-float formats depend on GL_OES_texture_half_float_linear,
not just the GL_OES_texture_half_float extension, because the latter
does not include support for linear magni/minification filters.

The new 2101010 and 16161616F formats are only available on little-
endian builds, since their gl_types are larger than a byte and thus
endianness dependent.
2021-07-30 08:29:13 +02:00
Manuel Stoeckl 44e8451cd9 render/gles2: hide shm formats without GL support
This change introduces a new function to check whether the renderer
has the needed GL extensions to read a given pixel format.
2021-07-30 08:29:13 +02:00
Simon Ser f76960388f render/gles2: add support for some 24 and 16-bit formats
On little-endian, we can enable pixel formats which don't use
gl_type = GL_UNSIGNED_BYTE. See [1].

[1]: https://afrantzis.com/pixel-format-guide/
2021-07-29 10:47:34 -04:00
Simon Zeni 78d21fa131 render/gles2: remove depth and bpp gles2_pixel_format, use drm pixel format 2021-03-25 10:55:54 +01:00
Simon Ser ddfee63055 render: use DRM formats in wlr_renderer_get_shm_texture_formats 2021-02-23 16:09:26 +01:00
Simon Ser 549435aee5 render/gles2: replace wlr_gles2_texture.wl_format with drm_format 2021-02-23 16:09:26 +01:00
Simon Ser fab396f149 render/gles2: convert format table to DRM formats 2021-02-23 16:09:26 +01:00
Simon Ser a71649dde9 render/gles2: remove duplicated format list 2020-03-09 15:26:28 +01:00
emersion 62d646f2b8
render/gles2: remove assumptions about supported formats
We were assuming GL_BGRA_EXT was always supported.

We now check that it's supported for rendering. We fail if it isn't because
this format is specified as "always supported" by the Wayland protocol.

We also check if it's supported for reading pixels. A new preferred_read_format
function returns the preferred format that can be used to read pixels. This is
used by the screencopy protocol.
2018-11-04 09:00:51 +01:00
emersion 71ca45e2c0
Make sure we don't use others' prefixes 2018-04-25 23:24:58 +01:00
emersion cc5ef1d2ff
render/gles2: move list of supported WL formats to pixel_format.c 2018-03-21 08:50:59 +01:00
emersion 95e86e675a
render/gles2: remove global state, use OpenGL debug extension 2018-03-20 19:14:33 +01:00
emersion f34a1b75eb
render/gles2: use format bpp when reading pixels 2018-01-26 23:13:41 +01:00
emersion 4fa90b0511
Backport screenshooter fixes from the renderer redesign v1
This backports some changes to #319 to fix the screenshooter data
format. This also adds wlr_backend_get_renderer which will be
useful to support multiple renderers.
2018-01-23 22:06:54 +01:00
Drew DeVault 5a2796266f Support wl_shm pixel formats in gles2 renderer 2017-06-23 14:25:55 -04:00