Log the swap chain configuration and allow an explicit sync interval #1074

Open
github-bot wants to merge 1 commit from github-bot/gh-1074 into main AGit
Owner

@⁠superboynick on GitHub · 2026-11-25 18:33 UTC · original
superboynick:feat/present-config → main · +69 −1 · 1 files · 1 commits · open

Flicker and tearing reports are hard to act on without knowing how the swap chain was built. This logs the configuration once at creation, and again whenever the present arguments change, under VICTORY_LOG_PRESENT=1: swap effect, buffer count, format, size, sample description, chain flags with tearing and waitable-object decoded, scaling and alpha mode, plus the sync interval and flags actually passed to Present.

Example from a machine that reports flicker in the prologue:

SwapEffect=FLIP_DISCARD(4) BufferCount=2 Format=28 Width=3840 Height=2160 SwapChainFlags=0x0 ALLOW_TEARING=false FRAME_LATENCY_WAITABLE_OBJECT=false Present SyncInterval=0 Flags=0x0

That already answers one question in those threads: the title presents without waiting for vblank, on a two-buffer flip chain, with tearing not permitted. Whether that is behind the flicker is testable now - VICTORY_PRESENT_SYNC=n passes an explicit interval through to Present for exactly that comparison. Default behaviour is unchanged: interval zero, no flag edits, nothing read unless the variables are set.

Measured with the switch on: interval 1 and 2 both hold the same ~30 fps this build caps at, so I cannot claim the interval fixes flicker. What I can claim is that the question is now answerable on any machine, with the numbers in the log.

Off by default; the present path is byte-identical when the variables are unset.

**@⁠superboynick** on GitHub · 2026-11-25 18:33 UTC · [original](https://github.com/fxceless/victory-fork/pull/1074) `superboynick:feat/present-config` → `main` · +69 −1 · 1 files · 1 commits · open Flicker and tearing reports are hard to act on without knowing how the swap chain was built. This logs the configuration once at creation, and again whenever the present arguments change, under `VICTORY_LOG_PRESENT=1`: swap effect, buffer count, format, size, sample description, chain flags with tearing and waitable-object decoded, scaling and alpha mode, plus the sync interval and flags actually passed to Present. Example from a machine that reports flicker in the prologue: ` SwapEffect=FLIP_DISCARD(4) BufferCount=2 Format=28 Width=3840 Height=2160 SwapChainFlags=0x0 ALLOW_TEARING=false FRAME_LATENCY_WAITABLE_OBJECT=false Present SyncInterval=0 Flags=0x0 ` That already answers one question in those threads: the title presents without waiting for vblank, on a two-buffer flip chain, with tearing not permitted. Whether that is behind the flicker is testable now - `VICTORY_PRESENT_SYNC=n` passes an explicit interval through to Present for exactly that comparison. Default behaviour is unchanged: interval zero, no flag edits, nothing read unless the variables are set. Measured with the switch on: interval 1 and 2 both hold the same ~30 fps this build caps at, so I cannot claim the interval fixes flicker. What I can claim is that the question is now answerable on any machine, with the numbers in the log. Off by default; the present path is byte-identical when the variables are unset.
Reports of tearing or flicker cannot be checked without knowing how the
swap chain was created: effect, buffer count, format, size, flags and the
arguments passed to Present. This logs exactly that once at creation and
whenever the present arguments change, under VICTORY_LOG_PRESENT=1.

VICTORY_PRESENT_SYNC=n additionally sets the sync interval passed to
Present, for testing whether a present that never waits for vblank is
behind a flicker report. Default keeps the current interval of zero, and
no flags are altered.

Neither switch is read unless set, and the present path itself is
unchanged when they are.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:57:05 +00:00
Author
Owner

@⁠superboynick on GitHub · 2026-11-25 20:24 UTC · original

Same check for this one, since "off by default" is the claim that matters here.

switch unset                       log lines 4280   configuration lines 0   sync line 0
LOG_PRESENT=1, PRESENT_SYNC=1      log lines 4285   configuration lines 4   sync line 1

Four lines total when enabled - effect and buffer count, chain flags, latency and window state, present arguments - plus one line saying the sync interval was overridden. With nothing set, none of it appears and the run is unchanged.

The four lines on this machine, for reference:

SwapEffect=FLIP_DISCARD(4) BufferCount=2 Format=28 Width=3840 Height=2160
SwapChainFlags=0x0 ALLOW_TEARING=false FRAME_LATENCY_WAITABLE_OBJECT=false
SetMaximumFrameLatency=not_called MaximumFrameLatency=unknown WS_EX_NOREDIRECTIONBITMAP=false layered=false
Present SyncInterval=0 Flags=0x0
**@⁠superboynick** on GitHub · 2026-11-25 20:24 UTC · [original](https://github.com/fxceless/victory-fork/pull/1074#issuecomment-7173618507) Same check for this one, since "off by default" is the claim that matters here. ``` switch unset log lines 4280 configuration lines 0 sync line 0 LOG_PRESENT=1, PRESENT_SYNC=1 log lines 4285 configuration lines 4 sync line 1 ``` Four lines total when enabled - effect and buffer count, chain flags, latency and window state, present arguments - plus one line saying the sync interval was overridden. With nothing set, none of it appears and the run is unchanged. The four lines on this machine, for reference: ``` SwapEffect=FLIP_DISCARD(4) BufferCount=2 Format=28 Width=3840 Height=2160 SwapChainFlags=0x0 ALLOW_TEARING=false FRAME_LATENCY_WAITABLE_OBJECT=false SetMaximumFrameLatency=not_called MaximumFrameLatency=unknown WS_EX_NOREDIRECTIONBITMAP=false layered=false Present SyncInterval=0 Flags=0x0 ```
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1074/head:github-bot/gh-1074'
git switch 'github-bot/gh-1074'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1074'
git switch 'github-bot/gh-1074'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1074'
git switch 'github-bot/gh-1074'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1074'
git switch 'main'
git merge --squash 'github-bot/gh-1074'
git switch 'main'
git merge --ff-only 'github-bot/gh-1074'
git switch 'main'
git merge 'github-bot/gh-1074'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.