aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2022-12-06build: unify naming for HAVE_* definesSimon Ser
We sometimes used HAS_, sometimes polluted the LIBINPUT_ namespace, etc.
2022-12-06render/allocator/gbm: use internal_configSimon Ser
Removes a project argument.
2022-12-06render: simplify renderer_autocreate_with_drm_fd()Simon Ser
Use early returns to remove the !renderer checks.
2022-12-06render/vulkan: wait for DMA-BUF fencesSimon Ser
The Vulkan spec doesn't guarantee that the driver will wait for implicitly synchronized client buffers before texturing from them. radv happens to perform the wait, but anv doesn't. Fix this by extracting implicit fences from DMA-BUFs, importing them into Vulkan as a VkSemaphore objects, and make the render pass wait on these VkSemaphores.
2022-12-06render/dmabuf: add dmabuf_export_sync_file()Simon Ser
2022-12-03render/vulkan: use initializers for VkSubmitInfoSimon Ser
2022-12-03render/vulkan: remove stage_cb conditionalSimon Ser
We always have a stage_cb at this point.
2022-12-03render/vulkan: remove pre_cb in vulkan_end()Simon Ser
pre_cb was an alias for stage_cb->vk. Let's just use a single variable instead. Additionally, early return when vulkan_record_stage_cb() fails. We were crashing in vkCmdPipelineBarrier() if that happened.
2022-12-03render/vulkan: fix vkCmdClearAttachments validation errorSimon Ser
Skip clears with an empty scissor. Fixes the following validation error: 00:00:09.734 [wlr] [render/vulkan/vulkan.c:61] Validation Error: [ VUID-vkCmdClearAttachments-rect-02682 ] Object 0: handle = 0x62600001b100, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xadbd476f | CmdClearAttachments(): pRects[0].rect.extent.width is zero. The Vulkan spec states: The rect member of each element of pRects must have an extent.width greater than 0 (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdClearAttachments-rect-02682) (VUID-vkCmdClearAttachments-rect-02682)
2022-12-02render/vulkan: fix commaSimon Ser
2022-12-02render/vulkan: use initializers for VkImageMemoryBarrierSimon Ser
2022-12-02render/vulkan: fix missing pSignalSemaphores for stage CBSimon Ser
We were filling VkTimelineSemaphoreSubmitInfoKHR.pSignalSemaphoreValues, but we were missing VkSubmitInfo.pSignalSemaphores. This was causing VkTimelineSemaphoreSubmitInfoKHR.pSignalSemaphoreValues to be ignored. By chance, the render command buffer was using the next timeline point, so we were waiting for that instead.
2022-12-02render/vulkan: move VkDescriptorSetAllocateInfo downSimon Ser
Move it down, right before it's used.
2022-12-02render/drm_format_set: fill dst in wlr_drm_format_set_copySimon Zeni
2022-12-02render/vulkan: make shm/dmabuf split clearer in wlr_vk_format_propsSimon Ser
struct wlr_vk_format_props contains a mix of properties for shm and dmabuf, and it's not immediately clear which fields are for which kind of buffer. Use a nested struct to group the fields.
2022-12-02render/vulkan: make vulkan_format_props_find_modifier() return value constSimon Ser
2022-12-02render/vulkan: check for barrier array alloc failureSimon Ser
2022-12-02render/vulkan: improve message on format prop errorSimon Ser
Use a more appropriate message on vkGetPhysicalDeviceImageFormatProperties2() error.
2022-12-02render/vulkan: simplify vulkan_format_props_query()Simon Ser
2022-12-02render/vulkan: extract DMA-BUF format query to separate functionSimon Ser
2022-12-02render/drm-format-set: add wlr_drm_format_set_copy()Simon Ser
2022-12-02render/vulkan: add 64-bit UNORM and SFLOAT formatsSimon Ser
2022-12-02render/vulkan: add more packed formatsSimon Ser
2022-12-02render/vulkan: add more 8 bits per channel formatsSimon Ser
2022-12-02render/pixel-format: drop unnecessary fields in the tableSimon Ser
DRM_FORMAT_INVALID is zero. Let's just omit the fields to make the table more readable.
2022-12-02render/pixel-format: add various new formatsSimon Ser
2022-12-02render/vulkan: explain format mapping with DRMSimon Ser
2022-12-02render/vulkan: drop "_format" in wlr_vk_format fieldsSimon Ser
"format" is already in the name, no need to repeat ourselves. `format->vk_format` sounds a bit redundant.
2022-12-01wlr_texture: Expose owning rendererAlexander Orzechowski
2022-11-30linux-dmabuf-v1: add version arg to create()Simon Ser
To be able to add support for newer versions without breaking changes.
2022-11-30linux-dmabuf-v1: add "_with_renderer" suffix to create() functionSimon Ser
Make it clear this is a helper consuming a wlr_renderer. We'll add a lower-level create() function which doesn't take it in the next commit.
2022-11-28render/vulkan: import semaphore to DMA-BUF instead of blockingSimon Ser
Right now the Vulkan renderer blocks until the frame is complete after rendering. This is necessary because Vulkan doesn't interoperate well with implicit sync we use everywhere else. Use the new kernel API to import a sync_file into a DMA-BUF to avoid blocking.
2022-11-28render/dmabuf: add dmabuf_import_sync_fileSimon Ser
References: https://lore.kernel.org/dri-devel/20220506180216.2095060-1-jason@jlekstrand.net/
2022-11-28render/vulkan: release stage buffers after command buffer completesSimon Ser
We need to wait for the pending command buffer to complete before re-using stage buffers. Otherwise we'll overwrite the stage buffer with new contents before the texture is fully uploaded.
2022-11-28render/vulkan: destroy textures after command buffer completesSimon Ser
We need to wait for any pending command buffer to complete before we're able to fully destroy a struct wlr_vk_texture: the Vulkan spec requires the VkDescriptorSet to be kept alive. So far we've done this in vulkan_end(), after blocking until the command buffer completes. We'll soon stop blocking, so move this logic in get_command_buffer(), where we check which commands buffers have completed in a non-blocking fashion.
2022-11-28render/vulkan: drop unused fields from wlr_vk_format_modifier_propsSimon Ser
export_imported is never used, and dmabuf_flags is already checked in query_modifier_support().
2022-11-25render/vulkan: align staging buffers for texture uploadManuel Stoeckl
vkCmdCopyBufferToImage requires that the buffer offset be a multiple of the texel block size, which for single plane uncompressed formats is the same as the number of bytes per pixel. This commit adds an alignment parameter to vulkan_get_stage_span which ensures that the provided span (and the sequence of image copy operations derived which use it) have this alignment.
2022-11-25render/vulkan: add support for RGB565 texture formatManuel Stoeckl
Since this does not have a matching _SRGB-type vulkan format, add a new shader variant/pipeline to perform the sRGB->linear texture conversion.
2022-11-24render: stop pulling <wlr/backend.h>Simon Ser
Let's just forward-declare struct wlr_backend instead. We need to fixup the Vulkan renderer: it needs makedev(), which got included by chance via <wlr/backend.h> → <wlr/backend/session.h> → <libudev.h>.
2022-11-21render/vulkan: update shm texture data in one batchManuel Stoeckl
2022-11-17allocator/drm_dumb: use libdrm dumb buffer helpersSimon Ser
References: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/272
2022-11-15render: use wlr_shm in wlr_renderer_init_wl_shm()Simon Ser
2022-11-15render/pixel_format: import pixel_format_info_check_stride()Simon Ser
We'll use this function from wlr_shm too. Add some assertions, use int32_t (since the wire protocol uses that, and we don't want to use 16-bit integers on exotic systems) and switch the stride check to be overflow-safe.
2022-11-15render/vulkan: detect device lossSimon Ser
2022-11-15render/egl: enable EGL_LOSE_CONTEXT_ON_RESETSimon Ser
This allows the GLES2 renderer to figure out when a GPU reset happens.
2022-11-15render/gles2: query glGetGraphicsResetStatusKHRSimon Ser
Call glGetGraphicsResetStatusKHR in wlr_renderer_begin to figure out when a GPU reset occurs. Destroy the renderer when this happens (the OpenGL context is defunct).
2022-11-15render: add wlr_renderer.events.lostSimon Ser
2022-11-15render: make wlr_renderer_begin return a boolSimon Ser
2022-11-15render: allow wlr_renderer_impl.begin to failSimon Ser
Make it return a bool to indicate success/failure. Adapt the various implementations to check errors.
2022-11-15render/vulkan: add wlr_vk_texture_has_alphazccrs
Allow to get whether has alpha channel of the VkImage, it can help an optimization to disable blending when the texture doesn't have alpha. Because the VkFormat isn't enough because it's always set to VK_FORMAT_B8G8R8A8_SRGB or VK_FORMAT_R8G8B8A8_SRGB.