Skip to content

Conversation

davepagurek
Copy link
Contributor

This adds framebuffer support! To do that:

  • Everything renderer-specific has been moved out of p5.Framebuffer.js and moved into calls on its renderer
  • I had to update some multisampling stuff in WebGPU (notably, not all sample counts are supported)
  • I rewrote the loadPixels (and related method) implementations.
    • All WebGPU pixel loading methods are async now and must be awaited.
      • Previously, main canvas pixel loading worked if you never awaited anything, since the canvas texture is (temporarily) readable. But offscreen stuff would always need to be awaited. Rather than have some async and some sync, I'm opting to make all WebGPU pixel loading use the same method, which is async.
      • WebGL pixel loading is still synchronous as before.
  • I also updated images created via .get() to use the same pixel density as the source, rather than always downscaling to 1x.

PR Checklist

@davepagurek
Copy link
Contributor Author

interesting, our CI test runner is old enough that it doesn't have webgpu support. gotta look into that...

@davepagurek
Copy link
Contributor Author

Update on this:

  • Neither Chrome nor Firefox on Windows have support for webgpu with a software renderer
  • Chrome on Linux doesn't really either; it can get as far as returning a webgpu adapter and device, but as soon as you start to use it, it breaks inside the Dawn implementation with A valid external Instance reference no longer exists.

So it's looking like there may just not be a way of running WebGPU in CI without an actual GPU.

SO:

  • For now, I'm not running webgpu tests on CI so that we can unblock this and merge this in
  • I've included @tychedelia's updates from webgpu ci test #8023 that sets up CI for multi-platform tests and multiple test projects (thanks!) for the future
  • I'm going to see how feasible it is to run a self-hosted Github Actions server in my fork of p5 as a possible not-long-term setup for getting CI with WebGPU
  • It's also possible to run paid GitHub actions with a GPU

@davepagurek davepagurek merged commit 117ab93 into webgpu Sep 14, 2025
2 checks passed
@davepagurek davepagurek deleted the webgpu-fbo branch September 14, 2025 15:11
@davepagurek davepagurek mentioned this pull request Sep 14, 2025
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.

2 participants