Commit Graph

9 Commits

Author SHA1 Message Date
0a3bf1ed91 PresentX planes: enable swapchain_colorspace on the real instance, premultiply before filtering
- create_vulkan_device_standalone now enables VK_EXT_swapchain_colorspace when the loader has it (only the
  test device did), so the HDR10 surface formats can be listed in the real runtime; xbox_present_test checks
  the standalone path (device_has_swapchain_colorspace).
- Straight-alpha planes are bilinearly filtered on premultiplied colour and un-premultiplied after, so a
  transparent texel adds no colour; the CPU model does it independently, plus a transparent-edge case.

Both found in review by Flyander.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:34:38 +01:00
9bf0794813 PresentX planes: review fixes (resize, struct order, overlay flag, ResourceCount)
- Re-prepare the compose target after the acquire/out-of-date retry and check the extent in
  record_planes; xbox_present_test resizes the window between composed presents.
- XboxPresentPlaneParameters follows the public field order exactly (adds ExtendedDescCount,
  pExtendedDescs); implausible placement / unknown filter / extended descs are ignored and
  logged once, not refused.
- Plane 1 is composed only with our overlay flag (SDR/SDR no longer blends by default).
- present_planes rejects a non-positive or NaN SDR white level.
- ResourceCount != 1 is refused with DXGI_ERROR_UNSUPPORTED before either path (found by Flyander).
- Docs: PQ-space filtering, HDR10 swapchain verified on RTX 5080 by JavierBlanco23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:11:01 +01:00
76262214e8 PresentX planes (M7): compose 1-2 planes on Vulkan with placement, filter, alpha overlay and HDR10/SDR conversion
A plain single plane keeps the old blit. A plane with pDestPlacementBase, a point/linear
ScaleFilter, the HDR10 colour space, or a second overlay plane goes through
VulkanPresenter::present_planes: a compute pass (present_compose.comp, SPIR-V embedded)
into an RGBA16F image that is copied to the swapchain. HDR10 uses an ST.2084 swapchain
when the surface lists one, else is clipped to SDR. An SDR plane 1 next to an HDR10 plane 0
is the GameDVR copy (public HDR sample) unless flagged an overlay. The layouts, flag values
and alpha convention are ours; xbox_present_test checks every case against a CPU model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:51:05 +01:00
f3e6d5a9b4 Merge pull request #1523 from AlxcBTW 2026-11-22 07:38:02 -05:00
2f54b2c171 xbox_present: skip the known sRGB swapchain STORAGE validation VUID
NVIDIA's validation layer checks the presenter's sRGB swapchain as if it requested STORAGE, then reports VUID-VkSwapchainCreateInfoKHR-imageFormat-01778 and its max-layers/max-extent follow-ons. The presenter only requests TRANSFER_DST, plus TRANSFER_SRC for capture, so that is a layer false positive. Count this VUID separately and return the ctest skip code only when it is the sole validation error; any other error, or a mix, still fails.

The matcher is covered by synthetic first-message and follow-on checks in xbox_present_test. On an RX 7900 XTX with validation on, the test remains clean and passes.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:03:54 -06:00
c03b573a16 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>
2026-11-22 13:00:38 +01:00
6728a00c2a PresentX: implement ImmediateThresholdPercent with VK_KHR/EXT_swapchain_maintenance1
A frame presented after the vblank it was due at is flipped at once (IMMEDIATE, else
FIFO_RELAXED) when the scan would be within the threshold percentage of the screen,
instead of waiting a whole interval. The decision is the pure
leonida::decide_present_sync(late_us, interval_us, threshold); FramePacer reports the
lateness against the vblank after the token's origin and records the tear in
GetFrameStatisticsX (PercentScanned) and immediate_presents().

VulkanPresenter creates a vsync swapchain with FIFO plus the tear mode when the surface
lists it as compatible (VkSurfacePresentModeCompatibilityKHR) and chains
VkSwapchainPresentModeInfoKHR on a tearing present. The device enables the KHR (else EXT)
extension, its feature and the matching instance extensions only where present; without
them the threshold is ignored and logged once, as before. LEONIDA_PRESENT_NO_TEAR=1 turns
it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:54:49 +01:00
daff874493 XboxPresentation: present null/stale/repeated tokens with a log, MSAA gives DXGI_ERROR_UNSUPPORTED, SuspendX never waits on a present; tests and docs
xbox_present_test presents with null, repeated and stale tokens (the present
happens) and refuses never-issued ones, and presents MSAA, integer and BC sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:28:34 +01:00
b7a0232523 runtime: XboxPresentation (PresentX 0/1/2 planes, frame events, Suspend/ResumeX) and xbox_present_test
Provisional struct layouts and constants of ours; real slots unmeasured (TODO
table in the header). The test reads the swapchain image back on a Vulkan
device and runs the frame events on a fake clock, then 30 frames in real time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:28:06 +01:00