[PR #3958] [MERGED] shader_recompiler: VS clip distance emulation for NVIDIA GPUs #3825

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3958
Author: @psucien
Created: 1/25/2026
Status: Merged
Merged: 1/26/2026
Merged by: @georgemoralis

Base: mainHead: fix/clip_distance_emulation


📝 Commits (1)

  • 10ed5a0 shader_recompiler: VS clip distance emulation for NVIDIA GPUs

📊 Changes

10 files changed (+116 additions, -24 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
📝 externals/CMakeLists.txt (+1 -0)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+41 -10)
📝 src/shader_recompiler/ir/attribute.cpp (+1 -1)
src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp (+41 -0)
📝 src/shader_recompiler/ir/passes/ir_passes.h (+2 -1)
📝 src/shader_recompiler/profile.h (+1 -1)
📝 src/shader_recompiler/recompiler.cpp (+10 -7)
📝 src/shader_recompiler/runtime_info.h (+5 -2)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+13 -2)

📄 Description

It looks like NVIDIA GPUs have precision issues with clip distances interpolation. At least the result slightly differs from what we see on AMD (and there is evidence even on Intel) GPUs, which usually results in artifacts like black stripes on tilted polygons. This PR adds emulation of VS outputted clip distances via discards on FS stage for NVIDIA cards.


🔄 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/3958 **Author:** [@psucien](https://github.com/psucien) **Created:** 1/25/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `fix/clip_distance_emulation` --- ### 📝 Commits (1) - [`10ed5a0`](https://github.com/shadps4-emu/shadPS4/commit/10ed5a0a86623a7792146594f222094b09b80636) shader_recompiler: VS clip distance emulation for NVIDIA GPUs ### 📊 Changes **10 files changed** (+116 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) 📝 `externals/CMakeLists.txt` (+1 -0) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+41 -10) 📝 `src/shader_recompiler/ir/attribute.cpp` (+1 -1) ➕ `src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp` (+41 -0) 📝 `src/shader_recompiler/ir/passes/ir_passes.h` (+2 -1) 📝 `src/shader_recompiler/profile.h` (+1 -1) 📝 `src/shader_recompiler/recompiler.cpp` (+10 -7) 📝 `src/shader_recompiler/runtime_info.h` (+5 -2) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+13 -2) </details> ### 📄 Description It looks like NVIDIA GPUs have precision issues with clip distances interpolation. At least the result slightly differs from what we see on AMD (and there is evidence even on Intel) GPUs, which usually results in artifacts like black stripes on tilted polygons. This PR adds emulation of VS outputted clip distances via discards on FS stage for NVIDIA cards. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:05:07 +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#3825
No description provided.