[PR #6435] [MERGED] Reduce latency with DXGI 1.3 GetFrameLatencyWaitableObject #26682

Open
opened 2026-01-31 09:17:32 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6435
Author: @beviu
Created: 6/9/2020
Status: ✅ Merged
Merged: 6/10/2020
Merged by: @undefined

Base: master ← Head: dxgi13-frame-latency


📝 Commits (9)

  • 46d94ca Reduce latency with DXGI 1.3 swap chains
  • 9a9778b Add version guards for Windows 7
  • 9f752d7 Do version check at runtime instead of compile time
  • 8d657e5 const
  • b3cf55a Use wil::unique_handle
  • 6c202f0 Remove WINBLUE
  • 713f94b Keep swap chain creation flags as member
  • 4fd7e75 Add check for WaitForSingleObjectEx
  • 4b5e52f format

📊 Changes

9 files changed (+72 additions, -1 deletions)

View changed files

📝 src/renderer/base/RenderEngineBase.cpp (+7 -0)
📝 src/renderer/base/renderer.cpp (+10 -0)
📝 src/renderer/base/renderer.hpp (+1 -0)
📝 src/renderer/base/thread.cpp (+1 -0)
📝 src/renderer/dx/DxRenderer.cpp (+43 -1)
📝 src/renderer/dx/DxRenderer.hpp (+5 -0)
📝 src/renderer/inc/IRenderEngine.hpp (+2 -0)
📝 src/renderer/inc/IRenderer.hpp (+1 -0)
📝 src/renderer/inc/RenderEngineBase.hpp (+2 -0)

📄 Description

This pull request reduces input lag, especially with selection, by using
IDXGISwapChain2::GetFrameLatencyWaitableObject.

This is based on the DXGI 1.3 documentation.

Excerpt from the DXGI 1.3 improvement list:

The following functionality has been added in Microsoft DirectX
Graphics Infrastructure (DXGI) 1.3, which is included starting in
Windows 8.1.

Before, during rendering:

  1. render frame
  2. call Present on swap chain:
    2.a. blocks until it can present
    2.b. meanwhile, selection/text in terminal might have changed, but
    we're still using the frame that we rendered before blocking
    2.c. presents

After, during rendering:

  1. block until we can present
  2. render frame with latest data
  3. call Present on swap chain:
    3.a. present without blocking

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/6435 **Author:** [@beviu](https://github.com/beviu) **Created:** 6/9/2020 **Status:** ✅ Merged **Merged:** 6/10/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dxgi13-frame-latency` --- ### 📝 Commits (9) - [`46d94ca`](https://github.com/microsoft/terminal/commit/46d94ca2fb0d9e826acd3267ca00486add92b116) Reduce latency with DXGI 1.3 swap chains - [`9a9778b`](https://github.com/microsoft/terminal/commit/9a9778b3c819bfc13a9d314b6e07761a5aa77070) Add version guards for Windows 7 - [`9f752d7`](https://github.com/microsoft/terminal/commit/9f752d7050053999bdd8956e25703b8e9918dadc) Do version check at runtime instead of compile time - [`8d657e5`](https://github.com/microsoft/terminal/commit/8d657e5f85726f0efaea4c7273af07c0c0dc3df0) const - [`b3cf55a`](https://github.com/microsoft/terminal/commit/b3cf55a65aae0ee07a1e1b194ec944ad29607b4c) Use wil::unique_handle - [`6c202f0`](https://github.com/microsoft/terminal/commit/6c202f0c26b7e63b6276dd80dfd5526493f26f26) Remove WINBLUE - [`713f94b`](https://github.com/microsoft/terminal/commit/713f94b2c9e52c5119ba517286474639ff5f5258) Keep swap chain creation flags as member - [`4fd7e75`](https://github.com/microsoft/terminal/commit/4fd7e75d00e6db8ac3cecb34c02a38028de3d571) Add check for WaitForSingleObjectEx - [`4b5e52f`](https://github.com/microsoft/terminal/commit/4b5e52f89a22a3fd1cff05690257cb8c2781288f) format ### 📊 Changes **9 files changed** (+72 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/base/RenderEngineBase.cpp` (+7 -0) 📝 `src/renderer/base/renderer.cpp` (+10 -0) 📝 `src/renderer/base/renderer.hpp` (+1 -0) 📝 `src/renderer/base/thread.cpp` (+1 -0) 📝 `src/renderer/dx/DxRenderer.cpp` (+43 -1) 📝 `src/renderer/dx/DxRenderer.hpp` (+5 -0) 📝 `src/renderer/inc/IRenderEngine.hpp` (+2 -0) 📝 `src/renderer/inc/IRenderer.hpp` (+1 -0) 📝 `src/renderer/inc/RenderEngineBase.hpp` (+2 -0) </details> ### 📄 Description This pull request reduces input lag, especially with selection, by using `IDXGISwapChain2::GetFrameLatencyWaitableObject`. This is based on the [DXGI 1.3 documentation]. Excerpt from the [DXGI 1.3 improvement list]: > The following functionality has been added in Microsoft DirectX Graphics Infrastructure (DXGI) 1.3, which is included starting in Windows 8.1. Before, during rendering: 1. render frame 2. call `Present` on swap chain: 2.a. blocks until it can present 2.b. meanwhile, selection/text in terminal might have changed, but we're still using the frame that we rendered before blocking 2.c. presents After, during rendering: 1. block until we can present 2. render frame with latest data 3. call `Present` on swap chain: 3.a. present without blocking [DXGI 1.3 documentation]: https://docs.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains [DXGI 1.3 improvement list]: https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-1-3-improvements: --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:17:32 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26682