Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use direct composition for d3d12 backend #99387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0x0ACB
Copy link
Contributor

@0x0ACB 0x0ACB commented Nov 18, 2024

This PR fixes #95630 and can be seen as a partial fix for #76167.

Update D3D12 Renderer to Use Direct Composition

This commit updates the D3D12 renderer to use CreateSwapChainForComposition instead of CreateSwapChainForHwnd, addressing the lack of alpha support in the latter (see #95630).

Switching to direct composition is supposed to have additional benefits according to the Microsoft documentation and other online resources. Specifically, it eliminates the need to transfer the final image to the CPU for DWM composition, which is suggested to improve performance. While I have not empirically verified these performance claims, the explanation aligns with my own research into transparency issues and DWM behavior.

Compatibility Notes

This change requires Windows 8 or later. However, since D3D12 is unsupported on Windows 7 (now EOL for nearly five years), this should not pose a compatibility issue.

platform/windows/detect.py Outdated Show resolved Hide resolved
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, transparency is working as expected.

drivers/d3d12/rendering_context_driver_d3d12.h Outdated Show resolved Hide resolved
Copy link
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to merge after @AThousandShips' suggestion is rebased

@Repiteo Repiteo modified the milestones: 4.x, 4.4 Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DX12 renderer does not support window transparency
4 participants