fix(lower): inherit parent vertex stage in extends - #7
Merged
Conversation
…drop - Child materials extending a vertex-authoring parent silently lost the parent's vertex(), varyings, and statefield; resolveExtends only merged params and inlined super.surface, so the compile reported success while the emitted shader reverted to a default (undisplaced) transform - Inherit parent's vertex stage, varyings, and statefield when the child declares no vertex() of its own, so super.surface(geo) keeps resolving the geo fields the parent stage produces - Reject with a CodeUnsupportedFeat diagnostic when both child and parent declare vertex(), since silently preferring one side would just relocate the silent drop and super.vertex() composition is not supported yet - Add diagnostic hint guiding users to remove one of the two vertex() declarations or drop extends
odvcencio
force-pushed
the
fix/extends-inherits-vertex-stage
branch
from
July 27, 2026 18:30
6ecfeae to
e1e8887
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.
Summary
When a material extends a parent authoring
vertex()/varyings/statebut declares none of its own, the compiler previously dropped the parent's vertex stage silently, emitting a default undisplaced transform. This branch fixesresolveExtendsto inherit the parent's vertex stage and associated fields when the child provides novertex()of its own. If both parent and child declare avertex()stage, it now emits a clear diagnostic instead of silently preferring one side.Changes
Vertex,Varyings, andStatesduringextendscomposition when the child declares novertex()stage.CodeUnsupportedFeatdiagnostic when both parent and child declarevertex(), preventing silent drops or unexpected shader behavior.diagnostics.goto guide users to remove conflictingvertex()declarations or dropextends.Testing
go test ./lower/... -v -run TestResolveExtendsto verify inheritance, rejection logic, and surface-only regression guard.