gpu: enable DXGI allow-tearing swap chain presentation (VICTORY_TEARING=0 opt-out) #23
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!23
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/23/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Androtim on GitHub · 2026-11-28 07:13 UTC · original
Androtim:feat/iter38-swapchain-allow-tearing→main· +99 −2 · 1 files · 1 commits · closed without mergingSummary
Port DXGI allow-tearing swap-chain presentation from
trustno1-coder/VIctory-NVIDIA(8fc2254) intocrates/victory-gpu/src/host.rs:IDXGIFactory5::CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING)inHost::presenterunlessVICTORY_TEARING=0.DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARINGat swap-chain creation andResizeBuffers, andDXGI_PRESENT_ALLOW_TEARINGonPresent.host::batch::tearing_flags_and_env_opt_out.Rig Specs Tested On
Run Settings & Profile
release/victory --features diagnostics@86065e3series-s(defaultverify-world.ps1baseline profile)offDLSS quality(-DlssMode quality)offVICTORY_*Overrides:D:\victory-build\verify-tools\verify-world.ps1 -Exe 'D:\victory-build\verify-bins\pr23-diag.exe' -GoldenDataDir 'D:\victory-data\golden-data-minivi' -OutDir 'D:\victory-data\verify-runs\pr23-allow-tearing' -WorldSeconds 75 -AutoNudgeMenu(VICTORY_TEARINGdefault on ->tearing=true)draws >= 500, max11320draws/frame), 75s in-world after reaching world drawsMeasurements & Verification
3.15 fps(321.35 ms, min1.0 fps) — early dock/transition windows compiled885 -> 502remaining PSOs (1.0–3.4 fps).5701–6076draws/frame, last 5 windows):8.7–9.9 fps(median9.4 fps,100.6–115.2 ms/frame,preparing 54.9–57.9 ms,GPU 0.5–1.2 ms,copyback 8.3–9.2 ms).tearing=true,0refused presents.24PNGs sampled (luma 104.84,edge_energy 7.12,0.0%magenta); inspectedframe-9122.pngandframe-9170.png(full lighting, sky/water/character detail, HUD intact).off)copystatpeak5970 MBVRAM in use /6952 MBbudget (5476 MBshared PC RAM),final_waiting=4352,passes that made none for lack of room: 00(crashes=0,no_host_texture_errors=0)cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy(asset policy: 294 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask(6 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings(0warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings(0warnings)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib(449 passed; 0 failed; 36 ignored, includinghost::batch::tearing_flags_and_env_opt_out)--releasebuilds (objdump -p:0non-system MinGW DLLs)@Androtim on GitHub · 2026-11-28 08:03 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Clean, well-scoped port of DXGI
ALLOW_TEARINGswap-chain presentation incrates/victory-gpu/src/host.rs, with passing CI and unit coverage (host::batch::tearing_flags_and_env_opt_out).What Was Verified
tearing,tearing_allowed_by_env): ChecksVICTORY_TEARING(default enabled; trimmed"0"opts out), castsIDXGIFactory2toIDXGIFactory5, and queriesCheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING)with aBOOL-sized output buffer. Falls back cleanly tofalseif the cast or query fails.Host::presenter,Host::present_planes): SetsDXGI_SWAP_CHAIN_FLAG_ALLOW_TEARINGonDXGI_SWAP_CHAIN_DESC1::Flags(already flip-discard withBUFFERS = 2) and preservesp.tearingviachain_flags(p.tearing)onResizeBuffers, matching DXGI's requirement thatALLOW_TEARINGcannot be toggled during resize.Host::present_planes): Separates immutablePresenter::tearingfrom runtimePresenter::presents_tearing. On a failedPresent(0, DXGI_PRESENT_ALLOW_TEARING)(shown.is_err(), which correctly ignores non-error status codes likeDXGI_STATUS_OCCLUDED), logs once, disablespresents_tearingfor the rest of the run, and retriesPresent(0, DXGI_PRESENT(0)). Subsequent non-tearing present failures are also logged once viaPresenter::present_refused.Notes for Maintainers
ALLOW_TEARING(bundled with underwater shader926c46bab3b86bd6recovery, which is separately split into PR #24). Merging PR #23 will supersede the tearing portion of PR #11.ResizeBuffers, andPresentpath—and the reported RTX 4060 Ti run had frame generationoff—a local GPU smoke test covering default tearing,VICTORY_TEARING=0, window resize, and Streamline/FSR3 frame-generation swap chains (if applicable) is recommended before merging.Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-11-28 21:18 UTC · original
Closing as superseded duplicate of merged PR #11.
github-bot referenced this pull request2026-12-02 16:38:32 +00:00
github-bot referenced this pull request2026-12-03 17:03:43 +00:00
Pull request closed