Keep the vertex layout in the pipeline on AMD's RDNA 3 and newer driver, and save the pipeline cache while a large compute shader builds.

AMD's driver for RDNA 3 and newer compiles a pipeline that has dynamic vertex input again at every boot: neither pipeline-cache.bin nor the driver's own disk cache gives it back. On an RX 7900 XT (26.10.1) a player's key file of 3,979 records used the whole 20 s boot budget at every boot. Dynamic vertex input is now off by default on that driver (vk_caps.amd_llpc); with the vertex layout in the pipeline the third boot of that file built 4,273 pipelines in 0.9 s, all from the file. NX2NAVI_VK_DYN_VERTEX=1 turns it back on. The RDNA 1 and 2 driver branch is not measured and keeps it.

The background builder of large compute shaders now compiles into a pipeline cache of its own and merges it into the main one when the build is done. A create into the main cache holds the cache's lock for its whole length and the cache is only saved while nobody holds it, so a build of minutes kept pipeline-cache.bin from being written at all: on the same card one compute shader of 4,874,502 SPIR-V words was still compiling 590 s after the boot, and nothing built in that session reached the file.

NX2NAVI_PIPE_FEEDBACK=2 also logs every graphics pipeline build with hashes of its modules and its fixed state, which is how the recompiles were found.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
epicmeme546
2026-11-09 18:17:12 -05:00
parent b303c2aa90
commit 76c3661aff
3 changed files with 82 additions and 14 deletions

View File

@@ -61,10 +61,11 @@ typedef struct {
int gpl; // VK_EXT_graphics_pipeline_library enabled with fast linking (NX2NAVI_GPL=0: off)
int amd; // an AMD GPU (vendor 0x1002), any driver
int amd_sc; // AMD's Windows driver branch for RDNA 1 and 2 ("AMD proprietary shader compiler")
int amd_llpc; // AMD's own driver for RDNA 3 and newer (its driverInfo names LLPC)
int mesa; // a Mesa driver the game runs on: RADV, ANV or NVK
} VkCaps;
extern VkCaps vk_caps;
void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, mesa
void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, amd_llpc, mesa
void vk_caps_features(VkPhysicalDeviceFeatures *f); // before vkCreateDevice (NX2NAVI_VK_NO_FLOAT64 clears shaderFloat64)
// Before vkCreateDevice, with the driver's graphics pipeline library feature and properties: sets vk_caps.gpl,
// 1 = enable the extensions (VK_KHR_pipeline_library, VK_EXT_graphics_pipeline_library) and the feature.