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

Move ScatterplotLayer & BitmapLayer to UBOs #8875

Merged
merged 33 commits into from
Jul 1, 2024
Merged

Conversation

felixpalmer
Copy link
Collaborator

@felixpalmer felixpalmer commented May 7, 2024

Follow up to #8782, trying out moving ScatterplotLayer & BitmapLayer to use UBO.

Change List

  • Add ShaderModule for binding scatterplot/bitmap uniforms
  • Update shaders
  • Set shaderInputs rather than uniforms in draw()
  • Add layerUniforms module for setting layer opacity (allows removal of setUniforms())
  • setUniforms temporarily kept to let tests pass (DataFilterExtension and others still need this), will address in follow-up PRs
  • Move MaskExtension to use UBOs
  • Types for cross-checking shader module props with layer props

@felixpalmer felixpalmer changed the title WIP: Move ScatterplotLayer to UBOs RFC: Move ScatterplotLayer to UBOs May 7, 2024
@coveralls
Copy link

coveralls commented May 7, 2024

Coverage Status

coverage: 89.216% (-0.06%) from 89.279%
when pulling 723ea05 on felix/layer-ubo
into 0cbded7 on master.

modules/layers/src/scatterplot-layer/scatterplot-layer.ts Outdated Show resolved Hide resolved
@@ -6,6 +6,11 @@ import * as FIXTURES from 'deck.gl-test/data';

const SIZE = 1;

function getUniforms(layer: Layer) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thought: Maybe should be part of the layer test utils at some point?

modules/layers/src/scatterplot-layer/scatterplot-layer.ts Outdated Show resolved Hide resolved
@@ -6,6 +6,11 @@ import * as FIXTURES from 'deck.gl-test/data';

const SIZE = 1;

function getUniforms(layer: Layer) {
// @ts-ignore
return layer.getModels()[0]._uniformStore.uniformBlocks.get('scatterplot').uniforms;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you can do model.shaderInputs.getUniformValues()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured it was better to check if the uniformStore as this is closer to the GPU

@felixpalmer felixpalmer changed the title RFC: Move ScatterplotLayer to UBOs Move ScatterplotLayer & BitmapLayer to UBOs Jul 1, 2024
@felixpalmer felixpalmer merged commit b7c2e5b into master Jul 1, 2024
4 checks passed
@felixpalmer felixpalmer deleted the felix/layer-ubo branch July 1, 2024 15:18
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.

5 participants