feat(arrow) convert colors#2638
Conversation
| // SPDX-License-Identifier: MIT | ||
| // Copyright (c) vis.gl contributors | ||
|
|
||
| import './convert-colors.spec'; |
There was a problem hiding this comment.
It was only a Node test-discovery shim that imported the shared suite. There is no separate browser suite to share here, so I removed the wrapper and moved the actual tests directly into convert-colors.node.spec.ts.
| );`; | ||
| case 'float16x3': | ||
| return ` return vec4<f32>( | ||
| readFloat16(rowByteOffset), |
There was a problem hiding this comment.
Why do you need to read a float as uint?
There was a problem hiding this comment.
The source storage binding is word-addressed (array<u32>) so one shader can read packed Uint8, Float16, and Float32 rows while honoring byte offsets and strides. The uint is only the raw storage word: Float16 uses unpack2x16float and Float32 uses bitcast<f32>, so there is no numeric uint-to-float conversion. I renamed the readers to make the bit-level behavior explicit and added a WGSL comment explaining it. For Float16x3, the Arrow adapter uses the byte-identical Uint16x3 storage layout because VertexFormat has no Float16x3 entry, while inputFormat retains the Float16 interpretation.
Pessimistress
left a comment
There was a problem hiding this comment.
As discussed, deck.gl layers already expect color attributes to be normalized, so theoretically they should not reject a float32 input.
07ff874 to
ff76f0d
Compare
Goals
GPUData,GPUDataView, and evaluator APIs.Changes
convertArrowColors,convertColors,canConvertColors, andArrowColorTypefrom@luma.gl/arrow.convertColorsGPGPU operation overGPUData/GPUDataViewinputs, with chunk-preservingGPUVectorEvaluatorintegration and canonicalunorm8x4output.ArrowPathLayer,ArrowPolygonLayer, andArrowTextLayercolor props. Nested per-vertex colors remain RGBA8-only..node.spec.tssuite.Verification
nvm useyarn lint fixyarn buildyarn testDocs