shader: align centroid and vertex-pixel interpolation #643
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!643
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/643/head"
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?
@carbonimax on GitHub · 2026-09-16 16:30 UTC · original
carbonimax:fix/single-sample-centroid→main· +491 −396 · 7 files · 2 commits · closed without mergingSummary
Validation
shader_cfg_testsbuilds for x86_64 on macOS.ctest -R shader_cfgpasses: 1/1.No isolated GPU run, execution of the game, or visual validation is claimed for the new shared VS/PS location plan.
@coderabbitai[bot] on GitHub · 2026-09-16 16:30 UTC · original · edited 2026-10-13 22:44 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
be341be1-18cb-4a2a-8529-886c9cd387bd📥 Commits
Reviewing files that changed from the base of the PR and between ec393cbbb77d0b1a12106ff3aaf06be34113fa10 and 2908af3a718588b887ef0967f501ff15f773dbab.
📒 Files selected for processing (3)
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/renderDraw.cpptests/shaderCfgTests.cpp🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough
Changes
The draw path derives single-sample state and passes it through
PipelineCache. Coupled vertex and pixel pipelines now share validated parameter-plan metadata. Shader cache keys include the new metadata. SPIR-V emission supports parameter aliases and direct centroid loads for single-sample pixels. Tests cover cache specialization, parameter planning, alias outputs, decorations, and valid SPIR-V.Changes
RefreshShadersderivessingle_sample.GetGraphicsProgramsforwards it and compiles coupled vertex and pixel programs with shared parameter-plan metadata.ps_single_sample.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 6.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 73 functions across 12 files. (1 skipped: 1 too large.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-19 22:14 UTC · original · edited 2026-10-01 17:00 UTC
On
src/graphics/host_gpu/renderer/renderDraw.cppline 914 (outdated):🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 13842
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 36520
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 17842
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21344
Use the resolved attachment sample count for
single_sample.Both draw paths value-initialize
DrawRenderState, soRefreshShaderssees no color or depth attachments. It therefore usesctx.GetAaConfig().msaa_num_samplesfor attached draws and passes that value intopixel_info.ps_single_sample. This can select the wrong center/centroid interpolation path.Make the attachment sample counts available before passing
single_sampletoGetGraphicsPrograms. Keep the AA value only as the fallback when no active attachment exists. Preserve the current shader-output-derivedmrt_maskdependency when restructuring this order.✅ Confirmed as addressed by @carbonimax
@coderabbitai[bot] on GitHub · 2026-09-19 22:14 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
d4704a5e-6a7b-43af-8bd6-e63af20d27b1📥 Commits
Reviewing files that changed from the base of the PR and between da091907718cee1156aec46b59b7cd5de71e4ba6 and 49b987403b150e5493262bbb61524570955d30d8.
📒 Files selected for processing (12)
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAnalysis.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cppsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cppsrc/graphics/shader/shader.cppsrc/graphics/shader/shader.hsrc/graphics/shader/shaderPixelParameter.cpptests/shaderCfgTests.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
@carbonimax on GitHub · 2026-10-01 16:59 UTC · original
On
src/graphics/host_gpu/renderer/renderDraw.cppline 914 (outdated):Addressed in the updated branch. Shader compilation initially identifies the active MRT outputs; after resolving the effective color/depth targets, PrepareDrawRenderState recomputes the sample count and refreshes the shaders if ps_single_sample differs. The second refresh now passes the current main color_output_mask as well. DrawUsesSingleSample uses the actual active attachment descriptions; the AA register is only the fallback when there is no attachment. The centroid tests and the complete shader_cfg_tests suite pass after the main merge.
@coderabbitai[bot] on GitHub · 2026-10-01 17:00 UTC · original
On
src/graphics/host_gpu/renderer/renderDraw.cppline 914 (outdated):@carbonimax, the supplied code addresses this finding.PrepareDrawRenderStatepreserves shader-output-derived MRT discovery, then refreshes shaders if the resolved attachment sample count changesps_single_sample. The second refresh passescolor_output_mask, andDrawUsesSingleSampleuses the AA register only when no attachment exists.Thanks for confirming the test results.
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@carbonimax on GitHub · 2026-10-01 17:39 UTC · original
CI update: Windows and Linux builds pass. The macOS job builds successfully, then fails in the unchanged
memory_trackertest (fixed VirtualAlloc failed), with 12/13 tests passing. Local x86_64 Release build and shader_cfg_tests pass for this head. The macOS job on main44798085also fails inpage_manageron fixed low mach_vm_allocate. These PRs do not modify the reservation tests or their implementation.I tried rerunning the failed job, but GitHub requires repository admin rights. Could a maintainer rerun the failed macOS job? No reservation-code workaround is included in this PR.
@carbonimax on GitHub · 2026-10-01 19:58 UTC · original
The macOS CI reservation failure is now addressed by a test-only fix. The tests no longer assume that the low address 0x200010000 is free: Mach chooses available memory while preserving the offset within the 4 MiB tracker region and checking that the allocation remains in the valid low guest range. The extended-range test keeps its fixed address.
A regression case deliberately occupies the preferred address, verifies relocation without overwriting that mapping, and retains the existing protection and region-boundary assertions. Both memory_tracker and page_manager fail with the fixed-address allocator and pass with the corrected allocator (2/2), on the same tests. The tested memory sources and helper are identical across #633, #643 and #741. No emulator runtime or submission protocol change is included.
The updated head triggers a fresh CI run; local success is not being reported as a GitHub CI result.
Pull request closed