[PR #1675] [MERGED] specialization: Fix fetch shader field type #2240

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1675
Author: @squidbus
Created: 12/6/2024
Status: Merged
Merged: 12/6/2024
Merged by: @georgemoralis

Base: mainHead: fix-fetch-shader


📝 Commits (1)

  • 8f3d252 specialization: Fix fetch shader field type

📊 Changes

4 files changed (+28 additions, -24 deletions)

View changed files

📝 src/shader_recompiler/frontend/fetch_shader.h (+0 -13)
📝 src/shader_recompiler/specialization.h (+9 -10)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+2 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+17 -1)

📄 Description

fetch_shader_data was not wrapped in optional and thus GetProgram would always return it as the fetch shader, regardless of whether the shader actually had a fetch shader. Normally this was harmless since vertex shaders are bound last, but in the case of geometry shaders this is not true. Changed to optional type to fix this.

With this fix I also had to fix up GetDrawOffsets to work when there is no fetch shader for a pipeline; it worked previously as there would unintentionally be a default-initialized fetch shader object.


🔄 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/1675 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 12/6/2024 **Status:** ✅ Merged **Merged:** 12/6/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `fix-fetch-shader` --- ### 📝 Commits (1) - [`8f3d252`](https://github.com/shadps4-emu/shadPS4/commit/8f3d2526938df9686ce6edfc5e83cfbe5341ba35) specialization: Fix fetch shader field type ### 📊 Changes **4 files changed** (+28 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/frontend/fetch_shader.h` (+0 -13) 📝 `src/shader_recompiler/specialization.h` (+9 -10) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+2 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+17 -1) </details> ### 📄 Description `fetch_shader_data` was not wrapped in `optional` and thus `GetProgram` would always return it as the fetch shader, regardless of whether the shader actually had a fetch shader. Normally this was harmless since vertex shaders are bound last, but in the case of geometry shaders this is not true. Changed to optional type to fix this. With this fix I also had to fix up `GetDrawOffsets` to work when there is no fetch shader for a pipeline; it worked previously as there would unintentionally be a default-initialized fetch shader object. --- <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:43 +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#2240
No description provided.