shader_recompiler: Reach in-game status in Control with fragment input fixes - #4863
Open
w1naenator wants to merge 51 commits into
Open
shader_recompiler: Reach in-game status in Control with fragment input fixes#4863w1naenator wants to merge 51 commits into
w1naenator wants to merge 51 commits into
Conversation
- implement no-perspective centroid barycentrics - honor center, centroid, and sample evaluation on the KHR path - handle provoking-vertex and topology-dependent vertex ordering - preserve native GCN P0/P10/P20 and pull-model semantics - reject inexact interpolation fallbacks instead of applying zero-slope hacks - add numerical coverage for interpolation modes and vertex mappings
- sync with main - implement specification-driven AMD and KHR barycentric interpolation - handle topology, provoking vertex, centroid, sample, and pull-model inputs - keep clip-plane and null-image descriptors valid - expand GCN interpolation tests
Read FRONT_FACE_ALL_BITS from SPI_BARYC_CNTL and carry it through fragment runtime specialization. Represent Vulkan FrontFacing as a boolean IR attribute, then encode the guest VGPR value as either +1.0/-1.0 or integer 1/0 according to the register mode. Update shader cache versions and add regression tests for both encodings. Based on review suggestions from Roamic, Raphael, and IndecisiveTurtle.
Contributor
Author
added 2 commits
August 17, 2026 07:05
Contributor
|
The barycentric changes need their separate PR. Also when making multi-patch PRs like this avoid having any "merge main" commits it makes it harder to review |
Contributor
Author
I'll do it when this PR became acceptable. |
Contributor
Author
|
Ok, needed regression tests again. |
Contributor
Contributor
Author
Contributor
Contributor
Author
Contributor
Contributor
Author
- restore direct P10/P20/P0 selection for V_INTERP_MOV_F32 - remove the incorrect P0-relative reconstruction that corrupted texture coordinates - update LDS synchronization for loops with divergent Break or Repeat conditions - defer unsafe loop-local barriers until workgroup invocations reconverge - add interpolation and shared-memory barrier regression coverage - update the stale KHR barycentric test to match current decoration behavior
Contributor
Author
|
@bigol83 Can you, please test again? |
Contributor
Author
Contributor
Author
With this #4561 menu and loading screen is reachable. But intro skipped. |
|
No notable changes or regressions in my titles. |
…e-fix # Conflicts: # src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp # src/shader_recompiler/backend/spirv/spirv_emit_context.cpp # src/video_core/renderer_vulkan/vk_rasterizer.cpp
…tor/shadPS4 into reach-control-ingame-fix # Conflicts: # src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp # src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
- implement no-perspective centroid barycentrics - honor center, centroid, and sample evaluation on the KHR path - handle provoking-vertex and topology-dependent vertex ordering - preserve native GCN P0/P10/P20 and pull-model semantics - reject inexact interpolation fallbacks instead of applying zero-slope hacks - add numerical coverage for interpolation modes and vertex mappings
- sync with main - implement specification-driven AMD and KHR barycentric interpolation - handle topology, provoking vertex, centroid, sample, and pull-model inputs - keep clip-plane and null-image descriptors valid - expand GCN interpolation tests
Read FRONT_FACE_ALL_BITS from SPI_BARYC_CNTL and carry it through fragment runtime specialization. Represent Vulkan FrontFacing as a boolean IR attribute, then encode the guest VGPR value as either +1.0/-1.0 or integer 1/0 according to the register mode. Update shader cache versions and add regression tests for both encodings. Based on review suggestions from Roamic, Raphael, and IndecisiveTurtle.
- restore direct P10/P20/P0 selection for V_INTERP_MOV_F32 - remove the incorrect P0-relative reconstruction that corrupted texture coordinates - update LDS synchronization for loops with divergent Break or Repeat conditions - defer unsafe loop-local barriers until workgroup invocations reconverge - add interpolation and shared-memory barrier regression coverage - update the stale KHR barycentric test to match current decoration behavior
Restored correct KHR fragment barycentric ordering based on primitive topology and provoking-vertex state, while leaving the AMD/VINTRP path unchanged. Added mappings for triangle lists, fans, strips, and adjacency, including primitive-parity selection when required by Vulkan strip ordering. Updated Vulkan capability detection and fragment runtime metadata to propagate topology and provoking-vertex information into SPIR-V generation. Added regression tests for provoking-vertex rotation, unsupported host modes, and odd-strip PrimitiveId selection. Updated shader serialization versions for the new metadata and generated SPIR-V behavior. Based on IndecisiveTurtle's review suggestion and Vulkan/RADV barycentric semantics.
…tor/shadPS4 into reach-control-ingame-fix
…tor/shadPS4 into reach-control-ingame-fix
…32 and update front face handling in Translator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.









Summary
Complete the fragment interpolation path for Liverpool shaders and correctly
translate fragment inputs across AMD and KHR Vulkan implementations.
This fixes incorrect lighting and dark rendering observed in Control while
preserving the alternate front-face encoding required by other games.
Changelog
Fragment interpolation
V_INTERP_P1_F32,V_INTERP_P2_F32, andV_INTERP_MOV_F32behavior.P0,P10, andP20coefficient semantics.zero-slope interpolation.
BaryCoordPullModel:BaryCoordPullModelAMDwhenVK_AMD_shader_explicit_vertex_parameteris available.(I/W, J/W, 1/W)using KHR barycentrics andFragCoord.wotherwise.interpolation-function approximations.
Primitive and provoking-vertex handling
runtime specialization.
VK_EXT_provoking_vertexfeature support instead of relying only onextension presence.
triStripVertexOrderIndependentOfProvokingVertexfrom the KHR barycentricproperties.
PrimitiveIdinput only when topology remapping requires primitiveparity.
Front-face encoding
FRONT_FACE_ALL_BITSfromSPI_BARYC_CNTL.FrontFacingas a boolean IR attribute.FRONT_FACEVGPR according to Liverpool state:+1.0f/-1.0fbits whenFRONT_FACE_ALL_BITSis disabled.1/0whenFRONT_FACE_ALL_BITSis enabled.using the alternate mode.
This part is based on review suggestions from Roamic, Raphael, and
IndecisiveTurtle.
Sample coverage
SampleCoveragewhen enabled by the pixel-shader input registers.SampleMask.Shader resource-table synchronization
specialization.
buffer-cache downloads.
instead of serializing the raw structure.
Renderer and descriptor robustness
small bounds buffer.
dispatch with an image copy.
storage-buffer writes.
samplers.
shader branches.
Vulkan and SPIR-V
VK_AMD_shader_explicit_vertex_parameterwhen available.VK_KHR_fragment_shader_barycentricas the portable fallback,including Vulkan 1.4 core availability.
only when required by the generated shader.
GetAttributeU1IR path for boolean Vulkan built-ins.Shader cache
encoding in fragment runtime specialization.
incompatible cached shaders.