aboutsummaryrefslogtreecommitdiff
path: root/include/render
AgeCommit message (Collapse)Author
2022-11-07render/vulkan: fix and add missing wl_list commentsSimon Ser
In wlroots we add comments near struct wl_list members to indicate which type it's linked to. The Vulkan renderer had some comments with mistakes, and some members without a comment.
2022-11-04render/vulkan: drop outdated commentsSimon Ser
2022-11-04render/vulkan: remove exts arg from vulkan_instance_create()Simon Ser
2022-11-04render/vulkan: add caching to vulkan_read_pixelsDavid96
2022-10-25render/gles2: remove stale gles2_texture_from_wl_drm() prototypeSimon Ser
This function doesn't exist anymore.
2022-10-10render/vulkan: drop wlr_vk_instance.extensionsSimon Ser
This was unused. Even if it was, it'd be better to have bool fields instead.
2022-09-30render/vulkan: use addon for wlr_vk_textureSimon Ser
Avoids having to walk the list of all textures.
2022-09-30render/vulkan: use addon for wlr_vk_render_bufferSimon Ser
Avoids having to walk the list containing all of the render buffers.
2022-09-19render/egl: add support for EGL_KHR_display_referenceSimon Ser
See the spec at [1]. tl;dr EGL has terrible defaults: eglTerminate() may have side-effects on completely unrelated EGLDisplay objects. This extension allows us to opt-in to get the sane behavior: eglTerminate() only free's our own EGLDisplay without affecting others. [1]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_display_reference.txt
2022-09-07render/vulkan: drop wlr_vk_device.extensionsSimon Ser
We don't need to store the list of enabled extensions. While at it, rename variables to be less confusing.
2022-09-07render/vulkan: drop ext params from vulkan_device_create()Simon Ser
These are unused.
2022-05-25render/egl: make wlr_egl_{make,unset,is}_current privateSimon Ser
These are trivial wrappers around eglMakeCurrent and eglGetCurrentContext. Compositors which need to call these functions will also call other EGL or GL functions anyways. Let's reduce our API surface a bit by making them private.
2022-05-25render/egl: make wlr_egl struct opaqueSimon Ser
Compositors can use wlr_egl_create_with_context if they need a custom EGL display or context.
2022-05-07render/gles: add support for some 16-bpc unsigned shm formatsManuel Stoeckl
These formats require EXT_texture_norm16, which in turn needs OpenGL ES 3.1. The EXT_texture_norm16 extension does not support passing gl_internalformat = GL_RGBA to glTexImage2D, as can be done for formats available in OpenGL ES 2.0, so this commit adds a field to wlr_gles2_pixel_format to provide a more specific internalformat parameter to glTexImage2D.
2021-11-26render/drm_format_set: add wlr_drm_format_hasSimon Ser
2021-11-17Remove support for DMA-BUF flagsSimon Ser
They are never used in practice, which makes all of our flag handling effectively dead code. Also, APIs such as KMS don't provide a good way to deal with the flags. Let's just fail the DMA-BUF import when clients provide flags.
2021-11-09render/allocator: make wlr_allocator part of the public APISimon Zeni
2021-10-18render/vulkan: add Vulkan renderernyorain
This new renderer is implemented with the existing wlr_renderer API (which is known to be sub-optimal for some operations). It's not used by default, but users can opt-in by setting WLR_RENDERER=vulkan. The renderer depends on VK_EXT_image_drm_format_modifier and VK_EXT_physical_device_drm. Co-authored-by: Simon Ser <contact@emersion.fr> Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2021-10-02Fix spelling errorsElyes HAOUAS
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-01Revert "render/drm_format_set: add wlr_drm_format_has"Simon Ser
This reverts commit 833437d5921339f2862ccfb0493617630ea3937d.
2021-10-01render/drm_format_set: add wlr_drm_format_hasSimon Ser
2021-09-01render/allocator/gbm: fix create() docs for FD ownershipSimon Ser
Fixes: d9d8fc1ab9b7 ("render/allocator: re-open GBM FD")
2021-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-08-12render/gles2: make wlr_gles2_texture a wlr_buffer addonSimon Ser
2021-08-12render/gles2: make wlr_gles2_buffer an addonSimon Ser
Saves us from walking a list.
2021-07-30render/gles2: add a few 10-bit and FP16 formatsManuel Stoeckl
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-30render/gles2: hide shm formats without GL supportManuel Stoeckl
This change introduces a new function to check whether the renderer has the needed GL extensions to read a given pixel format.
2021-07-22render/wlr_texture: put wlr_texture_from_buffer into the public APISimon Zeni
2021-07-12render/gles2: rename wlr_egl.exts to better match KhronosSimon Ser
Khronos refers to extensions with their namespace as a prefix in uppercase. Change our naming to align with Khronos conventions. This also makes grepping easier.
2021-07-05render/egl: remove EGL_WL_bind_wayland_display supportSimon Ser
Our GLES2 renderer doesn't use it anymore, so we can drop it.
2021-07-01render: drop wlr_renderer_impl.texture_from_dmabufSimon Ser
2021-07-01render: drop wlr_renderer_impl.texture_from_pixelsSimon Ser
2021-06-30render/egl: replace wlr_egl_create with wlr_egl_create_with_drm_fdSimon Ser
We never create an EGL context with the platform set to something other than EGL_PLATFORM_GBM_KHR. Let's simplify wlr_egl_create by taking a DRM FD instead of a (platform, remote_display) tuple. This hides the internal details of creating an EGL context for a specific device. This will allow us to transparently use the device platform [1] when the time comes. [1]: https://github.com/swaywm/wlroots/pull/2671
2021-06-24render/egl: make most functions privateSimon Ser
The wlr_egl functions are mostly used internally by the GLES2 renderer. Let's reduce our API surface a bit by hiding them. If there are good use-cases for one of these, we can always make them public again. The functions mutating the current EGL context are not made private because e.g. Wayfire uses them.
2021-06-09render: drop wlr_ prefix from wlr_renderer_bind_bufferSimon Ser
Make it clear this function is a private wlroots API and will stay that way.
2021-06-07render/pixman: implement texture_from_bufferSimon Ser
2021-05-31render/allocator: add wlr_allocator.buffer_capsSimon Ser
This allows users to know the capabilities of the buffers that will be allocated. The buffer capability is important to know when negotiating buffer formats.
2021-05-30render/gles2: fix texture cleanup on destroySimon Ser
When importing a DMA-BUF wlr_buffer as a wlr_texture, the GLES2 renderer caches the result, in case the buffer is used for texturing again in the future. When the wlr_texture is destroyed by the caller, the wlr_buffer is unref'ed, but the wlr_gles2_texture is kept around. This is fine because wlr_gles2_texture listens for wlr_buffer's destroy event to avoid any use-after-free. However, with this logic wlr_texture_destroy doesn't "really" destroy the wlr_gles2_texture. It just decrements the wlr_buffer ref'count. Each wlr_texture_destroy call must have a matching prior wlr_texture_create_from_buffer call or the ref'counting will go south. Wehn destroying the renderer, we don't want to decrement any wlr_buffer ref'count. Instead, we want to go through any cached wlr_gles2_texture and destroy our GL state. So instead of calling wlr_texture_destroy, we need to call our internal gles2_texture_destroy function. Closes: https://github.com/swaywm/wlroots/issues/2941
2021-05-17render/gles2: implement texture_from_bufferSimon Ser
Make it so wlr_gles2_texture is ref'counted (via wlr_buffer). This is similar to wlr_gles2_buffer or wlr_drm_fb work. When creating a wlr_texture from a wlr_buffer, first check if we already have a texture for the buffer. If so, increase the wlr_buffer ref'count and make sure any changes made by an external process are made visible (by invalidating the texture). When destroying a wlr_texture created from a wlr_buffer, decrease the ref'count, but keep the wlr_texture around in case the caller uses it again. When the wlr_buffer is destroyed, cleanup the wlr_texture.
2021-05-17render: introduce wlr_texture_from_bufferSimon Ser
This adds a a function to create a wlr_texture from a wlr_buffer. The main motivation for this is to allow the renderer to create a single wlr_texture per wlr_buffer. This can avoid needless imports by re-using existing textures.
2021-05-05render: add DRM dumb buffer allocatorSimon Zeni
2021-05-05render/gbm_allocator: duplicate drm fd during creation processSimon Zeni
2021-04-29render/allocator: add allocator_autocreate_with_drm_fdSimon Ser
Same as wlr_allocator_autocreate, but allows the caller to force a DRM FD. Similar to renderer_autocreate_with_drm_fd.
2021-04-29render: remove wlr_ prefix from wlr_renderer_autocreate_with_drm_fdSimon Ser
This function is only required because the DRM backend still needs to perform multi-GPU magic under-the-hood. Remove the wlr_ prefix to make it clear it's not a candidate for being made public.
2021-04-28render/allocator: introduce wlr_allocator_autocreateSimon Zeni
2021-04-28render: introduce renderer_get_render_buffer_capsSimon Zeni
2021-04-28render/shm_allocator: make wlr_shm_allocator_create return a wlr_allocatorSimon Zeni
2021-04-28render/gbm_allocator: make wlr_gbm_allocator_create return a wlr_allocatorSimon Zeni
2021-04-27render/pixman: implement preferred_read_formatSimon Zeni
2021-04-22render/pixman: destroy textures on renderer teardownSimon Ser