Repository navigation
feat(layers): use typed GPU attributes in standard layers - #10907
Conversation
|
The webgpu test step does not run unit tests right now: Line 33 in 8ffcc91 |
7673115 to
5519942
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR changes rendering attribute binding for five standard layer types and their text sublayers. The PR appears safe to merge, with a non-blocking gap in the new color-binding tests. Findings
SummaryMoves five standard layer models to
|
| expect(columns[colorAttribute]).toBeInstanceOf(varying ? GPUVector : GPUConstant); | ||
| if (varying) { | ||
| expect((columns[colorAttribute] as GPUVector).length).toBe(DATA.length); | ||
| const group = attributeManager.getAttributes()[colorAttribute].settings.bufferGroup; | ||
| if (backend === 'webgpu' && group) { | ||
| expect(model.bufferLayout.some(layout => layout.name === group)).toBe(true); | ||
| } | ||
| } else { | ||
| expect(Array.from((columns[colorAttribute] as GPUConstant).value)).toEqual(COLOR); |
There was a problem hiding this comment.
The WebGPU checks inspect fresh columns from getGPUVectors(), but never compare the model's bound color bytes. Both rows also use the same COLOR across all updates. With draw: false, a stale binding, wrong offset, or repeated first row could pass.
Use different colors for each row and update, then check the model's bound bytes using the resolved layout. Check the varying color binding on WebGL too.
Knowledge Base Used: Distribution and quality
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 48d687d after merge; follow-ups below. No P1s. One P2: test-layer.md is missing the new device and draw options and the async onAfterUpdate.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
| /** Render after each update. Disable for tests that only inspect attribute bindings. */ | ||
| draw?: boolean; | ||
| /** Device used to initialize and render the layer. Defaults to the WebGL test device. */ | ||
| device?: Device; |
There was a problem hiding this comment.
P2: testLayer and testLayerAsync are public, and docs/api-reference/test-utils/test-layer.md doesn't list these options or say that testLayerAsync awaits a Promise from onAfterUpdate. Master still matches this PR.
Could we add these to its Usage list:
* `device` (`Device`, Optional) - the luma.gl device used to create and draw the layer. Default: the shared WebGL test device, or a `NullDevice` when WebGL is unavailable.
* `draw` (boolean, Optional) - draw the layer after each update. Default: `true`. Set to `false` when a test only inspects layer state or attributes.and replace "When using TestLayerAsync, onAfterUpdate is called multiple times until all resources are loaded." with:
With `testLayerAsync`, `onAfterUpdate` runs after each update until the layer is loaded and no layer update is pending. It can return a Promise, which is awaited before the next update. `testLayer` does not wait for it.
Follow up of #10882
Background
Extend typed attribute binding to the next group of standard instanced models. Indexed, multi-model, and specialized layers remain for subsequent migrations; user-provided GPU columns remain deferred.
Change List
ArcLayer,LineLayer, andPointCloudLayerIconLayerand inherited glyph renderingTextBackgroundLayerCI passes on current master: coverage, WebGPU unit/render tests, website, and Python. Async lifecycle and terrain regressions pass locally.