mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #3245] [MERGED] shader_recompiler: Implement guest barycentrics #3335
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3335
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3245
Author: @raphaelthegreat
Created: 7/15/2025
Status: ✅ Merged
Merged: 7/15/2025
Merged by: @georgemoralis
Base:
main← Head:barycentrics📝 Commits (2)
3b0d08cshader_recompiler: Implement guest barycentricsf3e2d98Review comments and some cleanup📊 Changes
17 files changed (+314 additions, -229 deletions)
View changed files
📝
externals/sirit(+1 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv.cpp(+11 -3)📝
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp(+46 -66)📝
src/shader_recompiler/backend/spirv/emit_spirv_special.cpp(+1 -1)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp(+77 -78)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.h(+10 -5)📝
src/shader_recompiler/frontend/translate/translate.cpp(+32 -31)📝
src/shader_recompiler/frontend/translate/translate.h(+2 -3)📝
src/shader_recompiler/frontend/translate/vector_interpolation.cpp(+67 -8)📝
src/shader_recompiler/info.h(+16 -3)📝
src/shader_recompiler/ir/attribute.cpp(+14 -0)📝
src/shader_recompiler/ir/attribute.h(+14 -22)📝
src/shader_recompiler/profile.h(+3 -6)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp(+2 -1)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+6 -1)📝
src/video_core/renderer_vulkan/vk_instance.h(+6 -0)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+6 -0)📄 Description
This is second part of attribute restructuring and aims to do the following:
For the first goal the following changes are included:
Removed frag_outputs in favor of output_params as they are the same thingThe last change is important as it allows for the second goal, moving the manual interpolation NVIDIA path into IR. GCN ISA has special instructions V_INTERP_P1_F32/V_INTERP_P2_F32 for interpolating attributes and those can be used to implement that path.
Manual interpolation also requires the IR to become aware of barycentric coordinate variables. In case of an AMD host GPU, the VK_AMD_shader_explicit_vertex_parameter extension has been added, which maps 1-1 to guest functionality. For NVIDIA and other platforms the fragment barycentric extension can also provide most of the functionality necessary (though needs a small remap of barycentric coord). If barycentrics are not supported at all, frontend will request a flat qualifier instead, which is a fallback to previous behavior.
This fixes the menu screen of The Order 1886 for both AMD and NVIDIA GPUs (though reaching the title screen technically requires https://github.com/shadps4-emu/shadPS4/pull/3020 which only works on AMD properly. Regardless I have verified it on NVIDIA as well)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.