[PR #3457] [MERGED] shader_recompiler: Do not emit Layer when emulating primitive type with tessellation. #3484

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3457
Author: @squidbus
Created: 8/25/2025
Status: Merged
Merged: 8/25/2025
Merged by: @squidbus

Base: mainHead: tess-layer


📝 Commits (1)

  • 96a5455 shader_recompiler: Do not emit Layer when emulating primitive type with tessellation.

📊 Changes

3 files changed (+20 additions, -2 deletions)

View changed files

📝 src/shader_recompiler/ir/position.h (+15 -2)
📝 src/shader_recompiler/runtime_info.h (+2 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+3 -0)

📄 Description

Layer must be output from the final pre-rasterization stage, so when tessellation is being used the vertex shader cannot set it. We could pass it through to the tessellation shaders in some way, but unless it becomes an issue that's more effort than it's worth.

Fixes rendering in Hatsune Miku: Project DIVA X on MoltenVK. MoltenVK has a particular bug currently where rather than just being ignored, setting the Layer in the wrong stage of a tessellation pipeline causes vertex data issues. The draws in question seem to just always end up with layer 0 anyway.


🔄 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/3457 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 8/25/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `tess-layer` --- ### 📝 Commits (1) - [`96a5455`](https://github.com/shadps4-emu/shadPS4/commit/96a5455d309087dffebd84206e87298e2718130c) shader_recompiler: Do not emit Layer when emulating primitive type with tessellation. ### 📊 Changes **3 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/ir/position.h` (+15 -2) 📝 `src/shader_recompiler/runtime_info.h` (+2 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+3 -0) </details> ### 📄 Description Layer must be output from the final pre-rasterization stage, so when tessellation is being used the vertex shader cannot set it. We could pass it through to the tessellation shaders in some way, but unless it becomes an issue that's more effort than it's worth. Fixes rendering in Hatsune Miku: Project DIVA X on MoltenVK. MoltenVK has a particular bug currently where rather than just being ignored, setting the Layer in the wrong stage of a tessellation pipeline causes vertex data issues. The draws in question seem to just always end up with layer 0 anyway. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:52 +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#3484
No description provided.