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: extract common draw call logic from backends #29358

Merged
merged 2 commits into from
Sep 8, 2024

Conversation

aardgoose
Copy link
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.

src/renderers/common/RenderObject.js Fixed Show resolved Hide resolved
Copy link

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
12 checks passed
@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.

2 participants