[PR #3449] [MERGED] vk_pipeline_cache: Cleanup graphics key refresh #3476

Closed
opened 2026-02-27 22:03:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3449
Author: @raphaelthegreat
Created: 8/23/2025
Status: Merged
Merged: 8/24/2025
Merged by: @squidbus

Base: mainHead: mrt-cleanup


📝 Commits (2)

  • d6995ad vk_pipeline_cache: Cleanup graphics key refresh
  • f38a18e position: Don't assert on None mapping

📊 Changes

16 files changed (+120 additions, -170 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
📝 src/shader_recompiler/frontend/translate/export.cpp (+12 -5)
📝 src/shader_recompiler/ir/position.h (+6 -1)
📝 src/shader_recompiler/profile.h (+1 -0)
📝 src/shader_recompiler/runtime_info.h (+5 -5)
📝 src/video_core/amdgpu/liverpool.h (+6 -1)
📝 src/video_core/amdgpu/pixel_format.h (+7 -1)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (+1 -8)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.h (+2 -6)
📝 src/video_core/renderer_vulkan/vk_instance.cpp (+0 -14)
📝 src/video_core/renderer_vulkan/vk_instance.h (+0 -8)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+65 -94)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.h (+1 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+12 -10)
📝 src/video_core/renderer_vulkan/vk_scheduler.cpp (+0 -8)
📝 src/video_core/renderer_vulkan/vk_scheduler.h (+1 -9)

📄 Description

  • Remove color write mask dynamic state. This needs a whole extension and checks just for it, and it doesn't even benefit compilation times because the pipeline key still hashes write masks, so triggers recompilations. It would be better to readd this when the entire color blending state can properly be made dynamic, since write masks are not a "hot" pipeline state that triggers often recompilations

  • Moved MoltenVK unorm fixup into shader recompiler. The color buffer struct has contained both data and number formats for a while, so little reason to have pipeline cache do the check for it, instead of the intended user

  • Split out shader stage binding from graphics pipeline key refresh, to make the whole function easier to parse

  • Remove the concept of color buffer compaction. This never made much sense to me, maybe this change is wrong and this will break stuff but I believe hardware has 8 fixed MRT slots, shaders can export to those slots so the mapping between those is 1-1. I feel any compacting will break this if there are gaps between render targets.

The binding code has been rewritten, so first pass iterates all the slots and binds whatever is valid, then mrt_mask is used to fetch the number of render targets bound, which feels more correct then just counting the number of valid targets, as it will include gaps properly, and masks out render targets that don't appear in the mask (the gaps essentially)


🔄 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/3449 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 8/23/2025 **Status:** ✅ Merged **Merged:** 8/24/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `mrt-cleanup` --- ### 📝 Commits (2) - [`d6995ad`](https://github.com/shadps4-emu/shadPS4/commit/d6995ad87beedd47d2686b44f786974a7cb1dc7e) vk_pipeline_cache: Cleanup graphics key refresh - [`f38a18e`](https://github.com/shadps4-emu/shadPS4/commit/f38a18e4e305a884b2c7b8b1a081c1c8d65562d6) position: Don't assert on None mapping ### 📊 Changes **16 files changed** (+120 additions, -170 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) 📝 `src/shader_recompiler/frontend/translate/export.cpp` (+12 -5) 📝 `src/shader_recompiler/ir/position.h` (+6 -1) 📝 `src/shader_recompiler/profile.h` (+1 -0) 📝 `src/shader_recompiler/runtime_info.h` (+5 -5) 📝 `src/video_core/amdgpu/liverpool.h` (+6 -1) 📝 `src/video_core/amdgpu/pixel_format.h` (+7 -1) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp` (+1 -8) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.h` (+2 -6) 📝 `src/video_core/renderer_vulkan/vk_instance.cpp` (+0 -14) 📝 `src/video_core/renderer_vulkan/vk_instance.h` (+0 -8) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+65 -94) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.h` (+1 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+12 -10) 📝 `src/video_core/renderer_vulkan/vk_scheduler.cpp` (+0 -8) 📝 `src/video_core/renderer_vulkan/vk_scheduler.h` (+1 -9) </details> ### 📄 Description - Remove color write mask dynamic state. This needs a whole extension and checks just for it, and it doesn't even benefit compilation times because the pipeline key still hashes write masks, so triggers recompilations. It would be better to readd this when the entire color blending state can properly be made dynamic, since write masks are not a "hot" pipeline state that triggers often recompilations - Moved MoltenVK unorm fixup into shader recompiler. The color buffer struct has contained both data and number formats for a while, so little reason to have pipeline cache do the check for it, instead of the intended user - Split out shader stage binding from graphics pipeline key refresh, to make the whole function easier to parse - Remove the concept of color buffer compaction. This never made much sense to me, maybe this change is wrong and this will break stuff but I believe hardware has 8 fixed MRT slots, shaders can export to those slots so the mapping between those is 1-1. I feel any compacting will break this if there are gaps between render targets. The binding code has been rewritten, so first pass iterates all the slots and binds whatever is valid, then mrt_mask is used to fetch the number of render targets bound, which feels more correct then just counting the number of valid targets, as it will include gaps properly, and masks out render targets that don't appear in the mask (the gaps essentially) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:50 +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#3476
No description provided.