Skip to content

feat: Buffer regions - #3272

Draft
reczkok wants to merge 7 commits into
feat/wgsl-buffer-viewfrom
feat/buffer-regions
Draft

reczkok wants to merge 7 commits into
feat/wgsl-buffer-viewfrom
feat/buffer-regions

Conversation

@reczkok

@reczkok reczkok commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Implements the buffer views half of #2816, named regions here since buffer views now means the WGSL feature. buffer.region(schema, accessor) is a typed range of a buffer that reads, writes and binds only its own bytes, and works as a vertex, index or indirect buffer

@reczkok
reczkok added this pull request to stack #3273 October 24, 2026 18:46
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@df2f191782638fb4e13f0b31f02f79266471b753
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@df2f191782638fb4e13f0b31f02f79266471b753

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

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

🟢 Decreased ➖ Unchanged 🔴 Increased (max 13.12%) ❔ Unknown
0 312 43 4

import * as ... in PR vs import * as ... in target (did bundle size increase?):

Test tsdown
STATIC_std.ts 114.87 kB ($${\color{red}+13.1\%}$$)
tgpu_bindGroupLayout.ts 76.70 kB ($${\color{red}+9.8\%}$$)
tgpu_resolveWithContext.ts 169.26 kB ($${\color{red}+5.6\%}$$)
tgpu_resolve.ts 169.32 kB ($${\color{red}+5.6\%}$$)
d_struct.ts 4.01 kB ($${\color{red}+4.7\%}$$)
STATIC_allImports.ts 324.79 kB ($${\color{red}+3.0\%}$$)
tgpu_initFromDevice.ts 261.94 kB ($${\color{red}+2.7\%}$$)
tgpu_init.ts 262.48 kB ($${\color{red}+2.7\%}$$)
STATIC_tgpu.ts 273.70 kB ($${\color{red}+2.6\%}$$)
STATIC_d.ts 72.28 kB ($${\color{red}+1.4\%}$$)
d_memoryLayoutOf.ts 35.74 kB ($${\color{red}+1.3\%}$$)
d_arrayOf.ts 33.72 kB ($${\color{red}+0.7\%}$$)
d_builtin.ts 36.19 kB ($${\color{red}+0.7\%}$$)
common_fullScreenTriangle.ts 48.82 kB ($${\color{red}+0.5\%}$$)
d_bytes.ts 1011 B
std_bufferArrayView.ts 40.44 kB
std_bufferLength.ts 41.58 kB
std_bufferView.ts 40.44 kB

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

@github-actions

github-actions Bot commented Oct 24, 2026 •

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 [1.05, 2.09, 4.66, 6.85, 8.98, 12.27, 26.05, 27.05]
  line [1.01, 2.08, 4.56, 7.16, 8.08, 12.96, 26.33, 25.96]
  line [1.02, 2.09, 4.70, 7.00, 8.38, 13.58, 26.00, 26.98]
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.33, 0.52, 0.72, 0.88, 1.20, 1.26, 1.52, 1.67]
  line [0.32, 0.54, 0.77, 0.95, 1.19, 1.33, 1.45, 1.65]
  line [0.29, 0.52, 0.69, 0.83, 1.16, 1.22, 1.43, 1.64]
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.87, 2.19, 4.42, 8.93, 15.45, 28.32, 59.23, 118.41]
  line [0.95, 2.15, 3.83, 7.87, 13.55, 28.02, 59.36, 120.97]
  line [1.01, 2.31, 3.82, 7.53, 13.98, 28.55, 59.36, 120.86]
Loading

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