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

Open
superboynick wants to merge 1 commit from upstream-pr/1074 into main
superboynick commented 2026-11-25 18:33:57 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by superboynick on 2026-11-25T18:33:57Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6611132898 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1074). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-25T18:33:57Z. --- 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 commented 2026-11-25 21:05:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by superboynick on 2026-11-25T20:24:11Z.


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
<!-- greyfinch-sync:fxceless/victory-fork:comment:7173618507 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1074#issuecomment-7173618507). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-25T20:24:11Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1074:upstream-pr/1074'
git switch 'upstream-pr/1074'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1074'
git switch 'upstream-pr/1074'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1074'
git switch 'upstream-pr/1074'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1074'
git switch 'main'
git merge --squash 'upstream-pr/1074'
git switch 'main'
git merge --ff-only 'upstream-pr/1074'
git switch 'main'
git merge 'upstream-pr/1074'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1072
No description provided.