dx12: Enable Rgba8Unorm storage textures for DirectComposition transparency #8908
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.
Summary
This PR forces storage texture support for Rgba8Unorm, Rgba8Snorm, and Bgra8Unorm formats on DX12. These formats are widely supported for UAV typed store on modern GPUs, but DX12's
D3D12_FORMAT_SUPPORT2_UAV_TYPED_STOREquery may not report this correctly.This is needed for GPU-accelerated 2D rendering libraries like Vello to work with transparent windows using DirectComposition on Windows.
Changes
Single change in
instance.rs: ForceSTORAGE_BINDINGsupport for the three common 8-bit RGBA formats after the standard capability detection.Background
When using Vello with DirectComposition for transparent windows on Windows:
WGPU_DX12_PRESENTATION_SYSTEM=DxgiFromVisual)STORAGE_BINDINGon Rgba8Unorm texturesThe error without this patch:
Testing
Revision Notes
Based on @DJMcNab's feedback, I've simplified this PR to only include the
instance.rschange. The other changes (todevice/resource.rsandpresent.rs) were not necessary since Vello renders to an intermediate texture, not directly to the swapchain.🤖 Generated with Claude Code