-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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: Improve Infos logic #27889
WebGPURenderer: Improve Infos logic #27889
Conversation
If you think changing the way we reset the infos is too much of a breaking change I can split this part of the PR into another. I also like the However, as previously mentioned and poorly explained (apologies for that), not handling the reset logic directly within the main loop of the This is because the current Again, this change will exclusively affect the |
IMO, we should give this new design a try since in almost all cases I have seen so far the manual reset was never done by developers although it would be required for certain use cases. We want to migrate the examples to That said, we want to ensure |
@RenaudRohlinger Apparently even |
Nice! And developers not wanting to use As far as I know |
Yeah, exactly that. Do you know that with your PR we are very close to having information control based on hierarchy 🤔 Keep thinking about adding some functions to |
Damn, that sound actually awesome, now I'm interested into diving more into this. 🤓 |
I thought about use About the info structure, what do you think of unify the timestamp within the renderer and compute structure, like |
renderContextData.activeQuery = null; | ||
this.queryRunning = false; | ||
|
||
if ( renderContextData.queryQueue && renderContextData.queryQueue.length > 0 ) { |
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.
What is the difference between .gpuQueries
and .queryQueue
?
During testing I have realized that this PR might broke: https://rawcdn.githack.com/mrdoob/three.js/dev/examples/webgpu_storage_buffer.html At least it seems with previous commits in the
|
Ah thanks it's because we renamed the info logic from |
Description:
This PR enhances the analytics system by introducing support for postprocessing and by ensuring it operates based on the user's application main loop, rather than resetting at each step of the code execution. For instance, in the previous setup, a postprocessing routine that calls render() multiple times would reset the analytics data within each step, leading to incorrect information.
In order to work correctly
WebGPURenderer
requires the usage ofsetAnimationLoop
(to getthis.nodes.nodeFrame.update();
properly called), or at least the developer has to copy the logic of theAnimation
class.The reset of the draw calls and timestamps informations are now simplified and handled before the main loop gets called.
Additionally, the system for managing timestamps has been improved.
This is something I wanted to tackle for a long time in the
WebGLRenderer
but I understand it might be breaking change, so that's why I think it could be good to try it on theWebGPURenderer
.Alternative:
Info
Classthis.resetMode = 'render||loop'
total
information along to the currentInfo
system but it seems confusing to me since trying to isolate a specific function would resume to do the same in the end by commenting all other methods in an application.Demo:
https://raw.githack.com/renaudrohlinger/three.js/utsubo/fix/refactor-improve-infos/examples/webgpu_compute_particles_snow.html
Related:
#27870
#27597
This contribution is funded by Utsubo