diff options
| author | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-27 14:04:00 +0100 |
|---|---|---|
| committer | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-27 14:24:29 +0100 |
| commit | d42c37335b2f10e39b3e06dbc8cffe00e5178b52 (patch) | |
| tree | 227af49c085eee3fca19b6692bbf9813729a6c6a /docs | |
| parent | ec91d695ca5ffebbf327c2127ea49d89547a4e81 (diff) | |
d3d12: LEONIDA_ASYNC_MIN_BYTES_GRAPHICS, a separate async threshold for graphics (RT-ASYNC-MIN-BYTES-GRAPHICS)
With LEONIDA_ASYNC_PIPELINES=1, graphics and mesh pipelines (all their stages) now take
LEONIDA_ASYNC_MIN_BYTES_GRAPHICS when it is set, and LEONIDA_ASYNC_MIN_BYTES otherwise, so
nothing changes while it is unset. Compute keeps LEONIDA_ASYNC_MIN_BYTES. 0 makes every graphics
pipeline asynchronous. One startup line states both thresholds; text that is not a number is
ignored with a log line.
Thread dumps from a retail run showed the draw thread building lazy graphics variants under the
1 MiB threshold in place, 2.5-11 s each, back to back, with no present for about 100 s. A skipped
draw costs one draw. The image needs the small lighting and post compute programs, and those
are still built in place.
Tests: async_pipeline_size_test covers the per-kind decision and the unset fallback;
d3d12_pipeline_workers_test --async-graphics-zero / --async-graphics-unset (new ctests) hold
the compile worker with compute over its threshold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/d3d12_vulkan.md | 11 | ||||
| -rw-r--r-- | docs/running.md | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 50dd51614..bd9f62ec0 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -2950,6 +2950,17 @@ submitting thread; at the maintainers' decision it was replaced by this one when | |||
| 2950 | still goes through the compile gate and `LargeModuleGate` as before, so a smaller one a submission waits for can | 2950 | still goes through the compile gate and `LargeModuleGate` as before, so a smaller one a submission waits for can |
| 2951 | queue behind it there; `async_pipeline_size_test` covers the decision and `d3d12_m4_compute_async_small_waits` a | 2951 | queue behind it there; `async_pipeline_size_test` covers the decision and `d3d12_m4_compute_async_small_waits` a |
| 2952 | submission whose two pipelines are under the threshold with the worker held (both dispatches run). | 2952 | submission whose two pipelines are under the threshold with the worker held (both dispatches run). |
| 2953 | `LEONIDA_ASYNC_MIN_BYTES_GRAPHICS=<n>` gives graphics and mesh pipelines (all their stages) a threshold of their | ||
| 2954 | own; unset, they take `LEONIDA_ASYNC_MIN_BYTES`, as before the variable, and compute always does. `0` makes every | ||
| 2955 | graphics pipeline asynchronous, as `LEONIDA_ASYNC_PIPELINES=1` did on its own. The reason: @MoonEyes's thread dumps | ||
| 2956 | (RTX 4060, `LEONIDA_ASYNC_MIN_BYTES=1048576`) showed the draw thread building lazy graphics variants under 1 MiB in | ||
| 2957 | place (`PipelineState::variant` -> `build` -> `vkCreateGraphicsPipelines`, 2.5-11 s each, back to back), so no | ||
| 2958 | present came for about 100 s. A graphics pipeline that is not built yet costs one skipped draw, while the image | ||
| 2959 | needs the small lighting and post compute programs, so graphics can stay asynchronous while those are built where | ||
| 2960 | they are needed. One startup line states both thresholds. `d3d12_pipeline_workers_async_graphics_zero` holds the | ||
| 2961 | compile worker with compute over its threshold and graphics at `0`: every dispatch runs, every draw is skipped, and | ||
| 2962 | the draws come once the worker is let go; `d3d12_pipeline_workers_async_graphics_unset` checks that graphics follow | ||
| 2963 | `LEONIDA_ASYNC_MIN_BYTES` without the variable. | ||
| 2953 | - **Warm-ups while the title submits.** A compute warm-up holds the compile gate for its whole create, and every | 2964 | - **Warm-ups while the title submits.** A compute warm-up holds the compile gate for its whole create, and every |
| 2954 | submission waits behind it: a native boot's submissions waited 140 s in all at the gate behind compute warm-ups, and | 2965 | submission waits behind it: a native boot's submissions waited 140 s in all at the gate behind compute warm-ups, and |
| 2955 | past the story load the worker went through 694 warm-ups of modules over 128 KiB (those over 640 KiB take 4-25 s | 2966 | past the story load the worker went through 694 warm-ups of modules over 128 KiB (those over 640 KiB take 4-25 s |
diff --git a/docs/running.md b/docs/running.md index f1e46966e..3b71966d9 100644 --- a/docs/running.md +++ b/docs/running.md | |||
| @@ -116,7 +116,8 @@ Reported by others: [#1608, comment 7184700506](https://github.com/ubiquitariani | |||
| 116 | Between the two: `LEONIDA_ASYNC_PIPELINES=1` with `LEONIDA_ASYNC_MIN_BYTES=2097152` builds only the pipelines of | 116 | Between the two: `LEONIDA_ASYNC_PIPELINES=1` with `LEONIDA_ASYNC_MIN_BYTES=2097152` builds only the pipelines of |
| 117 | 2 MiB of SPIR-V or more asynchronously (the ray-tracing programs above), and the smaller lighting and post programs | 117 | 2 MiB of SPIR-V or more asynchronously (the ray-tracing programs above), and the smaller lighting and post programs |
| 118 | where they are needed, as with `=0` ([d3d12_vulkan.md](d3d12_vulkan.md), "Only the large ones asynchronous"). Whether | 118 | where they are needed, as with `=0` ([d3d12_vulkan.md](d3d12_vulkan.md), "Only the large ones asynchronous"). Whether |
| 119 | that draws the world without the skip list: TBD. | 119 | that draws the world without the skip list: TBD. `LEONIDA_ASYNC_MIN_BYTES_GRAPHICS=0` with it leaves every graphics |
| 120 | pipeline asynchronous, so the draw thread does not stop presenting to build graphics variants in place. | ||
| 120 | - **Command:** TBD. | 121 | - **Command:** TBD. |
| 121 | - **What to expect:** the opening night street from about 650 s, at 0.1-0.2 frames/s, no device loss through 934 s. | 122 | - **What to expect:** the opening night street from about 650 s, at 0.1-0.2 frames/s, no device loss through 934 s. |
| 122 | The black stretch before it is graphics pipelines of 1-2.6 MB SPIR-V compiling one at a time, 5-10 s each. | 123 | The black stretch before it is graphics pipelines of 1-2.6 MB SPIR-V compiling one at a time, 5-10 s each. |