aboutsummaryrefslogtreecommitdiff
path: root/render/egl.c
AgeCommit message (Collapse)Author
2020-06-18render/egl: print error nameSimon Ser
Allows for easier debugging.
2020-06-10render/egl: explicit client extension handlingSimon Ser
Prior to this commit, wlr_egl_init seemed to assume the extension string queried via EGL_NO_DISPLAY was a subset of the extension string queried via an initialized display. This isn't correct. EGL_EXT_client_extensions [1] defines two types of extensions: client extensions and display extensions. The set of supported client and display extensions are disjoint (ie. an extension is either a client or a display extension, not both). Client extensions are queried via EGL_NO_DISPLAY, display extensions are queried via an initialized display. Rename the variables to make this clear. Remove the misleading comment. Log both client and display extensions. [1]: https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_client_extensions.txt
2020-06-08render: egl: Add utility functions for saving/restoring contextAndri Yngvason
2020-06-06render: choose DMA-BUF texture target via eglQueryDmaBufModifiersEXTSimon Ser
EGL_EXT_image_dma_buf_import_modifiers tells us whether we should use GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES. Using the right texture target can fix some failures and/or improve performance on some drivers. This does the same as a Weston commit [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/commit/40c519a3e613 Closes: https://github.com/swaywm/wlroots/issues/2173
2020-06-02render: stop making EGL context current in wlr_egl_initSimon Ser
This leaves an EGL context current behind. wlr_gles2_renderer_create was assuming the EGL context was already current because of this (because it called a GL function right off the bat).
2020-05-20render/egl: unset current context after swapping buffersSimon Ser
After swapping buffers, it doesn't make sense to perform more rendering operations. Unset the context to reflect this. This commit makes it so the context is always only current between wlr_egl_make_current and wlr_egl_swap_buffers. This is an alternative to [1]. [1]: https://github.com/swaywm/wlroots/pull/2212
2020-05-19render/egl: introduce wlr_egl_unset_currentSimon Ser
This function can be called after wlr_egl_make_current to cleanup the EGL context. This avoids having lingering EGL contexts that make things work by chance. Closes: https://github.com/swaywm/wlroots/issues/2197
2020-04-09render/egl: make config attribs constSimon Ser
wlr_egl_init is not allowed to mutate these attribs.
2020-01-12render/egl: remove SURFACELESS_MESA special caseSimon Ser
Users can just pass EGL_DEFAULT_DISPLAY themselves.
2019-12-21render: fix EGL extensions not loadedSimon Ser
Some extensions are only advertised by the EGL implementation with a non-zero EGLDisplay. That's the case when the extension can only be enabled when the hardware/driver supports it for instance. Instead of checking for all extensions without a display, check only for EGL_EXT_platform_base and EGL_KHR_debug which are used before eglGetDisplay. Check for all other extensions when we have a display. Closes: https://github.com/swaywm/wlroots/issues/1955
2019-12-20Refactor EGL/GL API loadingSimon Ser
Remove glapi.sh code generation, replace it with hand-written loading code that checks extension strings before calling eglGetProcAddress. The GLES2 renderer still uses global state because of: - {PUSH,POP}_GLES2_DEBUG macros - wlr_gles2_texture_from_* taking a wlr_egl instead of the renderer
2019-10-23render/egl: prevent use-after-free when destroying current surfaceSimon Ser
2019-10-11render/egl: support formats with zero modifiersSimon Ser
2019-09-15render/egl: Change KHR_debug log to include error codeScott Anderson
2019-04-26render/egl: fix swapping with no damageSimon Ser
According to the spec: > If <n_rects> is 0 then <rects> is ignored and the entire > surface is implicitly damaged and the behaviour is equivalent > to calling eglSwapBuffers. When we want to swap with an empty damage region, set the damage to a single empty rectangle.
2019-04-23render/egl: fix zero-length VLASimon Ser
2019-04-22Fix missing headers when building without X11Alyssa Ross
The deleted includes are redundant, because other headers will include the necessary files. Additionally, they cause build failures, because including EGL/egl.h or EGL/eglext.h directly, instead of through wlr/render/egl.h or wlr/render/interface.h, will mean that MESA_EGL_NO_X11_HEADERS will not have been defined, and so the EGL headers will attempt to pull in unnecessary X11 headers that may not exist on the system. For the headers produced by glgen.sh, the includes couldn't simply be deleted, because no other header would include the EGL headers. Neither wlr/render/egl.h or wlr/render/interface.h felt appropriate to include, so I opted instead to copy the MESA_EGL_NO_X11_HEADERS definition before the EGL includes.
2019-04-01render: switch wlr_renderer to wlr_drm_format_setemersion
2018-11-13output: make wlr_egl flip the damageemersion
2018-10-28render: on Wayland, make eglSwapBuffers non-blockingemersion
2018-10-15Fix libdrm includesScott Anderson
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-14Merge pull request #1309 from swaywm/fix-headless-libinputemersion
Fix headless backend
2018-10-13Fix include path for (libdrm/)drm_fourcc.hCole Mickens
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-13Fix headless backendDrew DeVault
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-12Support older wlr_linux_dmabuf_v1 clientsnyorain
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-07-09util: add wlr_ prefix to log symbolsemersion
2018-06-17Merge branch 'master' into screencontentemersion
2018-06-09Rename egl.exts to match the extension namesVincent Vanlaer
2018-06-09Split eglSwapBuffersWithDamage feature detectionVincent Vanlaer
Detecting whether eglSwapBuffersWithDamageEXT or eglSwapBuffersWithDamageKHR is used should be based on the extension string, not only on the availability of the function.
2018-06-08Fix atti assert in wlr_egl_initBrian Ashworth
2018-06-08render/egl: only request high priority context on DRMemersion
2018-06-08render/egl: consistent extension checkingemersion
2018-06-08Request a high priority EGL contextemersion
2018-05-31Merge branch 'master' into screencontentemersion
2018-05-30render: remove wlr_renderer_check_import_dmabufemersion
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-30Only allow one modifier per DMA-BUF, split attributes struct in render/emersion
2018-05-29render: add wlr_texture_to_dmabufemersion
2018-05-23fix server exit: eglMakeCurrent Invalid displayagr
2018-05-13fix check of EGL_WL_bind_wayland_display presenceAlain Greppin
2018-04-26Log required extension name if unavailableemersion
2018-04-25render/egl: allow passing NULL to surface and image destructorsemersion
2018-04-24render/egl: add wlr_egl_destroy_surfaceemersion
2018-04-21Remove a few local prefixed symbolsemersion
2018-04-04egl: silence dmabuf error when extension is not presentGuido Günther
This makes it match 4bf936360d42fb5b96a44fd17028ae66fc462362.
2018-04-01Untie wlr_gles2_renderer and wlr_gles2_textureemersion
2018-03-31render/egl: add wlr_egl_create_image_from_wl_drmemersion
This allows external renderers and potential future GL-based renderers to re-use this function.
2018-03-28Merge pull request #744 from emersion/texture-redesignTony Crisci
Redesign wlr_texture
2018-03-27Fix issue starting up client EGL on X11 backendDrew DeVault
2018-03-27Implement layer surface damageDrew DeVault
2018-03-27Arrange & render layer surfacesDrew DeVault