Skip to content

docs: Replace raw WebGPU/WGSL in examples with TypeGPU APIs - #3301

Draft
iwoplaza wants to merge 1 commit into
releasefrom
review-raw-webgpu-wgsl
Draft

iwoplaza wants to merge 1 commit into
releasefrom
review-raw-webgpu-wgsl

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces raw WebGPU/WGSL in examples with TypeGPU APIs where one exists.

  • Removed the old matrix-multiplication (raw WGSL + raw pipeline), renamed matrix-next to matrix-multiplication
  • box-raytracing: getBoxIntersection is now TypeScript
  • Depth/MSAA textures use root.createTexture(...).$usage('render')
  • root.createSampler, root['~unstable'].createRenderBundleEncoder, texture.write, root.enabledFeatures instead of their raw counterparts
  • selfie-segmentation uses TgpuCommandEncoder/TgpuComputePass
  • circles and lines-combinations use tgpu.init + root.configureContext
  • Merged render-bundles-with into render-bundles (toggle for the .with API)

@github-actions

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@60222c67c03c12be4aaf51a70b8708c5a598ca29
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@60222c67c03c12be4aaf51a70b8708c5a598ca29
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@60222c67c03c12be4aaf51a70b8708c5a598ca29
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@60222c67c03c12be4aaf51a70b8708c5a598ca29
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@60222c67c03c12be4aaf51a70b8708c5a598ca29

benchmark
view benchmark

commit
view commit

@iwoplaza
iwoplaza changed the base branch from main to release October 30, 2026 18:49
@github-actions

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.57, 1.14, 2.32, 3.36, 4.04, 6.83, 14.83, 15.57]
  line [0.57, 1.12, 2.46, 3.75, 4.17, 6.79, 13.72, 14.32]
  line [0.54, 1.05, 2.21, 3.52, 3.58, 7.24, 13.41, 14.76]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.20, 0.35, 0.45, 0.77, 0.68, 0.65, 0.79, 0.91]
  line [0.15, 0.25, 0.35, 0.48, 0.62, 0.63, 0.80, 0.90]
  line [0.16, 0.26, 0.43, 0.48, 0.70, 0.70, 0.78, 0.88]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.54, 1.26, 2.18, 3.82, 7.72, 14.68, 33.36, 66.01]
  line [0.52, 1.31, 2.45, 3.99, 7.67, 15.26, 34.14, 63.79]
  line [0.46, 1.41, 2.35, 4.42, 7.26, 13.75, 30.02, 62.34]
Loading

@github-actions

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 355 0 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

This branch has not been deployed

No deployments
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.

1 participant