aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2024-02-22render/vulkan: Avoid double-free on calloc errorKenny Levinsen
In query_modifier_support, the calloc for either or both of render_mods and texture_mods may fail, in which case both are freed for convenience. However, if one is non-NULL, vulkan_format_props_finish will try to free it again. NULL them to avoid double-free.
2024-02-22render/drm_format_set: Clean up on union failureKenny Levinsen
If drm_format_set_extend fails, we need to make sure each wlr_drm_format is cleaned up together with the formats array. Finish the set to take care of it.
2024-02-15Define _POSIX_C_SOURCE globallySimon Ser
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead, require POSIX.1-2008 globally. A lot of core source files depend on that already. Some care must be taken on a few select files where we need a bit more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and some files need BSD extensions (_DEFAULT_SOURCE). In both cases, these feature test macros imply _POSIX_C_SOURCE. Make sure to not define both these macros and _POSIX_C_SOURCE explicitly to avoid POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001 but _XOPEN_SOURCE says POSIX.1-2008). Additionally, there is one special case in render/vulkan/vulkan.c. That file needs major()/minor(), and these are system-specific. On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need to make sure it's not defined for this file. On Linux, we can explicitly include <sys/sysmacros.h> and ensure that apart from symbols defined there the file only uses POSIX toys.
2024-02-12Add more POSIX compliance macros to fix uClibc supportPaul Cercueil
- Add POSIX 1993.09 compliance macro in source files that use "struct timespec"; - Add POSIX 2001.12 compliance macro in source files that use "struct sigaction" and the SA_SIGINFO macro, or the fchmod() function; - Add POSIX 2008.09 compliance macro in source files that use the getline() function. These compliance macros are enough for wlroots to compile with the git-master version of uClibc-ng. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2024-02-02allocator: remove backend parameter in allocator_autocreate_with_drm_fdAustin Shafer
Since we only use the backend capabilities here we can simply pass them in directly. This allows other locations to create an allocator even if they don't have a backend. They can simply specify the caps they want instead.
2024-01-31render/gles2: Fixup dropping has_alpha from pixel_formatLeo Li
Fixes: 71fb55f3 ("render/pixel-format: Move has_alpha into it's own array")
2024-01-31render/pixel-format: Move has_alpha into it's own arrayLeo Li
Some opaque pixel formats (nv12, p010) require per-plane bytes_per_block info. However, it doesn't make sense to store them in wlr_pixel_format_info, as they will never be useful (currently, this info is used for shm, which doesn't have a concept of multi-planar buffers.) Let's define a separate array and function for determining whether a pixel format has alpha.
2024-01-26render/vulkan: correct sRBG gamma expansion in shaderFĂ©lix Poisot
2024-01-17render/drm_format_set: fix possible leak on realloc errorKirill Primak
2024-01-17render/vulkan: fix possible double freeKirill Primak
2024-01-04Fix bool return typesSimon Ser
This makes wlroots build in C23 mode. C23 is more strict and rejects implicit conversions from bool to a pointer.
2024-01-03render: stop auto-creating wl_drmSimon Ser
wl_drm is a legacy interface superseded by the linux-dmabuf protocol. All clients should migrate. As a first step, stop creating the wl_drm global by default. This should let us discover any remaining issues in clients. Compositors can still manually create the global if they want to. As a second step, we can completely drop our implementation.
2023-12-11render/pixman: add wlr_pixman_renderer_get_buffer_image()Roman Gilg
This is similar to wlr_pixman_texture_get_image and can be useful for compositors to access the rendering data.
2023-12-05render/gles2: add wlr_gles2_renderer_get_buffer_fbo()Simon Ser
Replacement for wlr_gles2_renderer_get_current_fbo(). Wayfire uses it for instance.
2023-12-04render: disable linux-dmabuf without DRM FDSimon Ser
linux-dmabuf used to not need a DRM FD, however since v4 a DRM FD is required for the main_device event.
2023-12-04render/vulkan: use _SRGB image view when possibleManuel Stoeckl
This is the last of a set of commits which ensures that both textures and render buffers can be accessed through _UNORM and _SRGB image views. While _UNORM image views are not yet used for 8-bpc image formats, they will be needed in the future to support color transforms for both textures and render buffers.
2023-12-04render/vulkan: constify vulkan_format_props_find_modifierManuel Stoeckl
2023-12-04render/vulkan: create VkImage with option for _SRGB view, if possibleManuel Stoeckl
2023-12-04render/vulkan: detect which _UNORM formats support _SRGB viewsManuel Stoeckl
2023-12-04render/vulkan: extract shm texture format query into functionManuel Stoeckl
2023-12-04render/vulkan: track and use _UNORM variants of _SRGB formatsManuel Stoeckl
Later commits will start using _SRGB image views again, where appropriate.
2023-12-03swapchain: Add wlr_swapchain_has_bufferAlexander Orzechowski
2023-11-30renderer: Drop buffer bindingAlexander Orzechowski
2023-11-30render: Nuke old read pixels APIAlexander Orzechowski
Sadly, the new API is not backwards compatible with the old API. Since we have already switched all users in wlroots to the new API compositors are already practically mandated to implement the new API. Let's get rid of the old one since there is no point.
2023-11-30render: Implement texture_preferred_read_formatAlexander Orzechowski
2023-11-30wlr_texture: Introduce wlr_texture_preferred_read_formatAlexander Orzechowski
2023-11-30render/vulkan: Implement texture_read_pixelsAlexander Orzechowski
2023-11-30render/gles2: Implement texture_read_pixelsAlexander Orzechowski
Also get rid of gles2_texture.owns_texture. We only use the tex/fbo
2023-11-30render/pixman: Implement texture_read_pixelsAlexander Orzechowski
2023-11-30wlr_texture: Introduce wlr_texture_read_pixels_options helpersAlexander Orzechowski
2023-11-30wlr_texture: Introduce wlr_texture_read_pixelsAlexander Orzechowski
2023-11-30render/gles2: save/restore context when creating/submitting a render passSimon Ser
This is useful for e.g. lazily blitting a texture for readback purposes while rendering.
2023-11-30render/gles2: reword wlr_gles2_texture commentsSimon Ser
These comments were a bit misleading: - "GL_TEXTURE_2D == mutable": not really, imported non-external-only DMA-BUFs would also use this target, but are not mutable. - "Only affects target == GL_TEXTURE_2D": same here. - "If imported from a wlr_buffer": not really, would be NULL if imported from a shm wlr_buffer. Adjust these comments to better reflect reality and adjust the check in gles2_texture_update_from_buffer().
2023-11-30render/gles2: Inline texture invalidationAlexander Orzechowski
Let's us share more code with the other code path
2023-11-30render/gles2: Don't attach texture as buffer addonAlexander Orzechowski
Since wlr_gles2_buffer is now managing importing for us, there is no reason for us to continue doing this.
2023-11-30render/gles2: Don't track image in textureAlexander Orzechowski
We can get it from the buffer
2023-11-30render/gles2: Don't double import dmabufAlexander Orzechowski
We can double import a dmabuf if we use it as a texture target and a render target. Instead, let's unify render targets and texture dmabuf imports to use wlr_gles2_buffer which manages the EGLImageKHR
2023-11-30render/gles2: Destroy textures firstAlexander Orzechowski
Since imported textures will be based off of gles2_buffer we have to destroy textures first or else they will have an invalid reference to the buffers they are imported from.
2023-11-30renderer/gles2: Bail rendering to external buffers when binding themAlexander Orzechowski
We can't do it while we're creating them because we'll want to use gles2 buffers for textures soon.
2023-11-30render/gles2: Lazily create buffer fboAlexander Orzechowski
2023-11-29render: Drop rendering_with_bufferAlexander Orzechowski
This is always true now that we can only render with a buffer.
2023-11-29renderer: Drop wlr_renderer_beginAlexander Orzechowski
2023-11-29render/gles2: check external-only flag in get_or_create_buffer()Simon Ser
If the external-only flag is set, then the EGLImage is only supported for use with GL_TEXTURE_EXTERNAL_OES texture targets. In particular, the EGLImage cannot be bound to a RBO.
2023-11-29render/gles2: Don't track has_alpha in pixel_formatAlexander Orzechowski
Why track the alpha here when we can already get that information elsewhere?
2023-11-28render/egl: fallback to GBM FD if EGLDevice is not availableSimon Ser
It's possible that we don't have an EGLDevice if we created the EGL context from a GBM device. Let's ensure all GPU-accelerated renderers always have a DRM FD to return by falling back to GBM's FD.
2023-11-28render/vulkan: drop current_command_bufferSimon Ser
This was used by the legacy rendering API. Since begin()/end() only need to set current_render_buffer and nothing else, we can drop all of these bits.
2023-11-25Cleanup wlr_matrix.h includesSimon Ser
Many files used to require wlr_matrix but no longer do.
2023-11-23util/transform: move over wl_output_transform helpersSimon Ser
These aren't really tied to wlr_output.
2023-11-22render: drop legacy rendering APISimon Ser
2023-11-22render/vulkan: drop legacy rendering APISimon Ser