You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces createStorageList, which is like createStorageBuffer but is variable-length, where you call .push() on it rather than just writing to indices
Lets you pass a storage list to instances() to draw that many items
@davepagurek I had a read, the indirect draw path is really nice copying the atomic length straight into instanceCount and never round tripping to the cpu is exactly the right call
two things that look like bugs
instances(storageBuffer) uses .size not .length
3d_primitives.js:2704 does count = count.size, which is the 16 byte aligned byte length, not the element count. .length is right there on the constructor so looks like a slip. The visual test uses a struct buffer so it might still land onscreen, a flat Float32Array one would show it right away
overflow counter reaches the indirect draw unclamped
_p5_push_* does atomicAdd unconditionally and only guards the store, so the counter climbs past maxCapacity even though nothing gets written. read() clamps with Math.min(..., maxCapacity), but the copyBufferToBuffer into instanceCount copies the raw counter. So an overflowing list draws more instances than exist and reads uninit data. read and draw should probably agree here
this adds length as the 5th constructor param on StorageBuffer, mine adds arrayType in the same slot. whichever lands second clobbers the other
the spreading fix
that one's on me. the stride used px but the real dispatch width is ceil(px/8)*8, so rows overlapped whenever ceil(sqrt(N)) wasn't a multiple of 8. fix looks right and N=2500 hits it squarely
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
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.
Resolves #9081
Changes:
createStorageList, which is likecreateStorageBufferbut is variable-length, where you call.push()on it rather than just writing to indicesinstances()to draw that many itemsPR Checklist
npm run lintpasses