Skip to content

[p5.js 2.0+ Bug Report]: Check storage buffer limits when compiling strands shaders #9349

Open

Description

@tychedelia

Most appropriate sub-area of p5.js?

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

p5.js version

No response

Web browser and version

No response

Operating system

No response

Steps to reproduce this

Description

When strands generates WGSL, it creates a binding for each uniformStorage without keeping count. If a shader uses more storage buffers than the device allows (8 per stage by default), nothing catches it in p5, you just get a WebGPU validation error in the console when the pipeline is created.

It can be easy to hit this without realizing. For example, in a vertex/fragment shader every storage buffer gets declared in both stages, and some devices allow fewer storage buffers in the vertex stage, or none at all. This is particularly problematic on mobile which users tend not to test.

Since the renderer is already available on strandsContext, strands could count the storage bindings per stage while building the shader and compare them against device.limits. If a shader goes over, it could throw a friendly error that says how many buffers it uses, what the limit is, and which uniforms are involved, etc.

Activity

  1. welcome commented on Oct 27, 2026

    @welcome

    Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms.

    For guidance on contributing, check out our contributing guidelines and other resources for contributors.
    💬 If you have questions or need support, feel free to join the Processing Foundation Forum or visit our Community page.
    📜 Please also review our Code of Conduct to understand our community standards.
    Thank You!

  2. Anshumancanrock commented on Oct 30, 2026

    @Anshumancanrock
    Contributor

    Hi @tychedelia , I would like to work on this one. Could you please assign this to me? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions