Skip to content

Opt-in DirectComposition flip-model backend (present=dcomp), A/B vs blt+DwmFlush - #25

Merged
Maxaubert merged 1 commit into
mainfrom
feat/dcomp-backend-optin
May 25, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
feat/dcomp-backend-optin

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Closes #24. Adds present=dcomp as an opt-in presentation backend (default present=blt unchanged), so the DComp flip-model path can be A/B-tested by feel. Keeps WS_EX_LAYERED on both (spike-proven to coexist with DComp). If dcomp wins we make it the only path and delete blt. 32 tests pass; both backends verified rendering (incl. HDR). Default behavior identical → safe to merge.

🤖 Generated with Claude Code

…nt=dcomp) (#24)

Spike proved WS_EX_LAYERED + DirectComposition flip-model coexist (cross-process
click-through AND display both work) - my earlier PR #11 only broke clicks because
it dropped WS_EX_LAYERED. Add it as an opt-in A/B backend, default unchanged:

- present=blt (default): blt-model swapchain on the layered HWND, paced by DwmFlush.
- present=dcomp: flip-model CreateSwapChainForComposition + DComp visual on the SAME
  WS_EX_LAYERED window (click-through preserved), paced natively by vsync Present(1,0).
  Per-pixel alpha for show/hide (transparent frame to hide); magnify PS now outputs
  alpha 1.0 (no-op for blt under LWA_ALPHA).

Switching requires a restart (swapchain is created at init). Default behavior is
identical, so this is safe to merge; dcomp is for A/B by feel. If it wins we make it
the sole path and delete blt. build.bat test: 32 cases / 94 assertions; both backends
verified rendering correctly via WIND_SELFTEST (incl. HDR FP16).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Maxaubert
Maxaubert merged commit 0747231 into main May 25, 2026
1 check passed
@Maxaubert
Maxaubert deleted the feat/dcomp-backend-optin branch May 25, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opt-in DirectComposition flip-model presentation backend (A/B vs blt+DwmFlush)

1 participant