aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2020-01-12render/egl: remove SURFACELESS_MESA special caseSimon Ser
Users can just pass EGL_DEFAULT_DISPLAY themselves.
2019-12-31render: guard rendering operations between begin() and end()Simon Ser
Add a wlr_renderer.rendering bool, set it to true between wlr_renderer_begin() and wlr_renderer_end(). Assert we're rendering when calling functions that render.
2019-12-23meson: Various improvementsScott Anderson
Bumps minimum version to 0.51.0 - Remove all intermediate static libraries. They serve no purpose and are just add a bunch of boilerplate for managing dependencies and options. It's now managed as a list of files which are compiled into libwlroots directly. - Use install_subdir instead of installing headers individually. I've changed my mind since I did that. Listing them out is annoying as hell, and it's easy to forget to do it. - Add not_found_message for all of our optional dependencies that have a meson option. It gives some hints about what option to pass and what the optional dependency is for. - Move all backend subdirectories into their own meson.build. This keeps some of the backend-specific build logic (especially rdp and session) more neatly separated off. - Don't overlink example clients with code they're not using. This was done by merging the protocol dictionaries and setting some variables containing the code and client header file. Example clients now explicitly mention what extension protocols they want to link to. - Split compositor example logic from client example logic. - Minor formatting changes
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-11-26render/gles2: do not set GL_TEXTURE_MAG_FILTERRonan Pigott
2019-11-25render: remove return in wlr_texture_get_sizeSimon Ser
Otherwise this error happens: ../subprojects/wlroots/render/wlr_texture.c: In function ‘wlr_texture_get_size’: ../subprojects/wlroots/render/wlr_texture.c:47:9: error: ISO C forbids ‘return’ with expression, in function returning void [-Werror=pedantic] 47 | return texture->impl->get_size(texture, width, height); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../subprojects/wlroots/render/wlr_texture.c:45:6: note: declared here 45 | void wlr_texture_get_size(struct wlr_texture *texture, int *width, | ^~~~~~~~~~~~~~~~~~~~
2019-11-20Add -Wmissing-prototypesSimon Ser
This requires functions without a prototype definition to be static. This allows to detect dead code, export less symbols and put shared functions in headers.
2019-11-11Introduce wlr_renderer_get_eglDrew DeVault
2019-11-07render/gles2: provide public API to access GL textureSimon Ser
Prior to this commit, compositors needed to render the texture to an intermediate off-screen buffer using wlr_renderer APIs if they wanted to use a custom rendering path (e.g. render to a 3D scene). A new wlr_gles2_texture_get_attribs exposes the GL texture target and ID so that compositors can render wlr_textures with their own shaders. An example of a compositor doing so is available at [1]. [1]: https://git.sr.ht/~sircmpwn/wxrc/tree/3db905b7842ac42cf1878876e647005b41f00a52/src/render.c#L227
2019-11-06render/gles: Simplify textures a bitScott Anderson
We don't need our own enum for types. Instead we just use GL_TEXTURE_{2D,EXTERNAL_OES}, which already describes usage. Also fixes a situation where we were using GL_TEXTURE_2D in a situation we should not have. wl_drm buffers are always GL_TEXTURE_EXTERNAL_OES, no matter if they're RGB or any other format.
2019-10-23render/egl: prevent use-after-free when destroying current surfaceSimon Ser
2019-10-16render/gles2: don't unset the current EGL surface when destroying textureSimon Ser
When a texture is destroyed between wlr_egl_make_current and wlr_egl_swap_buffers, it resets the current EGL surface to NULL. This makes wlr_egl_swap_buffers fail. If the EGL context is already current, there's no need to reset it.
2019-10-11render/egl: support formats with zero modifiersSimon Ser
2019-09-15render/egl: Change KHR_debug log to include error codeScott Anderson
2019-08-31render/gles2: fix calculation for partial gles2 pixel read (#1809)Filip Sandborg
2019-08-12Revert "render/drm: keep old drm_format if realloc fails"Drew DeVault
This reverts commit c1be9b6945f9c664fe694a09620758db9ca695e9.
2019-08-12render/drm: keep old drm_format if realloc failsAntonin Décimo
2019-06-07render/dmabuf: add wlr_dmabuf_attributes_copySimon Ser
2019-06-07backend/drm: check format when scanning out DMA-BUFSimon Ser
2019-05-07render/gles2: print GL_RENDERERSimon Ser
This is often the name of the GPU and can help debugging graphics issues.
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
2019-04-01render: introduce wlr_drm_format_setScott Anderson
This types adds a container for formats + modifiers. A list that is of [format [modifier]] was chosen instead of [format modifer] because that is how GBM accepts them. Co-Authored-By: emersion <contact@emersion.fr>
2019-03-01meson: enable more compiler warningsemersion
2019-01-29Require libdrm >= 2.4.95emersion
2018-12-21Standardize the wlr_box input paramatersTimidger
Fixes #1094
2018-11-24output: add wlr_output_preferred_read_format()Ilia Bozhinov
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-13output: make wlr_egl flip the damageemersion
2018-11-10render: correctly set EGL_RENDERABLE_TYPEemersion
This should be set to EGL_OPENGL_ES2_BIT. Also fixes EGL config attributes in the headless and X11 backends.
2018-11-04render/gles2: check for GL_OES_EGL_image_externalemersion
2018-11-04render/gles2: remove assumptions about supported formatsemersion
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-10-28render: on Wayland, make eglSwapBuffers non-blockingemersion
2018-10-16Use enum wl_shm_format for gles2 texture formatsnyorain
Also rephrase the write_pixels comment.
2018-10-15Remove fmt parameter from wlr_texture_write_pixelsnyorain
It's not allowed to change the format of a texture so remove the confusing parameter.
2018-10-15render: fix meson including libdrmCole Mickens
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-09-02Init dmabuf global in rendereremersion
2018-08-24Change how glgen.sh outputs filesScott Anderson
This fixes building wlroots as a subproject.
2018-08-24Revert "Revert "Merge pull request #1194 from ascent12/meson_feature""Scott Anderson
This reverts commit 9c886f20b97b6ab1ac85b849f1fe7f16eb199ff0.
2018-08-23Revert "Merge pull request #1194 from ascent12/meson_feature"Drew DeVault
This breaks wlroots when used as a meson subproject. This reverts commit dea311992eb4ff3e343c3cf5b0603034223d2a42, reversing changes made to 6db9c4b74667c1d917d720f5e96985a2461569fb.
2018-08-22Make style more consistentScott Anderson
2018-08-03gles2: change context when it is not currentMariusz Bialonczyk
Texture functions, that create and manipulate textures should switch the current context if necessary. thanks to: @emersion Fixes #934
2018-07-13Revert "Move side-effect out of assert statement"Drew DeVault
This reverts commit a0afedcd8fbeb2013252e629d524aa83cdd9326e.