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

chore: Remove WebGL dependencies from data-filter-extension #9181

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions modules/extensions/src/data-filter/data-filter-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,27 +316,30 @@ export default class DataFilterExtension extends LayerExtension<
} = this.getAttributeManager()!;
filterModel.setVertexCount(this.getNumInstances());

this.context.device.clearWebGL({framebuffer: filterFBO, color: [0, 0, 0, 0]});

filterModel.updateModuleSettings(params.moduleParameters);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@felixpalmer Not sure how to deal with the moduleParameters they are completely untyped, not sure if they have the right structure for shaderInputs.setProps()

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you review #9158 ? I believe I've handled it there

// @ts-expect-error filterValue and filterIndices should always have buffer value
filterModel.setAttributes({
...filterValues?.getValue(),
...filterCategoryValues?.getValue(),
...filterIndices?.getValue()
});
filterModel.shaderInputs.setProps({dataFilter: dataFilterProps});
filterModel.device.withParametersWebGL(
{
framebuffer: filterFBO,
// ts-ignore 'readonly' cannot be assigned to the mutable type '[GLBlendEquation, GLBlendEquation]'
...(aggregator.parameters as any),
viewport: [0, 0, filterFBO.width, filterFBO.height]
},
() => {
filterModel.draw(this.context.renderPass);
filterModel.shaderInputs.setProps({dataFilter: dataFilterProps, ...params.moduleParameters});
filterModel.setParameters({
blend: true,
blendColorOperation: 'add',
blendAlphaOperation: 'add',
blendColorSrcFactor: 'one',
blendColorDstFactor: 'one',
blendAlphaSrcFactor: 'one',
blendAlphaDstFactor: 'one'
});
const renderPass = this.context.device.beginRenderPass({
framebuffer: filterFBO,
clearColor: [0, 0, 0, 0],
parameters: {
viewport: [0, 0, filterFBO.width, filterFBO.height],
}
);
})
filterModel.draw(this.context.renderPass);
const color = filterModel.device.readPixelsToArrayWebGL(filterFBO);
let count = 0;
for (let i = 0; i < color.length; i++) {
Expand Down
Loading