vk_pipeline_cache: Fix unbounded memory growth during shader compilation #134
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-unbounded-memory"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously, the emulator would only evict old shader pipelines from RAM when the GPU's VRAM was exhausted (VK_ERROR_OUT_OF_DEVICE_MEMORY).
This caused a significant memory leak on systems with ample VRAM but limited system RAM, as the shader cache could grow indefinitely during gameplay, leading to OOM crashes.
This commit introduces a hard limit (MAX_PIPELINES_IN_RAM = 4096) on the number of pipelines kept in host memory. When this limit is reached, EvictOldPipelines() is triggered proactively to free up resources, ensuring stable memory usage.
65280c707ctodca10aff6b