Skip to content

Conversation

@RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Jan 20, 2024

This PR add support for timestamp queries to monitor WebGPU performances. (Requires Chrome 121)

In my opinion this feature should be included OOTB in the Renderer, it will be really useful to compare WebGPU vs WebGL performances and is optional (disabled by default). I will add WebGL fallback via EXT_disjoint_timer_query_webgl2 in a second time.

The monitoring of performances can be enable with:
new WebGPURenderer( { trackTimestamp: true } );

Also improved the info system and honored all render calls to be async as they should (render() is async).
honor async render and move to renderer await functions

Live demo:
https://raw.githack.com/renaudrohlinger/three.js/timestamp-queries/examples/webgpu_compute_particles.html
Screenshot 2024-01-20 at 18 57 30

This contribution is funded by Utsubo

@sunag
Copy link
Collaborator

sunag commented Jan 20, 2024

I think we could standardize async functions like compileAsync and do the same in renderAsync() and computeAsync(), they last are just asynchronous because they need to wait for the device to initialize.

I think we can get users used to using the suffix at first even if renderAsync() returns the render() function for now, this would make it easier for us when we change.

/cc @Mugen87

@RenaudRohlinger
Copy link
Collaborator Author

Make sense.
Added the new Async syntax.

Everything is now computeAsync and renderAsync and there is now some getters that simply call the async methods. For example:

get render() {

return this.renderAsync;

}

/cc @sunag

@Mugen87 Mugen87 added this to the r161 milestone Jan 21, 2024

// utils

resolveTimeStampAsync( renderContext, type ) { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be Timestamp instead of TimeStamp for consistency? /ping @RenaudRohlinger

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! 👍

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.

5 participants