[PR #236] [MERGED] Recompiler: sampler patching #1415

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/236
Author: @psucien
Created: 7/4/2024
Status: Merged
Merged: 7/4/2024
Merged by: @raphaelthegreat

Base: mainHead: recompiler/sampler_patching


📝 Commits (3)

  • 1de2ea9 recompiler: restored bfs in image instruction producers search
  • 9633fea recompiler: added pattern check for s# anisotropy modification
  • 248d94e added check if s# comes from constant load (e.g. EUD)

📊 Changes

3 files changed (+79 additions, -13 deletions)

View changed files

📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+67 -9)
📝 src/shader_recompiler/runtime_info.h (+2 -0)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (+10 -4)

📄 Description

In some shaders, a pattern has been observed where the anisotropy setting in S# is reset if a sampled texture lacks mips in its view. To address this issue, this PR introduces a heuristic based on pattern detection. Specifically, if expected sharp fields are accessed, the emitted sampler descriptor will have the disable_aniso flag set. This allows the runtime to check it later and modify parameters of the bound sampler as needed.

Also, restored BFS in search of image instruction producer.


🔄 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/236 **Author:** [@psucien](https://github.com/psucien) **Created:** 7/4/2024 **Status:** ✅ Merged **Merged:** 7/4/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `recompiler/sampler_patching` --- ### 📝 Commits (3) - [`1de2ea9`](https://github.com/shadps4-emu/shadPS4/commit/1de2ea960c19de476a314bc0b764c5fb8c5f250a) recompiler: restored bfs in image instruction producers search - [`9633fea`](https://github.com/shadps4-emu/shadPS4/commit/9633fea55ad416a5a7dead8fd075f7f24a51f01f) recompiler: added pattern check for s# anisotropy modification - [`248d94e`](https://github.com/shadps4-emu/shadPS4/commit/248d94eff452623dde04c8e04c10771d09744d36) added check if s# comes from constant load (e.g. EUD) ### 📊 Changes **3 files changed** (+79 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+67 -9) 📝 `src/shader_recompiler/runtime_info.h` (+2 -0) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp` (+10 -4) </details> ### 📄 Description In some shaders, a pattern has been observed where the anisotropy setting in S# is reset if a sampled texture lacks mips in its view. To address this issue, this PR introduces a heuristic based on pattern detection. Specifically, if expected sharp fields are accessed, the emitted sampler descriptor will have the `disable_aniso` flag set. This allows the runtime to check it later and modify parameters of the bound sampler as needed. Also, restored BFS in search of image instruction producer. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:12:27 +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#1415
No description provided.