Repository navigation
Overlays stay on the compositor's GPU, fail alone, and rebuild their renderer on a new device - #73
Closed
ship-it-mind wants to merge 1 commit into
Closed
ship-it-mind wants to merge 1 commit into
ship-it-mind wants to merge 1 commit into
Conversation
…renderer on a new device (anomalyco#72, hex#982) - translucency::prefer: when the compositor named its GPU, only adapters on it are candidates. On GNOME + NVIDIA with an AMD iGPU, NVIDIA's X11 driver reports only opaque alpha for an XWayland overlay, RADV claims premultiplied, and RADV can't make a swapchain on an NVIDIA-driven XWayland (VK_ERROR_INITIALIZATION_FAILED). - Overlay::attach: configure the surface in a validation error scope and fail the overlay, instead of wgpu's default handler panicking the whole app. - Overlay::attach: a new Gpu drops the previous show's renderer, whose buffers live on the old device (Cannot get non-existent resource BufferId). Compositor::render documents that f.device can change between frames.
Member
|
thanks, this analysis was spot on. we don't merge outside prs, so it's rewritten in 53c0c9a on dev along the same lines: prefer stays on the compositor's gpu, overlay configure goes through an error scope and fails just that overlay, an overlay keeps its own device across shows and drops its renderer on a new one. hex picked it up in anomalyco/hex#986. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #72 (reported from anomalyco/hex#982).
On GNOME (no layer-shell) with an NVIDIA GPU driving the displays and an AMD iGPU present, every Rune app with an input-free overlay panics. Hex's window dies at launch or at the first dictation.
Changes
translucency::prefer: when the compositor named its GPU (Pick::knows_compositor), only adapters on that GPU are candidates. NVIDIA's X11 driver reports onlyOPAQUEalpha for the XWayland overlay. RADV claimsPRE_MULTIPLIED | INHERITandis_surface_supported, but itsvkCreateSwapchainKHRon an NVIDIA-driven XWayland returnsVK_ERROR_INITIALIZATION_FAILED. wgpu reports that asSurface::configure: Invalid surface, and the default handler panics. The overlay now draws opaque on the compositor's GPU instead. This follows the rulegpu/pick.rsalready states.Overlay::attach: configures the surface inside a validation error scope (native targets), so a surface that can't be configuredfail()s that overlay instead of panicking the app.Overlay::attach: when it makes a newGpu(which happens on every show once the pooled device doesn'tservea translucent surface), it drops the previous renderer, which is then rebuilt on the new device along with the atlases. Before, it kept the old renderer and only calledrebuild_renderer, which panics withCannot get non-existent resource BufferId(3,1)the second time the overlay shows.Compositor::rendernow documents thatf.devicecan change between frames. Hex's HUD compositor needs the matching change (hex#982).Verification
cargo clippy -p rune --libon Linux: builds, with the same warning count before and after the change (632).0x1and the swapchain succeeds; RADV reports alpha0xaand the swapchain returns-3.WGPU_ADAPTER_NAME=nvidia(which skipsprefer) removes the launch panic, and theBufferIdpanic then appears on the HUD's next show.cargo test -p rune --libdoesn't compile on Linux atdevhead with or without this change (cannot find `metal` in `gpu`, four errors).Trade-off
On a laptop whose compositor runs on an opaque-only iGPU, an overlay used to move to a discrete GPU that claims translucency; it now draws opaque on the iGPU. That is the same rule the window already follows (a non-compositor GPU's buffers may not be shown).