PearlCache

Skip shader recompiles and GPU buffer resizes on every Vulkan launch.

ShaderC SPIR-V & DynamicGpuData Buffer Resizes (n=5 Vulkan + 150-Mod)

PearlCache persists compiled ShaderC SPIR-V and the Vulkan VkPipelineCache to disk, and pre-sizes RenderPearl's dynamic GPU buffers so they never grow at runtime. It is a client-side Fabric mod for Minecraft's Vulkan renderer.

PearlCache is an independent project and is not affiliated with RenderPearl.

Why PearlCache?

  • Shader compile time cut by 82.4%: 2,270 ± 394 ms → 399 ± 68 ms on warm launches (n=5 vs n=5, p_holm = 0.002, 402/402 cache hits).
  • Zero runtime buffer resizes: 18.6 ± 0.9 → 0 per run, including the very first cold boot.
  • No steady-state FPS cost: 168.5 ± 20.3 vs 177.9 ± 15.3 FPS, a difference within noise (p = 0.43).

Quick Start

  1. Install Fabric Loader 0.20.0 or newer.
  2. Download PearlCache from Modrinth.
  3. Drop the JAR into your mods folder and launch with Java 25 or newer.

PearlCache has no keybinds or commands. It works automatically; the first launch fills the cache and later launches reuse it. Fabric API is not declared as a dependency.

Features

FeatureWhat it does
ShaderC SPIR-V disk cacheSHA-256 key over format version, shader name, stage, backend flags, #defines, source and all transitive #include contents (depth up to 16).
Persistent VkPipelineCacheReplaces VK_NULL_HANDLE in VulkanRenderPipeline.compile with a driver-backed cache keyed by vendor + GPU + driver.
Buffer pre-sizingRaises initial capacity of Chunk Sections Command Buffer (4096), Chunk Sections (2048), Dynamic Transforms (64) and Terrain UBO (8) buffers.

Cache safety

SafeguardBehavior
Atomic writesUnique per-process temp file, then ATOMIC_MOVE; safe with several game instances.
Corruption checkSPIR-V magic 0x07230203, length of at least 20 bytes and 4-byte alignment are validated. Bad files are deleted and recompiled.
Driver rejectionA VkPipelineCache the driver rejects resets to an empty cache.
Size limits.spv capped at 256 MiB (LRU eviction to 80% on startup); .vkcache files over 128 MiB are not used. Stale .tmp files older than 5 minutes are removed.

Performance

Single machine: Ryzen 5 4500, RTX 3050 6 GB (driver 621.47), Windows 11, Minecraft 26.3. Not yet tested on AMD or Intel GPUs, or on Linux.

Metric (n=5 alternating)WithoutWith PearlCache
ShaderC compile/read2,270 ± 394 ms399 ± 68 ms
Buffer resizes18.6 ± 0.90
Average FPS168.5 ± 20.3177.9 ± 15.3 (n.s.)
1% low FPS52.4 ± 6.152.2 ± 5.8 (n.s.)

In a heavy 150-mod stack (n=5, warm) there were 0 SPIR-V misses and 0 buffer resizes, with no detectable FPS change (48.2 ± 5.7 vs 48.5 ± 2.6). PearlCache does not raise FPS once shaders and buffers are already warm.

Configuration

There is no config file. Caches live in <game dir>/pearlcache/spv and <game dir>/pearlcache/vk; delete them to reset. To disable the mod, add the JVM argument -Dpearlcache.disabled=true.

Showcase

Steady-State FPS & Frame Pacing Check (n=5 vs n=5 Solo)

Steady-State FPS & Frame Pacing Check (n=5 vs n=5 Solo)

No detectable steady-state FPS cost in standalone Vulkan or 150-mod stack (all p>=0.38 ns); real benefit is ~1.9 s warm startup savings and 0 GPU buffer resizes.

Compatibility

MinecraftLoaderJavaSide
26.3Fabric (Loader ≥ 0.20.0)25+Client only
26.4 (snapshots, pre-releases, rc and release)Fabric (Loader ≥ 0.20.0)25+Client only

Forge and NeoForge are not supported. It targets the Vulkan renderer with RenderPearl's dynamic buffers.

Building from Source

Requires JDK 25.

./gradlew build --no-daemon

License

Released under the MIT License.

PearlCache Team

profile avatar
  • 1
    Followers
  • 8
    Projects
  • 444
    Downloads

More from AltRossellView all