wlroots/include/render
twilligon 5d150267e2 render/vulkan: clear blend image on first use
The two-pass blend image is created with VK_IMAGE_LAYOUT_UNDEFINED, so
on its first use loadOp=LOAD loads uninitialized memory. This oughtn't
be an issue, as we render onto it before we read it. These renders are
blends, so even opaque content is rendered with reference to an uninit
dst. This too ought to be fine: src*1 + dst*0 = src for all finite dst.

But the blend image pixfmt is VK_FORMAT_R16G16B16A16_SFLOAT, so uninit
pixels can be NaN, inf, or -inf, and now src*1 + dst*0 = NaN/inf/-inf.
This is bad enough assuming the uninitialized blend image holds random
bytes (2048/65536 values are not finite), even worse on any driver/GPU
with a framebuffer compression scheme that so happens to reliably read
NaNs from any uninitialized compressed image...

Most Mesa drivers happen not to do this perfectly valid thing, so this
is only reliably a problem (afaict) for honeykrisp i.e. AGX i.e. Asahi
Linux i.e. Apple Silicon, where after an upgrade to wlroots 0.20, sway
renders a black screen forever, unless you get quite lucky spamming VT
switches, in which case there's flickery garbage on exactly one of the
two swapchain buffers.

The blend image persists across frames, so it suffices to clear before
first real use. Rather than clear by hand, make a loadOp=CLEAR variant
of the render pass and use it for that first frame only. Adding a pass
sounds heavy, but render pass compatibility ignores loadOp and layouts
such that the new pass reuses the pipelines and framebuffer, and costs
one VkRenderPass object but not the usual pipeline/shader (re)compile.
2026-06-12 18:11:23 +00:00
..
allocator render/allocator: add udmabuf allocator 2024-12-22 21:37:57 +00:00
color.h treewide: fix typos 2026-02-28 04:26:47 -03:00
dmabuf.h render/dmabuf: add dmabuf_export_sync_file() 2022-12-06 14:54:09 +00:00
drm_format_set.h wlr_drm_format: Rework wlr_drm_format_intersect 2023-05-11 18:24:43 +02:00
drm_syncobj_merger.h linux_drm_syncobj_v1: add _state_add_release_from_implicit_sync() 2026-04-22 17:18:48 +00:00
egl.h render/egl: disable implicit flush on context change 2026-05-21 14:58:02 -04:00
gles2.h render/gles2: Fix wording 2026-04-19 15:33:56 +02:00
pixel_format.h render/pixel-format: add function to determine YCbCr from drm fourcc 2026-02-06 13:53:46 +00:00
pixman.h renderer: Drop buffer binding 2023-11-30 20:11:50 -05:00
vulkan.h render/vulkan: clear blend image on first use 2026-06-12 18:11:23 +00:00
wlr_renderer.h renderer: Drop mention of wlr_renderer_begin_with_buffer 2024-11-11 22:48:50 +00:00