Repository navigation
fix(windows): transparent windows and overlays stay clear on every GPU - #31
Merged
Merged
Conversation
A surface whose adapter can't composite alpha (a Win32 Vulkan surface on AMD integrated GPUs, any HWND DXGI swapchain) fell back to opaque, so overlays drew a black box. DX12 now presents through DirectComposition; a translucent surface prefers the lowest-power adapter that composites it and reuses a shared device only if it can; overlays log when transparency is unavailable.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
On Windows, a transparent overlay (Hex's HUD) draws a black box around its content on PCs whose low-power GPU can't composite alpha. Rune falls back to
Opaquewith no warning.overlay-labon a PC with an RTX 5070 Ti and an AMD Radeon integrated GPU.Why
vulkaninfoon that PC:request_adapter(LowPower)picks the AMD integrated GPU through Vulkan. Its window surface is opaque only.DxgiFromHwnd) is opaque only on every GPU (wgpu-haldx12/adapter.rs:WndHandle(_) => vec![Opaque]).Fix
flowchart LR A[translucent surface] --> B{pooled device composites alpha here?} B -- yes --> R[reuse it] B -- no --> C["request_adapter(LowPower)"] C --> D{composites alpha?} D -- yes --> U[use it] D -- no --> E["enumerate_adapters: supported + translucent,<br/>lowest power first"] E --> UGpu::instancesetsdx12.presentation_system = DxgiFromVisual. DirectComposition composites alpha on every GPU, so DX12 always offers a transparent option on Windows.translucencymodule:mode(surface, adapter)returns the translucent alpha mode, if any.window::surface_confignow uses it.prefer(instance, surface, adapter)keeps the adapter if it can do transparency; otherwise it takes the lowest-power adapter that can.serves(gpu, surface, wanted, translucent)is the reuse check for a pooled or prewarmed device.Gpu::for_surface(wanted, translucent, …). Overlays always passtrue; windows passoptions.transparent.try_with_featuresis unchanged.transparency unavailable for overlay <name>, as windows already do.request_adapter(LowPower)as before.