[PR #480] [MERGED] vk_pipeline_cache: Avoid recompiling new shaders on each new PL #1590

Closed
opened 2026-02-27 21:13:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/480
Author: @raphaelthegreat
Created: 8/19/2024
Status: Merged
Merged: 8/20/2024
Merged by: @raphaelthegreat

Base: mainHead: less-shaders


📝 Commits (3)

  • 68c4658 cfg: Add one more divergence case
  • 3789dbe renderer_vulkan: Reduce number of compiled shaders
  • 0dc05cf vk_pipeline_cache: Remove some unnecessary checks

📊 Changes

10 files changed (+125 additions, -86 deletions)

View changed files

📝 src/core/libraries/kernel/time_management.cpp (+7 -0)
📝 src/shader_recompiler/frontend/control_flow_graph.cpp (+3 -2)
📝 src/video_core/renderer_vulkan/vk_compute_pipeline.cpp (+14 -13)
📝 src/video_core/renderer_vulkan/vk_compute_pipeline.h (+11 -3)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (+33 -28)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.h (+4 -5)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+47 -30)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.h (+3 -2)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+1 -1)
📝 src/video_core/texture_cache/tile_manager.cpp (+2 -2)

📄 Description

It was noticed that in BB the game would keep compiling shaders in the background without stopping which increased CPU usage. These shaders also consumed a lot of extra memory. This PR attempts to avoid this by only compiling new shaders when a new program hash is encountered (also the shader position in the pipeline is taken into account. This can be fixed by reworking descriptor sets a bit, can be later PR).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/480 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 8/19/2024 **Status:** ✅ Merged **Merged:** 8/20/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `less-shaders` --- ### 📝 Commits (3) - [`68c4658`](https://github.com/shadps4-emu/shadPS4/commit/68c465813c603d415a4e422bfcd5a478d70a61df) cfg: Add one more divergence case - [`3789dbe`](https://github.com/shadps4-emu/shadPS4/commit/3789dbe8e5c2b23de6926c5e23dcff8e15de29aa) renderer_vulkan: Reduce number of compiled shaders - [`0dc05cf`](https://github.com/shadps4-emu/shadPS4/commit/0dc05cfff2562fe3f4fb1002e69eac08b0552da1) vk_pipeline_cache: Remove some unnecessary checks ### 📊 Changes **10 files changed** (+125 additions, -86 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/time_management.cpp` (+7 -0) 📝 `src/shader_recompiler/frontend/control_flow_graph.cpp` (+3 -2) 📝 `src/video_core/renderer_vulkan/vk_compute_pipeline.cpp` (+14 -13) 📝 `src/video_core/renderer_vulkan/vk_compute_pipeline.h` (+11 -3) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp` (+33 -28) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.h` (+4 -5) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+47 -30) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.h` (+3 -2) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+1 -1) 📝 `src/video_core/texture_cache/tile_manager.cpp` (+2 -2) </details> ### 📄 Description It was noticed that in BB the game would keep compiling shaders in the background without stopping which increased CPU usage. These shaders also consumed a lot of extra memory. This PR attempts to avoid this by only compiling new shaders when a new program hash is encountered (also the shader position in the pipeline is taken into account. This can be fixed by reworking descriptor sets a bit, can be later PR). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:13:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1590
No description provided.