Skip to content

mullion: enable CAMetalLayer framebufferOnly and displaySyncEnabled for VSync - #367

Open
cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/metal-layer-framebuffer-vsync
Open

cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/metal-layer-framebuffer-vsync

Conversation

@cyyever

@cyyever cyyever commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Set layer_props_.framebuffer_only = true in Presenter::Presenter() (src/mullion/mullion_presenter.cpp): the CAMetalLayer drawable is only ever bound as a render target attachment (the GDI readback fallback uses a separate window_target_ texture when !layer_), so enabling framebufferOnly allows Metal/CoreAnimation to skip unnecessary texture usage overhead and enable direct scanout optimizations.
  • Propagate VSync requests (after > 0) to layer_props.display_sync_enabled in both D3D11 (ArgumentEncodingContext::flushCommands() in src/mullion/mullion_context.cpp) and D3D12 (MTLD3D12CommandQueueImpl::Present() in src/d3d12/d3d12_command_queue.cpp), which _MetalLayer_setProps already applies to CAMetalLayer.displaySyncEnabled.

Verification

  • Syntax-checked src/mullion/mullion_presenter.cpp, src/mullion/mullion_context.cpp, and src/d3d12/d3d12_command_queue.cpp with x86_64-w64-mingw32-g++ -std=c++20 -Wall -Wextra.

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.

1 participant