[PR #1656] [MERGED] renderer_vulkan: Parse fetch shader per-pipeline #2226

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1656
Author: @squidbus
Created: 12/3/2024
Status: Merged
Merged: 12/4/2024
Merged by: @raphaelthegreat

Base: mainHead: fetch-shader


📝 Commits (5)

  • 8ac7ffd shader_recompiler: Read image format info directly from sharps instead of storing in shader info.
  • eda3629 renderer_vulkan: Parse fetch shader per-pipeline
  • 063dc4a Few minor fixes.
  • 028df5d shader_recompiler: Specialize on vertex attribute number types.
  • 995b800 shader_recompiler: Move GetDrawOffsets to fetch shader

📊 Changes

21 files changed (+287 additions, -183 deletions)

View changed files

📝 src/shader_recompiler/backend/spirv/emit_spirv_image.cpp (+2 -1)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+46 -45)
📝 src/shader_recompiler/frontend/fetch_shader.cpp (+9 -3)
📝 src/shader_recompiler/frontend/fetch_shader.h (+55 -1)
📝 src/shader_recompiler/frontend/translate/translate.cpp (+9 -29)
📝 src/shader_recompiler/info.h (+9 -38)
📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+0 -4)
📝 src/shader_recompiler/profile.h (+1 -0)
📝 src/shader_recompiler/specialization.h (+41 -4)
📝 src/video_core/amdgpu/pixel_format.h (+18 -1)
📝 src/video_core/amdgpu/resource.h (+4 -0)
📝 src/video_core/buffer_cache/buffer_cache.cpp (+11 -10)
📝 src/video_core/buffer_cache/buffer_cache.h (+6 -2)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (+18 -14)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.h (+7 -0)
📝 src/video_core/renderer_vulkan/vk_instance.cpp (+7 -0)
📝 src/video_core/renderer_vulkan/vk_instance.h (+7 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+23 -17)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.h (+5 -2)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+7 -7)

...and 1 more files

📄 Description

Fetch shader used by a vertex shader may change, so instead of parsing its data out to Shader::Info where it remains constant for all permutations, save just the fetch shader sharp location, and load it again for each permutation generated.

Along with this, some other pieces of Shader::Info data that save a fixed format were instead changed to load format data from the underlying sharps.

This fixes validation errors in games like CUSA26789 which were also crashes on some drivers like MoltenVK. This may also improve graphics in some games where the missing change in fetch shader had a larger impact.


🔄 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/1656 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 12/3/2024 **Status:** ✅ Merged **Merged:** 12/4/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `fetch-shader` --- ### 📝 Commits (5) - [`8ac7ffd`](https://github.com/shadps4-emu/shadPS4/commit/8ac7ffd859e1d751ca7536fbc542aaa150ada148) shader_recompiler: Read image format info directly from sharps instead of storing in shader info. - [`eda3629`](https://github.com/shadps4-emu/shadPS4/commit/eda3629114a8302b333a711ae81d3f9861304fbb) renderer_vulkan: Parse fetch shader per-pipeline - [`063dc4a`](https://github.com/shadps4-emu/shadPS4/commit/063dc4afe3a563b7e2a2180c9ad9ecaf37f417fa) Few minor fixes. - [`028df5d`](https://github.com/shadps4-emu/shadPS4/commit/028df5dfef3e0b0ab115abfd53852368d9fd0132) shader_recompiler: Specialize on vertex attribute number types. - [`995b800`](https://github.com/shadps4-emu/shadPS4/commit/995b8008641ccf4e3884988673cb9b77f9b30c25) shader_recompiler: Move GetDrawOffsets to fetch shader ### 📊 Changes **21 files changed** (+287 additions, -183 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/backend/spirv/emit_spirv_image.cpp` (+2 -1) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+46 -45) 📝 `src/shader_recompiler/frontend/fetch_shader.cpp` (+9 -3) 📝 `src/shader_recompiler/frontend/fetch_shader.h` (+55 -1) 📝 `src/shader_recompiler/frontend/translate/translate.cpp` (+9 -29) 📝 `src/shader_recompiler/info.h` (+9 -38) 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+0 -4) 📝 `src/shader_recompiler/profile.h` (+1 -0) 📝 `src/shader_recompiler/specialization.h` (+41 -4) 📝 `src/video_core/amdgpu/pixel_format.h` (+18 -1) 📝 `src/video_core/amdgpu/resource.h` (+4 -0) 📝 `src/video_core/buffer_cache/buffer_cache.cpp` (+11 -10) 📝 `src/video_core/buffer_cache/buffer_cache.h` (+6 -2) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp` (+18 -14) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.h` (+7 -0) 📝 `src/video_core/renderer_vulkan/vk_instance.cpp` (+7 -0) 📝 `src/video_core/renderer_vulkan/vk_instance.h` (+7 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+23 -17) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.h` (+5 -2) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+7 -7) _...and 1 more files_ </details> ### 📄 Description Fetch shader used by a vertex shader may change, so instead of parsing its data out to `Shader::Info` where it remains constant for all permutations, save just the fetch shader sharp location, and load it again for each permutation generated. Along with this, some other pieces of `Shader::Info` data that save a fixed format were instead changed to load format data from the underlying sharps. This fixes validation errors in games like CUSA26789 which were also crashes on some drivers like MoltenVK. This may also improve graphics in some games where the missing change in fetch shader had a larger impact. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:39 +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#2226
No description provided.