Repository navigation
gx: use zero texcoords when a texgen's source attribute is missing - #305
Open
StilesCrisis wants to merge 1 commit into
Open
StilesCrisis wants to merge 1 commit into
StilesCrisis wants to merge 1 commit into
Conversation
A texgen whose source is GX_TG_TEX0..7 can be enabled while the current vertex descriptor has no matching GX_VA_TEXn attribute (some games leave a texgen set up from an earlier draw). vtx_attr hit FATAL in that case. Feed (0, 0) instead, the same way missing colors and normals already get defaults; Dolphin likewise substitutes zero for a missing source texcoord. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjpWoYqNDKkH5Zpdbz3WaW
StilesCrisis
force-pushed
the
texgen-missing-texcoord
branch
from
November 7, 2026 02:55
15155f2 to
04fbec8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a texgen sources
GX_TG_TEX0..GX_TG_TEX7but the current vertex descriptor has no matchingGX_VA_TEXnattribute,vtx_attrcurrently hitsFATAL("unmapped vtx attr ..."). Some games intentionally leave a texgen configured from an earlier draw, which makes this abort at runtime. This change returnsvec2f(0.0, 0.0)for those attributes instead, the same way missing colors and normals already get defaults.Related: #272. I noticed after writing this that @Antidote's #272 targets the same abort. While reading that change I spotted one small thing that may be worth a look: the new range check is written as
This condition is always true (I believe
&&was the intent). It would be fine to land #272 instead, if we change the||to&&here.This PR is just the
vtx_attrpart with the bounds check, which fixed the bug that I ran into. Thanks for all your work on Aurora!