upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/xbox_present.cpp
diff options
context:
space:
mode:
authorAlxcBTW <187763517+AlxcBTW@users.noreply.github.com>2026-11-22 13:00:38 +0100
committerAlxcBTW <187763517+AlxcBTW@users.noreply.github.com>2026-11-22 13:00:38 +0100
commitc03b573a161c1bf0f4cab9d6ab7eb8e712187ecc (patch)
tree1cbd0648d560f1e7cf9d6342803d9c13a97894d4 /runtime/shims/xbox_present.cpp
parent6728a00c2a27d9e21785d262f5ab8479c819dc89 (diff)
PresentX tear: review fixes
- find_tear_mode rejects a mode whose surface caps lack the swapchain's image usage or extent. - present_timing: a repeated or stale token is never late. - percent_scanned is measured at commit, so it agrees with the display time. - The "no effect" log distinguishes the kill switch from a missing extension or mode. - LEONIDA_PRESENT_NO_TEAR is read with _dupenv_s: any non-empty value but "0" disables. - xbox_present_test: the real-time comment is back where it belongs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/xbox_present.cpp')
-rw-r--r--runtime/shims/xbox_present.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/shims/xbox_present.cpp b/runtime/shims/xbox_present.cpp
index 47c514d97..0190d029c 100644
--- a/runtime/shims/xbox_present.cpp
+++ b/runtime/shims/xbox_present.cpp
@@ -57,8 +57,9 @@ HRESULT XboxPresentation::PresentX(UINT plane_count, const XboxPresentPlaneParam
57 const bool wants_tear = threshold > 0.0f; 57 const bool wants_tear = threshold > 0.0f;
58 if (wants_tear && !presenter_->tear_supported()) 58 if (wants_tear && !presenter_->tear_supported())
59 log_once(logged_threshold_, 59 log_once(logged_threshold_,
60 "ImmediateThresholdPercent is not implemented here (the swapchain cannot switch to IMMEDIATE or " 60 "ImmediateThresholdPercent has no effect on this swapchain (tearing disabled by LEONIDA_PRESENT_NO_TEAR, "
61 "FIFO_RELAXED: no VK_KHR/EXT_swapchain_maintenance1 or no such mode): a late frame waits for the next vblank"); 61 "no VK_KHR/EXT_swapchain_maintenance1, or no IMMEDIATE/FIFO_RELAXED mode the surface can switch to): "
62 "a late frame waits for the next vblank");
62 63
63 // Unpaced (no interval registered): do not hold the queue for vblanks. 64 // Unpaced (no interval registered): do not hold the queue for vblanks.
64 const UINT sync_interval = pacer_.registered() ? 1 : 0; 65 const UINT sync_interval = pacer_.registered() ? 1 : 0;
@@ -127,8 +128,7 @@ HRESULT XboxPresentation::PresentX(UINT plane_count, const XboxPresentPlaneParam
127 if (FAILED(result)) return pacer_.suspended() ? from_pacer(hr::invalid_state) : result; 128 if (FAILED(result)) return pacer_.suspended() ? from_pacer(hr::invalid_state) : result;
128 pacer_.commit_present_token(token, plane_count, 129 pacer_.commit_present_token(token, plane_count,
129 tear && presenter_->last_present_tore() ? leonida::PresentSync::immediate 130 tear && presenter_->last_present_tore() ? leonida::PresentSync::immediate
130 : leonida::PresentSync::vblank, 131 : leonida::PresentSync::vblank);
131 timing.late_us);
132 ++presents_; 132 ++presents_;
133 return S_OK; 133 return S_OK;
134} 134}