Commit graph

204 commits

Author SHA1 Message Date
emersion
5445d8aad0 meson: enable more compiler warnings 2019-03-01 09:20:23 +01:00
emersion
75371d2c88
Require libdrm >= 2.4.95 2019-01-29 19:33:38 +01:00
Timidger
9af0c5338f
Standardize the wlr_box input paramaters
Fixes #1094
2018-12-21 13:56:10 -05:00
Ilia Bozhinov
fb5691b6cc output: add wlr_output_preferred_read_format()
The read format is dependent on the output, so we first need to make it
current. This fixes a race condition in wlr-screencopy-v1 where a dmabuf
client would cause EGL_NO_SURFACE to be bound at the time when
screencopy needs to query for the preferred format, causing GL errors.
2018-11-24 10:54:25 +01:00
emersion
1b9ebcf645
output: make wlr_egl flip the damage 2018-11-13 16:55:33 +01:00
emersion
09550032b7
render: correctly set EGL_RENDERABLE_TYPE
This should be set to EGL_OPENGL_ES2_BIT.

Also fixes EGL config attributes in the headless and X11 backends.
2018-11-10 13:20:54 +01:00
emersion
d592dcdedd
render/gles2: check for GL_OES_EGL_image_external 2018-11-04 09:00:55 +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
b42fc4f2b1
render: on Wayland, make eglSwapBuffers non-blocking 2018-10-28 09:58:20 +01:00
nyorain
cb03a41a3b Use enum wl_shm_format for gles2 texture formats
Also rephrase the write_pixels comment.
2018-10-16 09:35:28 +02:00
nyorain
cd28637187 Remove fmt parameter from wlr_texture_write_pixels
It's not allowed to change the format of a texture so remove
the confusing parameter.
2018-10-15 23:56:56 +02:00
Cole Mickens
7297348736 render: fix meson including libdrm 2018-10-15 13:34:23 -07:00
Scott Anderson
7ca3bc1d6f Fix libdrm includes
This removes any assumptions about how the libdrm headers are installed,
and uses the pkg-config include directories as we're "supposed to".
This only adds a partial dependency, since we don't actually need to
link against libdrm.
2018-10-15 11:39:35 +13:00
emersion
7daca85bcf
Merge pull request #1309 from swaywm/fix-headless-libinput
Fix headless backend
2018-10-14 08:33:25 +02:00
Cole Mickens
43d0ebfdac
Fix include path for (libdrm/)drm_fourcc.h
This PR broke a private nixpkgs definition I have for wlroots: https://github.com/swaywm/wlroots/pull/1304

It is fixed by changing `#include <drm_fourcc.h>` to `#include <libdrm/drm_fourcc.h>`, which follows what is already done in the dmabuf example.
2018-10-13 21:36:58 -07:00
Drew DeVault
63c69cee6e Fix headless backend
It was only working if you ran it underneath an already-working Wayland
compositor. Running with the headless backend on the API would break.
2018-10-13 23:39:38 -04:00
nyorain
affbfb6a28 Support older wlr_linux_dmabuf_v1 clients
If a client uses an older version of the dmabuf protocol, use the
`formats` event instead of `modifiers` (since that didn't exist in older
versions).
With a bit of necessary guessing, support dmabuf importing even when
EGL_EXT_image_dma_buf_import_modifiers isn't present instead of
failing up front.
2018-10-12 23:07:45 +02:00
emersion
2f0815838d Init dmabuf global in renderer 2018-09-02 08:50:43 +02:00
Scott Anderson
dc37194291 Change how glgen.sh outputs files
This fixes building wlroots as a subproject.
2018-08-24 19:35:21 +12:00
Scott Anderson
fd3fa760d3 Revert "Revert "Merge pull request #1194 from ascent12/meson_feature""
This reverts commit 9c886f20b9.
2018-08-24 19:35:02 +12:00
Drew DeVault
9c886f20b9 Revert "Merge pull request #1194 from ascent12/meson_feature"
This breaks wlroots when used as a meson subproject.

This reverts commit dea311992e, reversing
changes made to 6db9c4b746.
2018-08-23 21:00:58 -04:00
Scott Anderson
a2bbf2c1f7 Make style more consistent 2018-08-22 21:16:16 +12:00
Mariusz Bialonczyk
ad406db21c gles2: change context when it is not current
Texture functions, that create and manipulate textures should switch
the current context if necessary.

thanks to: @emersion

Fixes #934
2018-08-03 07:43:22 +02:00
Drew DeVault
b902c2bd7c Revert "Move side-effect out of assert statement"
This reverts commit a0afedcd8f.
2018-07-13 15:46:54 -04:00
Drew DeVault
a0afedcd8f Move side-effect out of assert statement 2018-07-13 13:54:09 -04:00
emersion
c4915d1492 render: add wlr_texture_is_opaque 2018-07-12 23:35:33 +01:00
emersion
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion
cc9b198f9e
render/gles2: ditch extra parens 2018-06-30 23:19:02 +01:00
emersion
bf7560b7cd
screencopy: add capture_output_region support 2018-06-30 22:18:04 +01:00
emersion
2b9cbaddf3
screencopy: add support for frame flags 2018-06-30 22:18:03 +01:00
Dominique Martinet
4cc4412481 wlr_renderer_destroy: fix renderer NULL check
renderer is checked for NULL, but was dereferenced before that.

Found through static analysis
2018-06-30 11:38:21 +09:00
emersion
57548b557a
Merge branch 'master' into screencontent 2018-06-17 14:49:18 +01:00
emersion
d643361c48
Merge pull request #1047 from NotKit/gles2fix
Fix GLES2 renderer to use glGetUniformLocations locations
2018-06-13 15:37:16 +01:00
NeKit
6f29db1044 gles2 renderer: introduce struct wlr_gles2_tex_shader 2018-06-13 13:43:01 +03:00
Vincent Vanlaer
f1a62a3200 Rename egl.exts to match the extension names 2018-06-09 19:11:51 +02:00
Vincent Vanlaer
5ec6d8230d Split eglSwapBuffersWithDamage feature detection
Detecting whether eglSwapBuffersWithDamageEXT or
eglSwapBuffersWithDamageKHR is used should be based on the extension
string, not only on the availability of the function.
2018-06-09 11:39:14 +02:00
Brian Ashworth
18bbe2d897 Fix atti assert in wlr_egl_init 2018-06-08 20:25:36 -04:00
emersion
457bfcab19
render/egl: only request high priority context on DRM 2018-06-08 00:17:45 +01:00
emersion
d425edc96c
render/egl: consistent extension checking 2018-06-08 00:06:34 +01:00
emersion
cbfe0e834a
Request a high priority EGL context 2018-06-08 00:06:34 +01:00
NeKit
de91c55ea9 Fix GLES2 renderer to use glGetUniformLocations locations
This is needed as uniform locations are driver implementation-specific.
2018-06-07 18:06:31 +03:00
emersion
6b7a55aa3d
Merge pull request #1020 from emersion/remove-check-dmabuf
render: remove wlr_renderer_check_import_dmabuf
2018-05-31 21:49:57 +01:00
emersion
21928cbe61
Merge branch 'master' into screencontent 2018-05-31 12:33:27 +01:00
Genki Sky
d1cf9acbd5 cleanup: Use void for zero-parameter functions
Signed-off-by: Genki Sky <sky@genki.is>
2018-05-30 20:19:16 -04:00
emersion
135721118a
render: remove wlr_renderer_check_import_dmabuf
It's possible to implement it outside the renderer, by creating a
texture and destroying it right away. This reduces the API surface
of the renderer.
2018-05-30 17:08:15 +01:00
emersion
28020ff577
Only allow one modifier per DMA-BUF, split attributes struct in render/ 2018-05-30 09:29:12 +01:00
emersion
5ba1a9af56
render: add wlr_texture_to_dmabuf 2018-05-29 18:47:17 +01:00
emersion
6eb4b5b54d
Merge pull request #993 from emersion/bind-wl-drm-in-renderer
render: bind wl_drm in renderer
2018-05-25 13:54:16 +01:00
Ilia Bozhinov
24cf70ae96 backends: implement custom EGL and renderer initialization
Compositors now have more control over how the backend creates its
renderer. Currently all backends create an EGL/GLES2 renderer, so
the necessary attributes for creating the context are passed to a
user-provided callback function. It is responsible for initializing
provided wlr_egl and to return a renderer. On fail, return 0.

Fixes #987
2018-05-25 14:56:52 +03:00
agr
4e89e0fc6c fix server exit: eglMakeCurrent Invalid display 2018-05-23 16:17:29 +02:00