aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2023-01-19render/vulkan: check that requested size is smaller than maxSimon Ser
Fail with a clearer error when the requested size is too large. Without this, we allocate a buffer with a size smaller than what was requested. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3975
2023-01-18vulkan: increase max stage size to support large buffersBrett Ernst
2023-01-18render/vulkan: use correct source offset in read_pixelsllyyr
2022-12-22render/vulkan: always finish buffer addon on texture destroyKirill Primak
2022-12-22render/vulkan: remove NULL renderer check on texture destroyKirill Primak
2022-12-13render/egl: stop advertising render support for external-only formatsSimon Ser
Some formats like YUV are only supported by Mesa for sampling, not for rendering. However we always unconditionally added the INVALID modifier to the list of render formats. Check whether all modifiers are external-only, in that case, don't add INVALID to the list of render formats.
2022-12-12egl: consistently use EGLint for DMA-BUF formatSimon Ser
EGL_EXT_image_dma_buf_import_modifiers [1] uses EGLint to carry formats. We were casting it to int (which may not be the same width) and uint32_t (which may change the value). Instead, use EGLint everywhere. [1]: https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt
2022-12-08render/pixman: skip mask for opaque texture renderingSimon Ser
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