Skip to content

Add a way to read data from a WebGPU storage buffer #8722

@davepagurek

Description

@davepagurek

Increasing access

One of the benefits of WebGPU compute shaders is that it can be a faster way to do things like simulations or calculations. Often that's paired with rendering, but sometimes it'd be helpful to be able to get the raw numbers out as a result. Currently, there's not a good way to do that, so we're limiting the use of compute shaders to rendering applications only.

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature enhancement details

p5.StorageBuffer could get a method like .get() or maybe .read() that you'd have to await and would pull its data down from the GPU and unpack it into an array of the same format that it was initialized with.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions