Fix self-relative shader register pointers in ShaderInfo #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-SvenGDK/SharpProspero!5
Loading…
Reference in a new issue
No description provided.
Delete branch "Gudui/codex/shaderinfo-relative-pointers"
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?
Summary
Fix the host-only
ShaderInfoinspector's register-array pointer bases. Context and shader pointervalues at header offsets 24 and 32 are self-relative: each is based on its own field, not the beginning
of the header. The old reader starts the arrays 24/32 bytes early while still reporting plausible
register counts.
The fix also bounds the relative value before addition/conversion, preventing oversized offsets from
wrapping back into the header. Null pointers and zero counts remain empty; truncated arrays retain
only complete records, as before.
Reproduction
On the existing upstream
mesh_ps.sb, the old CLI reports 9 context and 6 shader records but startsthe context list at
0x0006 = 0x7EAF2669rather than0x01C4 = 0. It also begins the shader list withthree zero-offset records. Resolving the two pointers from their own fields produces the intended
arrays. This matches the pointer relocation performed by the shader-creation routine inspected during
the investigation; no shader code or runtime behavior is changed.
Tests
Added independent synthetic ELF/header fixtures; no shader binaries, module dumps, proprietary
fixtures, graphics initialization or console are required. They assert exact offset/value lists at
different placements, both pointer bases, null/zero counts, final complete records, truncation and
oversized offsets.
e24e25e) with these tests: 12 failed, 7 passed.dotnet build SharpProspero.slnx -c Release: 0 warnings, 0 errors.Scope and review note
One host parser change, synthetic tests, test README, and minimal project/solution wiring. There are
no runtime SDK, renderer, shader-resource or GPU-state changes. No hardware validation is claimed or
needed for this host parsing regression.
The base revision has no tracked test project although CONTRIBUTING references
tests/SharpProspero.Tests. This draft adds a small xUnit project at that path referencing onlySharpProspero.Prx, rather than bringing in our larger fork suite. Please advise if another testlocation/framework is preferred.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.