Repository navigation
feat(core): Handle webgpu constant attributes efficiently - #10567
Merged
Merged
Conversation
Greptile SummaryThe PR replaces per-instance expansion of WebGPU constant attributes with one-row buffers and zero-stride layouts.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified. The changed paths consistently retain one constant row, expose it through zero-stride WebGPU layouts, and cover both standalone and grouped attribute bindings without an established contract violation.
|
| Filename | Overview |
|---|---|
| modules/core/src/lib/attribute/attribute.ts | Retains one raw constant row, uploads it once per assignment, and exposes it for WebGPU buffer grouping. |
| modules/core/src/lib/attribute/data-column.ts | Exposes WebGPU constants as one-row buffers with zero-stride layouts and handles double-precision companion attributes. |
| modules/core/src/lib/attribute/attribute-buffer-groups.ts | Accepts constants as interleave inputs, preserves their underlying bytes, and emits a one-row zero-stride buffer for all-constant groups. |
| test/modules/core/lib/attribute/attribute-buffer-groups.spec.ts | Covers constant broadcasting in mixed groups and compact zero-stride output for all-constant groups. |
| test/modules/core/lib/attribute/attribute-manager.spec.ts | Updates WebGPU attribute-manager expectations to retain constants as single rows. |
| test/modules/core/lib/attribute/attribute.spec.ts | Verifies standalone and updater-backed WebGPU constants use one-row buffers and zero-stride layouts. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Constant attribute value] --> B[Normalize one vertex row]
B --> C[Upload one-row WebGPU buffer]
C --> D{Buffer group?}
D -- No --> E[Standalone zero-stride layout]
D -- Mixed group --> F[Broadcast during interleaving]
D -- All constants --> G[Pack one row with zero stride]
E --> H[Model attribute binding]
F --> H
G --> H
Reviews (1): Last reviewed commit: "scope attribute.constant flag reset to w..." | Re-trigger Greptile
ibgreen
approved these changes
Aug 20, 2026
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.
Change List
AttributeBufferGroupsnow accepts constants as inputs