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: Add Timestamp Queries WebGL fallback support #27870

Merged

Conversation

RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Mar 5, 2024

This pull request introduces functionality to measure the execution time of programs on the GPU within the WebGL Backend by using the EXT_disjoint_timer_query_webgl2 extension.
This feature is useful for benchmarking performance disparities between the WebGPU and WebGL Backends.

As an example I updated webgpu_storage_buffer to use the trackTimestamp parameter, WebGPU is on the left and WebGL and the right:
https://raw.githack.com/renaudrohlinger/three.js/feat/utsubo/timestamp-webgl/examples/webgpu_storage_buffer.html
image

PS:
Please note that the WebGL performances appears to consistently take approximately 5 to 10 times longer than its WebGPU counterpart. Despite thorough verification to ensure accuracy in the implementation, this discrepancy persists. My hypothesis would be that the additional time consumed by WebGL may be attributed to the security validations performed with each WebGL instruction.

Related:
#27597

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger added this to the r163 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants