[Refactor] Shared per-mesh vertex-stream binding + unknown-chunk regression test - #16
Open
miogds wants to merge 1 commit into
Open
[Refactor] Shared per-mesh vertex-stream binding + unknown-chunk regression test#16miogds wants to merge 1 commit into
miogds wants to merge 1 commit into
Conversation
Replace the nine open-coded per-mesh vertex buffer bind sites in the model-family and shadow-family passes with bindModelVertexStreams / bindShadowVertexStreams encoder helpers. Batched-geometry sites keep their raw batch-buffer binds. Also add a reader regression test covering unknown core-range chunk types so future format chunks cannot brick older runtimes. Groundwork for the deformation compute pass: the helpers are the single point where deformed position/normal buffers will replace the base streams.
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.
What
bindModelVertexStreams/bindShadowVertexStreamsencoder helpers (Renderer/RenderVertexStreamBinding.swift) and replaces the nine open-coded per-mesh vertex-buffer bind sites across the model, shadow (CSM/spot/point), transparency, and wireframe passes plusRenderExtensionModelSurface. Batched-geometry sites keep their raw batch-buffer binds (they never deform).testUnknownCoreChunkTypeIsIgnoredtoNativeFormatTests: a core-range chunk type unknown to the runtime must not prevent the rest of a.untoldasset from loading (guards forward compatibility for upcoming format chunks).Why
Groundwork for a deformation compute pre-pass: the helpers become the single point where deformed position/normal buffers can replace the base vertex streams for every pass at once. Zero behavior change intended.
Verification
swift buildclean; unit test target green exceptExternalRenderExtensionPackageTests(pre-existing local toolchain/SDK mismatch, fails identically ondevelop).AnimationTests/test_referenceKeyframesrenders compared pixel-by-pixel against a cleandevelopbaseline run: all five pose images are bit-identical. (The test itself fails ondeveloptoo:compare_psnr.pyneedscv2, and the current renders differ from the checked-in references.)Note for reviewers: the shadow-pass sites previously indexed the source
metalKitMesh.vertexBuffersarray withmodelPass*enums while binding toshadowPass*slots — that was correct (the array is in model-descriptor order); the helper now encodes that distinction explicitly.