Repository navigation
refactor(w3ddevice): Swap silhouette edge indices with std::swap instead of an Int cast - #3635
CryoTheRenegade wants to merge 2 commits into
Conversation
…f one Int constructVolume and constructVolumeVB swapped a pair of Short silhouette indices by reading and writing both through an Int pointer. Swap the two Short values of each edge directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
WalkthroughBoth game variants replace packed integer access with individual index swaps in the silhouette-edge ordering logic of ChangesVolumetric shadow index swaps
Priority: Estimated code review effort: 2 (Simple) | ~8 minutes Change: Refactor Possibly related PRs
Suggested labels: Suggested reviewers: Merge Risk:
|
[Low impact] The PR appears safe to merge; the new swaps preserve the existing edge ordering.
|
Follow-up to #3580, #3605, #3617, #3628 and #3630. The shadow volume code swaps two silhouette edges by reading and writing their
Shortindices through anIntpointer. Accessing aShortarray through anIntis undefined behavior, the same problem as #3521.Summary
silhouetteIndicesstores each edge as a start and end index.constructVolumeandconstructVolumeVBin both games move the edge that connects to the current one next to it. They now swap the start and end withstd::swap:iandkboth step by 2, soi+2andkare always the start of an edge. Whenkisi+2, both versions leave the edge as it is.Evidence
W3DVolumetricShadowobjects against a build ofmain.constructVolumeandconstructVolumeVBchanged. Each swap now uses four 16-bit loads and stores instead of two 32-bit ones. The other differences are register choice and block order. The float instructions and calls are the same.AI Disclosure
Claude Opus 5.5 was used to aid in implementation and to compare the disassembly.