Repository navigation
Conversation
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The change affects mesh drawing and extension attributes in BitmapLayer workflows. Add the required release note before merging; no new behavior problem was found. Findings
Summary
Reviews (11) · Last reviewed commit: "fix(examples): resolve the Arrow subpath..." · Reviewed by Greptile |
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed a43fe3f; recommend approval. No P1s. Arrow stays optional because the layers entry reaches apache-arrow only through dynamic imports. The bitmap node tests pass at this head.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
|
|
||
| [modules/layers/src/bitmap-layer](https://github.com/visgl/deck.gl/tree/master/modules/layers/src/bitmap-layer) | ||
|
|
||
| ### Typed meshes |
There was a problem hiding this comment.
P2: The new props sit as prose under ## Source. The Properties section has no positions, texCoords or indices entries with types and defaults. The bounds entry doesn't say that positions replace it for rendering, or that it only sets view fitting for GPU-only meshes.
Could these become #### prop entries under Properties, with a line in bounds about the override?
| } | ||
|
|
||
| /** Owns only converted Arrow allocations; supplied GPU vectors remain caller-owned. */ | ||
| export class BitmapLayerMesh { |
There was a problem hiding this comment.
| import type {ColumnSource} from '@deck.gl/core/arrow'; | ||
|
|
||
| /** A single contiguous Arrow column or caller-owned GPU vector. */ | ||
| export type BitmapMeshSource = ColumnSource | GPUVector; |
There was a problem hiding this comment.
Non-blocking: BitmapMeshSource isn't exported from the @deck.gl/layers index. Neither is BitmapImageMapping from #11031. Could both join the BitmapLayerProps type exports?
| Supply positions and texture coordinates together, with matching vertex counts. | ||
| Without indices, every three consecutive vertices form a triangle. Inputs must | ||
| have a single contiguous chunk; indexed multi-chunk topology is not supported. | ||
| GPU buffers retain their offsets and strides and remain caller-owned. Keep them | ||
| alive until the layer no longer uses them. Arrow conversion buffers are released | ||
| by the layer. In-place mutations do not trigger updates; replace the input object. | ||
|
|
||
| Supplied UVs take precedence over `_imageCoordinateSystem`. Bitmap picking still | ||
| returns image UV and pixel coordinates. CPU positions provide view-fitting bounds; | ||
| for GPU-only inputs, set `bounds` to the mesh footprint. GPU-only positions cannot | ||
| be used when a custom projection requires CPU preprojection. No implicit GPU | ||
| readback is performed. Async mesh iterators and topology transitions are not supported. | ||
|
|
||
| Removing all three mesh props restores the bounds-generated mesh. |
There was a problem hiding this comment.
P2: This block mixes the few rules users act on with internals (strides, readback, chunk topology). The Arrow update and ownership rules repeat Using with Arrow. Could it read as below, with a short example near the top like the one #11031 adds?
| Supply positions and texture coordinates together, with matching vertex counts. | |
| Without indices, every three consecutive vertices form a triangle. Inputs must | |
| have a single contiguous chunk; indexed multi-chunk topology is not supported. | |
| GPU buffers retain their offsets and strides and remain caller-owned. Keep them | |
| alive until the layer no longer uses them. Arrow conversion buffers are released | |
| by the layer. In-place mutations do not trigger updates; replace the input object. | |
| Supplied UVs take precedence over `_imageCoordinateSystem`. Bitmap picking still | |
| returns image UV and pixel coordinates. CPU positions provide view-fitting bounds; | |
| for GPU-only inputs, set `bounds` to the mesh footprint. GPU-only positions cannot | |
| be used when a custom projection requires CPU preprojection. No implicit GPU | |
| readback is performed. Async mesh iterators and topology transitions are not supported. | |
| Removing all three mesh props restores the bounds-generated mesh. | |
| Supply `positions` and `texCoords` together, with the same vertex count. Without `indices`, every | |
| three vertices form a triangle. Removing all three props restores the quad from [`bounds`](#bounds). | |
| Arrow inputs update as described in [Using with Arrow](../../developer-guide/using-with-arrow.md#loading-and-updates): | |
| pass a new vector when the mesh changes. GPUVector inputs stay owned by the app; keep them alive | |
| while the layer uses them. | |
| `texCoords` take precedence over [`_imageCoordinateSystem`](#_imagecoordinatesystem), and | |
| [pixel picking](#pixel-picking) still reports image UV and pixel coordinates. With GPU-only | |
| `positions`, set `bounds` to the mesh footprint so views can fit it. | |
| #### Limitations | |
| - Each input must be a single Arrow chunk or GPU buffer. | |
| - GPU-only `positions` don't work when deck.gl converts positions on the CPU (see [Coordinate Systems](../../developer-guide/coordinate-systems.md#positions)). | |
| - Mesh inputs can't be async iterables, and mesh changes don't transition. |
| /** XY/XYZ positions. GPU-only meshes use bounds for view-fitting metadata. */ | ||
| positions?: BitmapMeshSource | null; | ||
| /** Two texture coordinates per vertex, with (0, 0) at the image's top left. */ | ||
| texCoords?: BitmapMeshSource | null; | ||
| /** Optional tightly packed uint16/uint32 triangle indices. */ | ||
| indices?: BitmapMeshSource | null; |
There was a problem hiding this comment.
Non-blocking: These TSDoc lines are what IDE users see for the new props. Could they say what each replaces and accepts?
| /** XY/XYZ positions. GPU-only meshes use bounds for view-fitting metadata. */ | |
| positions?: BitmapMeshSource | null; | |
| /** Two texture coordinates per vertex, with (0, 0) at the image's top left. */ | |
| texCoords?: BitmapMeshSource | null; | |
| /** Optional tightly packed uint16/uint32 triangle indices. */ | |
| indices?: BitmapMeshSource | null; | |
| /** | |
| * Mesh vertex positions, replacing the quad from `bounds`: Arrow XY/XYZ lists or a | |
| * `float32x2`/`float32x3` GPUVector. With GPU-only positions, set `bounds` to the footprint. | |
| */ | |
| positions?: BitmapMeshSource | null; | |
| /** Texture coordinates per vertex, with (0, 0) at the image's top left. Supply with `positions`. */ | |
| texCoords?: BitmapMeshSource | null; | |
| /** Optional `uint16` or `uint32` triangle indices. Without them, every three vertices form a triangle. */ | |
| indices?: BitmapMeshSource | null; |
| Mesh vertex positions, replacing the quad from `bounds`. Accepts numeric Arrow XY/XYZ | ||
| fixed-size lists or a `float32x2`/`float32x3` GPUVector. With GPU-only positions, | ||
| set `bounds` to the footprint for view fitting. |
There was a problem hiding this comment.
The new BitmapLayer mesh support is documented here but missing from docs/whats-new.md. Repository instructions require newly added support to be documented there. Before merging, add a short release note covering positions, texCoords, and indices.
Rule Used: In the deck.gl repository, use Remarks sections only for user-facing, actionable limitations; document newly added support in docs/whats-new.md instead. (source)
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!
|
Coordinating projection support: #11112 adds |
athomct
left a comment
There was a problem hiding this comment.
Thank you. The ownership rules and the async version guard are careful, and the tests cover much of the lifecycle. The bitmap node and headless tests and the linter pass for me on this head. I found two problems.
- Float64
texCoordsreplace the position residuals. Inbitmap-layer-mesh.ts, the conversion loop runs forpositionsand fortexCoords. Line 100 setspositions64Lowfromresult.residualVectorfor both. A Float64 UV column has a residual vector. In a node probe with Float64 positions near[-122.42, 37.77]and Float64 UVs,positions64Lowhasname = texCoordsandformat = float32x2. This occurs withfp64: falseand withfp64: true. So the shader adds UV rounding residuals to the positions. Withfp64: true, the real position residuals are lost.vectorFromArraymakes Float64 by default for numbers, so this input is common. Please limit the assignment topositions. Please also add a node test with Float64 UVs that checkspositions64Low. - A change of
extensionsin mesh mode drops the extension attributes. OnextensionsChanged,updateMeshStatemakes a newGPUVectorModeland binds only the mesh vectors. It does not invalidate the attributes, so nothing binds them to the new model. In a headless probe, I changed[ClipExtension, DataFilterExtension]to[DataFilterExtension]. Before the update, the model has afilterValuesbinding. After the update, the new model has none. The bounds path callsinvalidateAll()in this case. The earlier Greptile thread "Mesh filters lose their values" covers the first render. This problem is in the update path. Please callinvalidateAll()here too, and add anextensionschange case to the lifecycle test.
Small item: mesh mode converts the Arrow inputs again on a modelMatrix or coordinateOrigin change, also when state.preproject is off. In that case the uploaded data does not change. The bounds path checks state.preproject first. The same check here would skip that work.
GitHub now reports a merge conflict with master.
| }); | ||
| resources.push(result); | ||
| attributes[name] = result.vector; | ||
| if (result.residualVector) attributes.positions64Low = result.residualVector; |
There was a problem hiding this comment.
This line also runs for texCoords. A Float64 UV column has a residual vector, so it replaces the position residuals. Could the condition be name === 'positions' && result.residualVector?
| inferDrawCount: 'no', | ||
| vertexCount: 0 | ||
| }); | ||
| this.state.typedMesh!.bind(this.state.model); |
There was a problem hiding this comment.
The new model gets the mesh vectors, but the extension attributes are not invalidated. So nothing binds them to this model. Could this call this.getAttributeManager()!.invalidateAll(), as the bounds path does?
| if ( | ||
| enteringMesh || | ||
| changeFlags.projectionChanged || | ||
| !deepEqual(props.modelMatrix, oldProps.modelMatrix, 1) || |
There was a problem hiding this comment.
When state.preproject is off, a modelMatrix or coordinateOrigin change does not change the uploaded data. Could these two checks depend on state.preproject, as in the bounds path?
There was a problem hiding this comment.
Reviewed 84913e4; comments only at this point.
No P1s.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| #### `bounds` (number[4] | Position[4]) {#bounds} | ||
|
|
||
| When `positions` is supplied, it defines the rendered mesh. For GPU-only positions, `bounds` | ||
| provides the footprint for view fitting. |
There was a problem hiding this comment.
Non-blocking: "it" can read as bounds. Could it name positions?
| provides the footprint for view fitting. | |
| When `positions` is supplied, it replaces the quad from `bounds`. With GPU-only positions, | |
| `bounds` still sets the footprint for view fitting. |
Generated by Claude Code
| Optional `uint16` or `uint32` triangle indices. Without indices, every three vertices form | ||
| a triangle. Removing all mesh props restores the quad from `bounds`. | ||
|
|
||
| Remarks: |
There was a problem hiding this comment.
Non-blocking: These Remarks apply to all three mesh props but sit under indices. Could the lead-in say so?
| Remarks: | |
| Remarks for `positions`, `texCoords` and `indices`: |
Generated by Claude Code
Background
BitmapLayer currently generates its mesh from bounds. Accept Arrow columns and GPU vectors for explicit vertex and index inputs, retaining caller ownership.
Change List
BitmapLayerpositions, texCoords, and indices propsGPUVectorModelVerified build, lint, website, five Node tests, nine browser tests, eight render tests.
Note
Medium Risk
Adds new geometry pipeline paths and resource lifecycle management in
BitmapLayer, but preserves existing bounds-based quad generation as fallback.Overview
Adds support for explicit triangle meshes in
BitmapLayervia newpositions,texCoords, andindicesprops, enabling custom geometry instead of automatic quad generation frombounds.Mesh inputs accept single-chunk Apache Arrow columns or pre-allocated
GPUVectorinstances. A newBitmapLayerMeshclass coordinates asynchronous Arrow conversion, binds geometry and index vectors directly toGPUVectorModel, computes bounds, and manages resource cleanup while preserving caller ownership of external GPU buffers.BitmapLayeralso supports dynamically toggling between explicit mesh inputs and the traditional quad mesh.Reviewed by Cursor Bugbot for commit 84913e4. Bugbot is set up for automated code reviews on this repo. Configure here.