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

fix(core): support view.clear #8665

Merged
merged 1 commit into from Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 9 additions & 13 deletions modules/core/src/passes/layers-pass.ts
Expand Up @@ -203,20 +203,16 @@ export default class LayersPass extends Pass {
viewport
});

// TODO v9 - since clearing is done in renderPass construction in luma.gl v9
// we have a choice
// TODO v9 - remove WebGL specific logic
if (view && view.props.clear) {
console.warn(`${view.id}: Per view clearing not yet implemented in deck.gl v9`);

// const clearOpts = view.props.clear === true ? {color: true, depth: true} : view.props.clear;
// withGLParameters(
// device,
// {
// scissorTest: true,
// scissor: glViewport
// },
// () => clear(device, clearOpts)
// );
const clearOpts = view.props.clear === true ? {color: true, depth: true} : view.props.clear;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Worth typing props.clear to true | Parameters<clearWebGL>[0]?

this.device.withParametersWebGL(
{
scissorTest: true,
scissor: glViewport
},
() => this.device.clearWebGL(clearOpts)
);
}

// render layers in normal colors
Expand Down