-
-
Notifications
You must be signed in to change notification settings - Fork 36k
WebGPURenderer: Don't set redundant state #26186
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
| @@ -1,3 +1,7 @@ | |||
| /*// debugger tools | |||
| import 'https://greggman.github.io/webgpu-avoid-redundant-state-setting/webgpu-check-redundant-state-setting.js'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greggman I've added its lib here, so it can inspire other developers to build good tools for it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add some debug toggle (for example, global variable like window.DEBUG), which will dynamic-import the lib if enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe THREE.Renderer( { debug: true } )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... And maybe place renderer.info also under that toggle? Like, it isn't updating (and there is no such property) when it is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... And maybe place renderer.info also under that toggle? Like, it isn't updating (and there is no such property) when it is disabled.
I think debug would be a property for development, info can still be useful for inspection.
|
@Mugen87 I would like to know if it's ok for you to add |
|
forgive me if there are good reasons to use UUID in a cache bit just in case you didn't know you can use objects as keys in |
I don't think *Map would fit in this case, the UUID was an exception to the Hash because it was comparing the Geometry and not the attributes individually, looking closer I think that just simple comparisons should solve it, but I'll have to test it. |
|
Now it looks good :) . Merging... |
|
The UUIDs are mainly intended for serialization/deserialization in order to identify shared resources so it's good that you've found a solution without using them^^. |
Related issue: Fixes #26184
Description
This PR fix the redundancy in the attributes and index set state.