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

WebGPURenderer: don't create duplicate shader programs in the WebGL fallback renderer #29135

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

aardgoose
Copy link
Contributor

Since #27367 the WebGL fallback renderer has equated the pipeline object to the WebGLProgram object but is cached per renderObject.id (previously the VAO was included in the pipeline state).

This results in the creation of redundant program objects, as demonstrated in the webgpu_performance example where over 700 are created.

Remove renderObject.id from the cache key to fix this issue.

@sunag @RenaudRohlinger

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.1 kB (169.6 kB) 685.1 kB (169.6 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
462 kB (111.4 kB) 462 kB (111.4 kB) +0 B

@RenaudRohlinger
Copy link
Collaborator

RenaudRohlinger commented Aug 14, 2024

That was it, awesome @aardgoose! The WebGL version of webgpu_performances.html is back to 144fps!

@RenaudRohlinger RenaudRohlinger added this to the r168 milestone Aug 14, 2024
@sunag sunag merged commit bd2051d into mrdoob:dev Aug 14, 2024
12 checks passed
@aardgoose aardgoose deleted the pipeline-cache branch August 20, 2024 10:08
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.

3 participants