diff --git a/src/d3d12/d3d12_command_queue.cpp b/src/d3d12/d3d12_command_queue.cpp index c9d5e960..27e8f0cb 100644 --- a/src/d3d12/d3d12_command_queue.cpp +++ b/src/d3d12/d3d12_command_queue.cpp @@ -2704,6 +2704,7 @@ class MTLD3D12CommandQueueImpl : public MTLD3D12Pageablefirst_present.compare_exchange_strong(unset, std::chrono::steady_clock::now()); } auto state = presenter->synchronizeLayerProperties(); + state.layer_props.display_sync_enabled = after > 0; if (Holding() && Hold([this, swapchain = Com(swapchain), presenter, backbuffer = Com(backbuffer), view, hLantecyWaitable, after, id, number, state, previous = Com(previous), copies, scaler = Rc(scaler), diff --git a/src/mullion/mullion_context.cpp b/src/mullion/mullion_context.cpp index 2f49eef5..a0d7edcf 100644 --- a/src/mullion/mullion_context.cpp +++ b/src/mullion/mullion_context.cpp @@ -1499,6 +1499,7 @@ ArgumentEncodingContext::flushCommands(WMT::CommandBuffer cmdbuf, uint64_t seqId } case EncoderType::Present: { auto data = static_cast(current); + data->state.layer_props.display_sync_enabled = data->after > 0; auto t0 = clock::now(); auto drawable = data->presenter->encodeCommands( cmdbuf, data->backbuffer, data->state, diff --git a/src/mullion/mullion_presenter.cpp b/src/mullion/mullion_presenter.cpp index faf954cb..c9a25d38 100644 --- a/src/mullion/mullion_presenter.cpp +++ b/src/mullion/mullion_presenter.cpp @@ -21,7 +21,7 @@ Presenter::Presenter(WMT::Device device, WMT::MetalLayer layer, InternalCommandL layer_props_.device = device; layer_props_.opaque = true; layer_props_.display_sync_enabled = false; - layer_props_.framebuffer_only = false; // how strangely setting it true results in worse performance + layer_props_.framebuffer_only = true; layer_props_.contents_scale = layer_props_.contents_scale * scale_factor; }