Validate SGPR ranges for vertex table and add regression tests #2301
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!2301
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2301"
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?
@msawe354 on GitHub · 2026-11-16 15:22 UTC · original
msawe354:main→main· +22 −7 · 2 files · 2 commits · openThis pull request improves the robustness of vertex input handling in the shader system by adding stricter validation for vertex table pointers and enhancing the related tests. The changes ensure that invalid register assignments are detected and rejected, improving stability and correctness.
Validation improvements in shader code:
ShaderGetStaticVertexInputInfo(inshader.cpp) to ensurevertex_buffer_regandvertex_attrib_regare within valid SGPR (Scalar General Purpose Register) bounds, logging an error and returningfalseif they exceed limits.Test improvements:
CheckRejectedinShaderVertexMetadataTests.cppto accept a configurablemax_user_sgprsparameter, allowing more flexible testing of SGPR limits.max_user_sgprsvalue, ensuring the new validation logic is properly exercised.hardwareContext.hin the test file to support the new test logic.@coderabbitai[bot] on GitHub · 2026-11-16 15:28 UTC · original
Walkthrough
ShaderGetStaticVertexInputInfo now checks dynamic vertex-table SGPR indices before reading pointer data. It logs an error and returns false if the buffer register is missing, the user SGPR count exceeds SGPRS_MAX, or either two-word pointer register exceeds the available count. The tests now pass a configurable SGPR count and check rejection at offset 31.
Estimated code review effort:
Suggested reviewers:
nmzik,mrbigbritchesChange: Bug fix
Merge Risk:
Low · up to
5a34eThe change adds a check that rejects inconsistent vertex-table SGPR metadata before pointers are read. The updated tests exercise only the metadata reader's existing capacity check, so a regression in the new check would not be caught. It is safe to merge, and adding a test that reaches the new guard would be a worthwhile follow-up.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: adding SGPR range validation for the vertex table in ShaderGetStaticVertexInputInfo, plus regression tests. The raw summary confirms the shader.cpp validation and the ShaderVertexMetadataTests.cpp updates. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description states the SGPR bound checks added to ShaderGetStaticVertexInputInfo, the configurable max_user_sgprs parameter for CheckRejected, the boundary-value test changes, and the hardwareContext.h include. These match the raw summary and the changed files, so the description is related to 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
@coderabbitai[bot] on GitHub · 2026-11-16 15:28 UTC · original · reviewed
14dbecc2-d572-4eda-a466-7ba12e83c5e0Reviewing files that changed from the base of the PR and between
41e2147c07and5a34ed7ddf.src/graphics/shader/shader.cpptests/ShaderVertexMetadataTests.cppIncluded 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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.