deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

feat(core): Explicitly set stepMode in Attribute layout

Open Pessimistress opened this issue 1 year ago • 2 comments

Closes #8849

This proposed fix adds a stepMode attribute setting. If set to dynamic, it will be resolved to one of vertex and instance based on whether the target model is instanced. With this change I'm able to remove much redundancy from layers/extensions where the same buffer is shared between instanced and non-instanced models.

Change List

  • Remove divisor from attribute and shader attribute settings. While this is a breaking change,
    • Setting it does nothing as of v9.0
    • Moving forward, we won't be able to make it work exactly like v8, due to luma API changes
    • Most custom layers use AttributeManager.add and AttributeManager.addInstanced instead of explicitly setting divisor, so the impact will be low
  • Add stepMode to attribute settings
  • SolidPolygonLayer
  • BrushingExtension
  • DataFilterExtension
  • CollisionFilterExtension
  • FillStyleExtension
  • Unit tests
  • Documentation and upgrade guide

Pessimistress avatar Apr 30 '24 19:04 Pessimistress

Coverage Status

coverage: 89.806% (-0.02%) from 89.826% when pulling 86b688b23527686c03d3eabb78e6e956b5bdfdcf on x/instanced-attribute into fd3aa4c16d4b73e23c87ff46385bfd88c7312f3e on master.

coveralls avatar Apr 30 '24 20:04 coveralls

Happy to see the number of #ifdefs dropping in the shaders as a result

felixpalmer avatar May 02 '24 06:05 felixpalmer