Visitar URL original
feat(layers): port TextBackgroundLayer to WebGPU by Pessimistress · Pull Request #10569 · visgl/deck.gl · GitHub
Skip to content

feat(layers): port TextBackgroundLayer to WebGPU - #10569

Merged
Pessimistress merged 5 commits into
masterfrom
x/text-bg-layer
Aug 20, 2026
Merged

Pessimistress merged 5 commits into
masterfrom
x/text-bg-layer

Conversation

@Pessimistress

@Pessimistress Pessimistress commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

For #10270

Change List

  • Port TextBackgroundLayer to WebGPU
  • Enable TextLayer render tests on WebGPU

@greptile-apps

greptile-apps Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR ports TextBackgroundLayer rendering to WebGPU and enables its WebGPU render coverage.

  • Adds WGSL shader and uniform definitions for text backgrounds.
  • Interleaves instance attributes to remain within portable WebGPU buffer limits.
  • Enables TextLayer WebGPU render tests and adds platform-specific golden images.
  • Marks TextLayer as WebGPU-supported in the developer documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
modules/layers/src/text-layer/text-background-layer/text-background-layer.wgsl.ts Adds the WebGPU vertex and fragment shader implementation for text background geometry, clipping, styling, picking, and highlighting.
modules/layers/src/text-layer/text-background-layer/text-background-layer.ts Registers the WGSL source and color module while grouping instance attributes for portable WebGPU resource limits.
modules/layers/src/text-layer/text-background-layer/text-background-layer-uniforms.ts Adds the WGSL text-background uniform structure and binding.
test/render/test-cases/text-layer.spec.ts Enables the existing TextLayer render suite for WebGPU.
docs/developer-guide/webgpu.md Documents TextLayer as supported on WebGPU beginning with version 9.4.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[TextLayer properties] --> B[TextBackgroundLayer]
  B --> C[Interleaved instance attributes]
  C --> D[WGSL vertex shader]
  D --> E[Background geometry and clipping]
  E --> F[WGSL fragment shader]
  F --> G[Fill, stroke, picking, and highlighting]
  G --> H[WebGPU render output]
Loading

Reviews (2): Last reviewed commit: "Merge branch 'master' into x/text-bg-lay..." | Re-trigger Greptile

Comment on lines +74 to +75
var pixelOffset =
(attributes.positions * attributes.instanceRects.zw + attributes.instanceRects.xy) *

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Avoid abbreviated shader locals

The newly introduced names xy, wh, and q obscure the meaning and units of intermediate clipping and rounded-rectangle calculations, increasing the maintenance cost of this calculation-heavy shader. Use descriptive camelCase names as required by the repository naming guidance.

Context Used: AGENTS.md (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!

@coveralls

coveralls commented Aug 19, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.131% (+0.008%) from 82.123% — x/text-bg-layer into master

Base automatically changed from x/constant-attr to master August 20, 2026 18:14
@Pessimistress
Pessimistress merged commit 3f72683 into master Aug 20, 2026
7 checks passed
@Pessimistress
Pessimistress deleted the x/text-bg-layer branch August 20, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants