Repository navigation
Port FillStyleExtension patterns to WebGPU - #11024
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 reaches fill layers that use FillStyleExtension for pattern rendering. Fix the shader argument type and add the required release-note entry before merging. FindingsSummaryAdds WebGPU atlas fills and procedural hatches, cross-hatches, and dots to
No runtime or visual verification was performed. Reviews (1) · Last reviewed commit: "Extract backend-aware float parameter te..." · Reviewed by Greptile |
| 'wgsl:vs:DECKGL_FILTER_GL_POSITION': /* wgsl */ ` | ||
| if (fill.patternEnabled != 0) { | ||
| let cameraFlatX = project_common_position_to_flat(project.cameraPosition).x; | ||
| let flatPosition = project_common_position_to_flat_continuous(geometry.position, cameraFlatX); |
There was a problem hiding this comment.
Pattern shaders cannot compile
project_common_position_to_flat_continuous takes a vec3<f32>, but this call passes geometry.position, which is a vec4<f32>. WGSL does not convert between these types automatically. Any WebGPU layer using the pattern plugin will fail shader validation, for both atlas and procedural patterns. Pass geometry.position.xyz instead.
| let flatPosition = project_common_position_to_flat_continuous(geometry.position, cameraFlatX); | |
| let flatPosition = project_common_position_to_flat_continuous(geometry.position.xyz, cameraFlatX); |
There was a problem hiding this comment.
P1: Still on master (shader-module.wgsl.ts:131). A WebGPU layer with FillStyleExtension({pattern: true}) or proceduralPattern: true fails shader validation. webgpu.md still marks FillStyle ❌, so no page promises it yet.
- A reduced shader with this call and the WGSL
VertexGeometrystruct fails in Chrome WebGPU: "type mismatch for argument 1 ... expected 'vec3', got 'vec4'". With.xyzit compiles. - Every fill-pattern render case still skips WebGPU (fill-pattern.spec.ts:101-341), so CI can't catch it.
Could we apply the suggestion above and enable one atlas case and one procedural case on WebGPU?
There was a problem hiding this comment.
Yes—both are warranted. The .xyz change addresses the shader-validation error. The existing fill-style.spec.ts cases are guarded by webglTest, so they won’t exercise the WGSL plugin; add targeted WebGPU smoke cases that compile and render one atlas pattern and one procedural pattern. For the procedural case, account for the WebGPU texture format (rg32uint), rather than the current WebGL-only rg32float assertion.
| let flatPosition = project_common_position_to_flat_continuous(geometry.position, cameraFlatX); | |
| let flatPosition = project_common_position_to_flat_continuous(geometry.position.xyz, cameraFlatX); |
I can’t apply the changes or run the tests from this read-only review thread.
| plugins: extension.opts.pattern | ||
| ? [this.context.device.type === 'webgpu' ? patternPluginWGSL : patternPlugin] | ||
| : [], |
There was a problem hiding this comment.
The new WebGPU path has no enabled fill-pattern render coverage. The existing atlas, procedural, orientation, and globe cases still skip WebGPU, and the layer tests also run only on WebGL. Enable representative atlas and procedural render cases for WebGPU so shader failures and visual differences are caught automatically.
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!
|
|
||
| The `FillStyleExtension` adds selected features to layers that render a "fill", such as the `PolygonLayer` and `ScatterplotLayer`. | ||
|
|
||
| The WebGPU port covers texture atlas patterns and procedural hatches, cross-hatches, and dots. |
There was a problem hiding this comment.
Release notes omit new support
This adds a new-support announcement to the API reference without adding it to docs/whats-new.md. The repository rule requires newly added support to be documented in docs/whats-new.md. Add an entry under Unreleased before merging so readers can discover the WebGPU support.
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!
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed 1554964 after merge; follow-ups below. One P1: WebGPU pattern shaders fail validation (reply in the existing thread on shader-module.wgsl.ts:131).
P2: developer-guide/webgpu.md is stale for the extension ports. Line 93 says "Most remain WebGL-only". Row 98 says countItems requires WebGL (#11035 added it). Row 103 marks CollisionFilter ❌ (#11026 ported it), and row 121 says other extensions still need migration. Row 101 (FillStyle ❌) is right until the shader fix lands. Line 78 says text backgrounds need WebGL, but most text-layer background render cases run on WebGPU. Could one pass on the page use the text below? whats-new "Extension updates" lists only the Mask port, and one bullet linking to this table would cover the rest.
The table below covers the public extensions in `@deck.gl/extensions`. Custom layers support them on WebGPU by calling the [extension injection targets](./custom-layers/layer-extensions.md#webgpu-shader-plugins). ScreenGridLayer and GridLayer apply `DataFilterExtension` and `ClipExtension` to input points before aggregating.
| `@deck.gl/extensions` | `DataFilterExtension` | ✅ | ✅ |
| `@deck.gl/extensions` | `FillStyleExtension` | ✅ | ✅ |
| `@deck.gl/extensions` | `CollisionFilterExtension` | ✅ | ✅ |
| Shader injection targets / layer extensions | ✅ | Standard primitives call the shared injection targets on WebGPU. |Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
| 'wgsl:vs:DECKGL_FILTER_GL_POSITION': /* wgsl */ ` | ||
| if (fill.patternEnabled != 0) { | ||
| let cameraFlatX = project_common_position_to_flat(project.cameraPosition).x; | ||
| let flatPosition = project_common_position_to_flat_continuous(geometry.position, cameraFlatX); |
There was a problem hiding this comment.
P1: Still on master (shader-module.wgsl.ts:131). A WebGPU layer with FillStyleExtension({pattern: true}) or proceduralPattern: true fails shader validation. webgpu.md still marks FillStyle ❌, so no page promises it yet.
- A reduced shader with this call and the WGSL
VertexGeometrystruct fails in Chrome WebGPU: "type mismatch for argument 1 ... expected 'vec3', got 'vec4'". With.xyzit compiles. - Every fill-pattern render case still skips WebGPU (fill-pattern.spec.ts:101-341), so CI can't catch it.
Could we apply the suggestion above and enable one atlas case and one procedural case on WebGPU?
Background
FillStyle patterns use GLSL today. This adds the corresponding WebGPU shader plugin for atlas fills and procedural patterns.
Change List
Verified: full build, lint, and diff check passed. WebGPU rendering and visual parity still need verification.
Note
Low Risk
Low risk, as changes are scoped to
FillStyleExtensionWebGPU shader definitions and maintain backward compatibility with the existing WebGL path.Overview
Adds WebGPU support to
FillStyleExtension, implementing texture atlas sampling and procedural fills (hatches, cross-hatches, and dots) via WGSL shaders.The extension now selects between the existing GLSL shader plugin and a new WGSL plugin based on the device type. On WebGPU, procedural pattern uniforms are stored in an
rg32uinttexture and bitcast tof32during vertex lookups, avoiding dependencies on optional floating-point filtering features.Reviewed by Cursor Bugbot for commit 1554964. Bugbot is set up for automated code reviews on this repo. Configure here.