Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform Buffer Objects in webGL2? #6439

Open
aferriss opened this issue Sep 27, 2023 · 1 comment
Open

Uniform Buffer Objects in webGL2? #6439

aferriss opened this issue Sep 27, 2023 · 1 comment

Comments

@aferriss
Copy link
Contributor

Topic

I was doing some logging in the setUniform function and noticing how many uniforms we're setting, even when just drawing a single object with nothing but flat lighting. Would it improve our perf at all if we switched to using uniform buffer objects instead of setting each uniform one by one for the fill / stroke / material shaders?

This might introduce more complexity than its worth, but I thought it would be good to flag nonetheless!

@davepagurek
Copy link
Contributor

Sounds like maybe the next step for this would be to see if we can make a test sketch to benchmark on (possibly without even using p5?) to see how much of a gain we could get? Looking at chrome://tracing, it seems like on my machine at least, a lot of GPU work accumulates in the command queue and executes all in one batch at the end, so potentially the browser is already is batching its uniform setting. I definitely haven't tested that specific scenario though, so it would be cool to see for sure!

@davepagurek davepagurek moved this to System Level Changes in p5.js WebGL Projects Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: System Level Changes
Development

No branches or pull requests

2 participants