Skip to content

WebGPURenderer: extract common draw call logic from backends#29358

Merged
sunag merged 2 commits intomrdoob:devfrom
aardgoose:draw-params
Sep 8, 2024
Merged

WebGPURenderer: extract common draw call logic from backends#29358
sunag merged 2 commits intomrdoob:devfrom
aardgoose:draw-params

Conversation

@aardgoose
Copy link
Copy Markdown
Contributor

Add a new method renderObject.getDrawParameters() to provide draw call parameters to the backend renderer.

Most of the logic is identical, apart from multidraw which has been left as-is. The separation of this from the current draw path will allow indirect drawing without duplicating this code again.

Comment thread src/renderers/common/RenderObject.js Fixed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 8, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 685.24
169.64
685.24
169.64
+0 B
+0 B
WebGPU 826.2
221.55
826.35
221.59
+147 B
+41 B
WebGPU Nodes 825.78
221.46
825.93
221.5
+147 B
+41 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 462.02
111.48
462.02
111.48
+0 B
+0 B
WebGPU 525.3
141.56
525.44
141.6
+147 B
+49 B
WebGPU Nodes 481.95
131.37
482.1
131.42
+147 B
+49 B

@sunag sunag added this to the r169 milestone Sep 8, 2024
@sunag sunag merged commit 10a7df8 into mrdoob:dev Sep 8, 2024
@aardgoose aardgoose deleted the draw-params branch September 9, 2024 11:04
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.

3 participants