Fix add WebGPU renderer support in PerfHeadless#71
Open
YusefNsar wants to merge 1 commit intoutsuboco:mainfrom
Open
Fix add WebGPU renderer support in PerfHeadless#71YusefNsar wants to merge 1 commit intoutsuboco:mainfrom
YusefNsar wants to merge 1 commit intoutsuboco:mainfrom
Conversation
Author
|
This is a fix for issue #63 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds compatibility with Three.js
WebGPURendererinPerfHeadless, while keeping full backward compatibility withWebGLRenderer.Detection
WebGPURenderer.getContext()exists but returnsnull(unlikeWebGLRendererwhich returns aWebGL2RenderingContext). Detection is done by checking the return value and the presence ofgetExtension/getParameteron it:Changes
GPU timing:
EXT_disjoint_timer_query_webgl2is WebGL-only. When WebGPU is detected,glis not passed toGLPerf(skipping the WebGL timer query path). Instead,info.render.timestamp(written by WebGPU's built-in timestamp queries) is used as the GPU time value vialogger.gpu || glRender.timestamp.Timestamp resolution: After each frame on WebGPU,
resolveTimestampsAsync('render')is called so thatinfo.render.timestampis populated before the nextparamLoggerinvocation.Renderer info:
WEBGL_debug_renderer_infoandctx.getParameterare WebGL-only. On WebGPU, theinfosblock falls back to static'WebGPU'strings.GPUAdapter.requestAdapterInfo()would provide real values but is async — left as a TODO.Draw call stats (
calls,triangles,points,lines):gl.info.renderis available on both renderers with the same field names, so these work unchanged.What still doesn't work on WebGPU
deepAnalyze/ program list panel: relies ongl.info.programswhich is WebGL-only and not present onWebGPURenderer.GPUAdapter.requestAdapterInfo()API.Test plan
WebGPURenderer+enableTimestamps: trueWebGLRendererdeepAnalyzegracefully shows nothing (empty program list) on WebGPU without throwing