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

RenderContexts: Introduce getForClear(). #30256

Merged
merged 1 commit into from
Jan 3, 2025
Merged

RenderContexts: Introduce getForClear(). #30256

merged 1 commit into from
Jan 3, 2025

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 3, 2025

Related issue: -

Description

A render context is normally requested for a given scene and camera (and optionally a render target). There is currently one exception for clear operations which require a render context as well. The PR introduces a dedicated method RenderContexts.getForClear() for this edge case to simplify the implementation in RenderContexts.get().


if ( _chainKeys.length === 0 ) {

_chainKeys.push( { id: 'default' } );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By not creating objects inline, we also improve performance.

Copy link

github-actions bot commented Jan 3, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.44
79.06
339.44
79.06
+0 B
+0 B
WebGPU 489.81
135.85
489.82
135.88
+8 B
+27 B
WebGPU Nodes 489.28
135.73
489.29
135.76
+8 B
+27 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.3
112.11
465.3
112.11
+0 B
+0 B
WebGPU 559.31
151.36
559.3
151.37
-10 B
+10 B
WebGPU Nodes 515.38
141.14
515.38
141.15
-10 B
+7 B

@sunag sunag added this to the r173 milestone Jan 3, 2025
@sunag sunag merged commit 99eae50 into mrdoob:dev Jan 3, 2025
12 checks passed
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