Create FSR 3.1's pipelines through the pipeline caches kept across runs, so a context is not compiled again at every start the driver's own cache does not serve.

The library creates its pipelines itself and names no pipeline cache. It is now handed pipeline creates of the runtime's in the place of the device's two, and a create without a cache is asked of the pipeline cache first and compiled into the play cache otherwise. ffx_pipe_cache = 0 turns it off. --probe-ffx-cache makes one upscaling context without a window or the game and says where its pipelines came from, and tests/ffx_cache_check.py runs it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 05:22:56 -05:00
parent b55d2eb3e1
commit d073d80e70
11 changed files with 292 additions and 7 deletions

View File

@@ -874,5 +874,13 @@ void vk_pipeline_autosave(void); // vk_pipeline_save at most every 20
void vk_pipeline_shutdown(void); // waits for background builds, saves, destroys pipelines, layouts and the
// cache; before vk_shutdown
int vk_pipeline_selftest(void); // one graphics and one compute pipeline from census shaders; 0 on success
// Pipelines a library creates on our device without a pipeline cache of its own (FSR 3.1, vk_ffx.cpp), through the
// pipeline caches kept across runs; as vkCreateComputePipelines (compute 1) or vkCreateGraphicsPipelines with no cache.
VkResult vk_pipeline_create_foreign(VkDevice dev, int compute, uint32_t n, const void *infos,
const VkAllocationCallbacks *alloc, VkPipeline *out);
// How many it made so far: from_cache came without a compile and compiled went into the play cache (both only with a
// play cache, which is what can tell them apart); uncached were created with no cache of ours.
typedef struct { uint64_t made, from_cache, compiled, uncached; } VkForeignPipes;
void vk_pipeline_foreign_counts(VkForeignPipes *o);
#include "vk_rec.h" // last: its macros route the vkCmd* calls of every file that includes vk.h