mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 07:31:06 -04:00
A draw that misses its pipeline has the rest of its submission read ahead, and the stage libraries of the pipelines the later draws need are queued at once.
The next draw with a new pipeline was only found when the replay reached it, so the draws of an area's first frame, or of a turn that brings several new materials into view, paid for their pipelines one after another while the workers that could have built them together sat idle. The submission is recorded before it is replayed: the first draw of a submission that finds a shader or pipeline missing now has the ops after it read (vk_exec.c vk_exec_ahead) with the binds that decide a draw's shaders and shader libraries applied to a copy of the replay state. Each draw there looks its shaders up as the real draw will, which also queues a shader that is not in memory, and names its state to vk_pipeline_hint, which queues the pre-rasterization and fragment shader libraries that are missing. No pipeline is entered and no key recorded, so a wrong guess costs two libraries at most. The draw's own lookup then links on its thread when both libraries are there. On a first visit to Kokiri Forest a scan read 6,900 ops in 0.78 ms on average (the longest 5.5 ms; a scan ends after 3 ms), and the scans of the load and the walk named 377 states without a pipeline and queued 104 libraries for them. pipe_ahead = 0 (NX2NAVI_PIPE_AHEAD) turns it off. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -121,7 +121,14 @@ keeps per-core data without locks and relies on that, so the host models it (`ru
|
||||
ring of Vulkan `{x, y, z}` records filled on the GPU.
|
||||
- Pipelines: `VK_EXT_graphics_pipeline_library` where the driver has it: stage libraries compiled ahead, a fast link
|
||||
at a new state, an optimised pipeline replacing it from a background thread. A draw whose pipeline is not ready is
|
||||
skipped when one of its pass's targets was rendered in the previous frame, and waits otherwise. Compute pipelines
|
||||
skipped when one of its pass's targets was rendered in the previous frame, and waits otherwise. Three things keep
|
||||
that short on a first visit (`runtime/vk_pipeline.c`): a pipeline whose fragment shader reads a target of its own
|
||||
pass is fast-linked like any other, the feedback loop flags being part of the fragment output library alone
|
||||
(`gpl_feedback`); the library workers also link the pipelines of skipped draws, so a burst of new materials is
|
||||
linked on several threads while the pool is inside optimised builds (`lib_worker`, `fast_take`); and the first
|
||||
draw of a submission that misses has the rest of the submission read ahead, which queues the stage libraries of
|
||||
every pipeline the later draws need before the replay reaches them (`runtime/vk_exec.c` `vk_exec_ahead`,
|
||||
`vk_pipeline_hint`). Mesh pipelines have no libraries and are built whole. Compute pipelines
|
||||
are compiled outside the pipeline lock, and one compile serves every thread that needs it. The boot builds the
|
||||
pipeline of every compute shader play recorded or the shader preparation listed, but keeps only those of the shaders
|
||||
dispatched most recently (`compute-used.bin`, `compute_keep`): the others go into the pipeline cache and are
|
||||
|
||||
Reference in New Issue
Block a user