[PR #2310] [MERGED] shader_recompiler: Add workaround for drivers with unexpected unorm rounding behavior. #2640

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2310
Author: @squidbus
Created: 2/1/2025
Status: Merged
Merged: 2/4/2025
Merged by: @squidbus

Base: mainHead: unorm-fix


📝 Commits (1)

  • cbdf877 shader_recompiler: Add workaround for drivers with unexpected unorm rounding behavior.

📊 Changes

3 files changed (+17 additions, -1 deletions)

View changed files

📝 src/shader_recompiler/frontend/translate/export.cpp (+5 -1)
📝 src/shader_recompiler/runtime_info.h (+1 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+11 -0)

📄 Description

This is a bit of an ugly hack but it fixes some incorrect unorm rounding behavior seen in CUSA05637 on macOS. This workaround was discovered by reverse-engineering what Apple's D3DMetal does to solve the same issue for Direct3D games. So presumably this has to be done in order to get the correct results, at least for now. I'm still investigating why this is needed and whether it can/should be done at the driver level instead.


🔄 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/2310 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 2/1/2025 **Status:** ✅ Merged **Merged:** 2/4/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `unorm-fix` --- ### 📝 Commits (1) - [`cbdf877`](https://github.com/shadps4-emu/shadPS4/commit/cbdf877fb7bec2c6d1f0f471ce2bc8683ec2a6ca) shader_recompiler: Add workaround for drivers with unexpected unorm rounding behavior. ### 📊 Changes **3 files changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/frontend/translate/export.cpp` (+5 -1) 📝 `src/shader_recompiler/runtime_info.h` (+1 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+11 -0) </details> ### 📄 Description This is a bit of an ugly hack but it fixes some incorrect unorm rounding behavior seen in CUSA05637 on macOS. This workaround was discovered by reverse-engineering what Apple's D3DMetal does to solve the same issue for Direct3D games. So presumably this has to be done in order to get the correct results, at least for now. I'm still investigating why this is needed and whether it can/should be done at the driver level instead. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:41 +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#2640
No description provided.