diff options
| author | YaBulochka <yabulochka@users.noreply.github.com> | 2026-11-24 00:47:45 +0300 |
|---|---|---|
| committer | YaBulochka <yabulochka@users.noreply.github.com> | 2026-11-24 00:48:42 +0300 |
| commit | 88797f3ebdf89be12ab59db1bf69ca00a86d97e1 (patch) | |
| tree | 6a49e399a43511bfdb75c91cd8c449a8c4146671 /docs/d3d12_vulkan.md | |
| parent | 5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (diff) | |
d3d12: LEONIDA_CAPTURE writes the presented frames to disk
A question that keeps coming back on the boot path is "what is actually on screen", and the window is not a reliable
answer: under Wine it is not mapped at all, and even on Windows a compositor or a capture-blocked surface can hide
the content. The presenter already copies every presented frame into a staging buffer when capture is enabled, so
this adds the disk side: `LEONIDA_CAPTURE=<dir>` writes each captured frame as a binary PPM and appends the extent
and the mean RGB to `<dir>/index.txt`, with `LEONIDA_CAPTURE_EVERY` and `LEONIDA_CAPTURE_LIMIT` bounding the run.
Off unless set, and created with the folder if it is missing. The write happens on the fence that already covers the
copy, so the present path is untouched.
d3d12_present_test turns it on and checks the files against the colour the test clears to: at least half the captured
frames (it resizes and injects failures on purpose, so a frame caught mid-transition is a near miss), and no frame
black. A capture that reads the wrong or a stale buffer fails there instead of in a report months later.
Diffstat (limited to 'docs/d3d12_vulkan.md')
| -rw-r--r-- | docs/d3d12_vulkan.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 019f66fa2..49d6a93de 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -3137,6 +3137,13 @@ queue they came on (one `VkQueue` behind all of them). | |||
| 3137 | presents a loading screen with `Token = 0`, presents again with one token, or presents from a render thread out of | 3137 | presents a loading screen with `Token = 0`, presents again with one token, or presents from a render thread out of |
| 3138 | order must not freeze. So those are presented anyway and logged once per kind; only a token that was never handed | 3138 | order must not freeze. So those are presented anyway and logged once per kind; only a token that was never handed |
| 3139 | out gives `E_INVALIDARG` (nothing presented). Skipping a token is fine. | 3139 | out gives `E_INVALIDARG` (nothing presented). Skipping a token is fine. |
| 3140 | - *Frame capture* (`LEONIDA_CAPTURE=<dir>`, `LEONIDA_CAPTURE_EVERY=<n>`, `LEONIDA_CAPTURE_LIMIT=<n>`): writes | ||
| 3141 | every n-th presented frame (default 30, at most 24) to `<dir>/frame_NNNNN.ppm`, a binary P6 of the swapchain image | ||
| 3142 | converted to 8-bit RGB, and appends one line per frame to `<dir>/index.txt` with the extent and the mean RGB. Off | ||
| 3143 | unless the variable is set, and the folder is created. This is what a check reads when it has to know what the | ||
| 3144 | layer actually presented: the window is not readable in every setup (under Wine it is not even mapped), and the | ||
| 3145 | mean is enough to tell a real frame from a black one. `d3d12_present_test` turns it on and checks the files against | ||
| 3146 | the colour it clears to. | ||
| 3140 | - *`SuspendX`/`ResumeX`*: suspend drops the interval, the origin event and the frames in flight, wakes blocked waits | 3147 | - *`SuspendX`/`ResumeX`*: suspend drops the interval, the origin event and the frames in flight, wakes blocked waits |
| 3141 | with `ERROR_INVALID_STATE` and refuses presents (a `PresentX` waiting for a swapchain image polls the suspended | 3148 | with `ERROR_INVALID_STATE` and refuses presents (a `PresentX` waiting for a swapchain image polls the suspended |
| 3142 | state every 50 ms and gives up, so `SuspendX` never waits on it); resume allows presents again, but waits fail until | 3149 | state every 50 ms and gives up, so `SuspendX` never waits on it); resume allows presents again, but waits fail until |