Add DirectComposition for DX12 backend (for transparency) #7462
+132
−6
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.
Note that the demo window has its window background disabled.
DirectComposition can be used to draw windows with transparent content that blend in via the desktop compositor. This PR aims to add transparency support for viewport windows using that.
DCOMP
has to be#define
d to check this PR in action.Only DX12 backend has been modified to support DirectComposition, since while DX11 also supports using DC-provided swap chains, DX11 is supported on Windows 7 whereas DC is available starting from Windows 8, and I wanted to make the amount of code added minimal by omitting code that checks for supported features.
Related PR: #2766
I thought that having
ImGuiBackendFlags_RendererHasTransparentViewports
set from backend implementation would work better than a user settingImGuiConfigFlags_TransparentBackbuffers
manually as needed, as it probably is more of a backend capability rather than a user-configurable thing.