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

DataFilterExtension category filtering uint32 attribute #9350

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

felixpalmer
Copy link
Collaborator

Closes #9153

Background

The type of the filterCategoryValues is currently float, so even though we store the bitmask in a Uint32Array, the GPU gets the values as floating point, which will lead to precision issues depending on the platform. By using unsigned integers we should get better accuracy

Change List

  • Change type of attribute to uint32
  • Update shader types to match
  • Rewrite shader logic to use integer math

@coveralls
Copy link

coveralls commented Jan 14, 2025

Coverage Status

coverage: 91.672% (+0.001%) from 91.671%
when pulling b993e07 on felix/category-filter-int
into e612264 on master.

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -115,6 +115,12 @@ const defaultOptions: Required<DataFilterExtensionOptions> = {
countItems: false
};

const CATEGORY_TYPE_FROM_SIZE = {
1: 'uint' as const,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will need another pass for WebGPU some day...

@felixpalmer felixpalmer merged commit 665f981 into master Jan 14, 2025
4 checks passed
@felixpalmer felixpalmer deleted the felix/category-filter-int branch January 14, 2025 14:46
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.

[Bug] Category Filters filtering the wrong or extra datapoints
3 participants