shader: derive barycentric x on NVIDIA to avoid a pipeline-compile crash #2415
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!2415
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2415"
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?
@user9517 on GitHub · 2026-11-19 19:06 UTC · original
user9517:fix/ppsa24156-nvidia-barycentric-crash→main· +28 −5 · 4 files · 1 commits · openFixes a crash in My First Gran Turismo (PPSA24156) on NVIDIA GPUs: the first race crashes inside the driver's shader compiler while building a pipeline.
Problem: in the first race,
vkCreateGraphicsPipelinescrashes with0x80000003(an internal breakpoint) inside NVIDIA's shader compiler (nvgpucomp64.dll). The pipeline is depth-only, 2x MSAA, with sample shading. Its fragment shader interpolates aPerVertexKHRinput by hand and readsBaryCoordKHR.x. The SPIR-V passesspirv-val.Evidence: I captured the pipeline and replayed it outside the game. It builds when any one of these changes: 1 sample instead of 2, sample shading off, or only the
BaryCoordKHR.xread replaced with1 - y - z.Change: a new
Spirv::Profile::derive_barycentric_x, set when the vendor ID is NVIDIA (0x10DE). With it set,EmitPixelAttributecomputes x as1 - y - zinstead of loading it. Other vendors emit the same SPIR-V as before.Testing
--amd-cpu).0x80000003innvgpucomp64.dllon every attempt, in the first race. After: the pipeline builds and the race continues.mainand smoke-tested with all three fixes together: a 5-minute unattended run reached in-race rendering with no crash or GPU fault.ctest --preset win-release).AI use
I made this change with Claude Code (Claude Opus 5.5). It wrote the investigation tooling (pipeline capture and replay, a crash-dump handler, per-second counters) and drafted the code change and this description.
What I did: I reviewed the diff, and I ran the game sessions listed under Testing.
🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-11-19 19:10 UTC · original
No actionable comments were generated in the recent review.
Walkthrough
The SPIR-V profile adds a
derive_barycentric_xflag. The pipeline enables it for NVIDIA devices. When enabled,EmitPixelAttributederives the first barycentric weight from the other two; otherwise, it loads all three weights. The profile serialization includes the new field.Suggested reviewers:
nmzik,senaxxChange: Bug fix
Merge Risk:
Minimal · up to
c1058This change works around a pipeline-compile crash on NVIDIA GPUs by deriving one barycentric weight instead of reading it. Other vendors keep the existing shader output. No merge-blocking risk was found; AMD, Intel and Linux were not tested.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: on NVIDIA, the shader recompiler now derives barycentric x to avoid a pipeline-compile crash. The raw summary and objectives confirm a new Profile::derive_barycentric_x flag set for vendor 0x10DE, with EmitPixelAttribute computing x as 1 - y - z. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description states the crash in My First Gran Turismo on NVIDIA GPUs, the reproduction evidence, the new Spirv::Profile::derive_barycentric_x flag, the NVIDIA vendor ID gate, and the testing performed. It directly describes the changeset.
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
c0921c97-04d2-48b3-a0ff-bbf446507b17Reviewing files that changed from the base of the PR and between
5ad27cdd1aandc10589dc1f.src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cppsrc/graphics/shader/recompiler/ir/Serialize.hIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.