Remove the usage warning from TransformFeedback buffer adoption - #9136
Merged
Conversation
The warning added in #9135 fires on the shipped graphics/transform-feedback example, which passes a mesh vertex buffer created by Mesh#setPositions with the default BUFFER_STATIC usage. That is not a mistake - the class documents "any VertexBuffer, either manually created, or from a Mesh" as a valid input, and the re-upload exists precisely to adopt such buffers. From inside the helper the legitimate case is indistinguishable from a forgotten usage flag, so the warning cannot be made accurate and is removed. The one-time adoption cost at construction is now noted in a comment instead. The storage assert from #9135 is unaffected - that one catches a real mistake with no supported use behind it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Build size reportThis PR does not change the size of the minified bundles.
|
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.
Description
Reverts the
Debug.warnOncehalf of #9135. The storage assert from that PR stays — it catches a real mistake with no supported use behind it.The warning fires on the shipped, unmodified
graphics/transform-feedbackexample:That example does nothing wrong.
mesh.setPositions(positions, 4)creates its vertex buffer with the defaultBUFFER_STATICusage, and handing that toTransformFeedbackis the documented contract — the class doc says the input can be "any VertexBuffer, either manually created, or from a Mesh". The re-upload is not a mistake path; it is the intended adoption mechanism for exactly this case, and it runs once at construction, never per frame (_createOutputBufferis constructor-only).From inside the helper, the legitimate case (borrowing a static mesh buffer) and the case worth catching (a buffer built for repeated GPU-only use with a forgotten usage flag) are indistinguishable — same object shape, same call, same one-time reallocation, and nothing on
VertexBufferencodes the caller's intent. So the warning cannot be sharpened to fire only when it should; it can only accuse correct code. Removed, with the one-time adoption cost recorded in a comment instead.Testing
Debugremains imported and used by the other checks in the file.Checklist
🤖 Generated with Claude Code