Skip to content

Conversation

@iwoplaza
Copy link
Collaborator

@iwoplaza iwoplaza commented Jan 7, 2026

Accessors could always provide:

  • Comptime-known values
  • tgpu.fn functions that return a value matching the schema
  • Buffer usages and buffer shorthands that hold the schema

Now, accessors can provide:

  • tgpu.const references
  • tgpu.*Var references
  • Shell-less functions
  • Deep references to nested structures (with regular callbacks)
  • comptime functions that are ran when requesting the value

There's also a new resource: tgpu.mutableAccessor. It's currently functionally the same as tgpu.accessor but with a more restricted API, and with future PRs, values accessed from regular accessors will be immutable.

Things to do in subsequent PRs:

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@47eff0e83ae4d9987ebaaaf8f4579d838ffd647b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@47eff0e83ae4d9987ebaaaf8f4579d838ffd647b
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@47eff0e83ae4d9987ebaaaf8f4579d838ffd647b

benchmark
view benchmark

commit
view commit

@iwoplaza iwoplaza marked this pull request as ready for review January 7, 2026 17:16
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.

Accessors should accept runtime-sized schemas feat: More capable accessor values

2 participants