wlroots/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 missing wlr_buffer_finish() in destroy impls 2025-12-20 15:02:08 -05:00
gles2 render/gles2: fix missing pop_gles2_debug on early return in render_pass_add_texture 2026-05-22 17:52:35 +08:00
pixman render/pixman: use a single global dependency 2026-05-30 16:49:13 +02:00
vulkan render/vulkan: clear blend image on first use 2026-06-12 18:11:23 +00:00
color.c render/color: assert that wlr_color_transform_pipeline contains no NULLs 2025-12-18 14:58:28 +00:00
color_fallback.c render/color: replace COLOR_TRANSFORM_LUT_3D with COLOR_TRANSFORM_LCMS2 2025-06-16 09:06:10 +00:00
color_lcms2.c render/color: replace COLOR_TRANSFORM_LUT_3D with COLOR_TRANSFORM_LCMS2 2025-06-16 09:06:10 +00:00
dmabuf.c Define _POSIX_C_SOURCE globally 2024-02-15 15:41:12 +01:00
dmabuf_fallback.c render/dmabuf: add dmabuf_export_sync_file() 2022-12-06 14:54:09 +00:00
dmabuf_linux.c render/dmabuf: lower log level for sync file import/export failure 2026-04-22 17:25:02 +00:00
drm_format_set.c render/drm_format_set: fix corruption in wlr_drm_format_set_remove() 2024-11-28 19:14:31 +00:00
drm_syncobj.c render/drm_syncobj: use drmSyncobjEventfd() 2026-03-27 18:09:07 +00:00
drm_syncobj_merger.c wl_event_loop_add_fd: Only watch for READABLE & WRITABLE 2026-05-21 15:07:21 +00:00
egl.c render/egl: disable implicit flush on context change 2026-05-21 14:58:02 -04:00
meson.build drm/syncobj: add timeline point merger utility 2026-03-17 18:14:35 +00:00
pass.c render/pass: Ensure the precision is consistent during comparison 2025-05-29 21:50:21 +08:00
pixel_format.c render/pixel-format: add function to determine YCbCr from drm fourcc 2026-02-06 13:53:46 +00:00
swapchain.c swapchain: assert that size is not empty at creation time 2025-06-16 07:54:00 +00:00
wlr_renderer.c Fix/cleanup includes a bit 2025-04-15 20:13:29 +03:00
wlr_texture.c wlr_texture: Introduce wlr_texture_preferred_read_format 2023-11-30 19:56:54 -05:00