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

[Bug] changing colorRange prop of HeatmapLayer to a different size array causes it to try to use deleted texture #9219

Open
2 of 7 tasks
xinaesthete opened this issue Oct 19, 2024 · 1 comment
Labels

Comments

@xinaesthete
Copy link

xinaesthete commented Oct 19, 2024

Description

When changing colorRange prop, it works ok as long as there are the same number of elements in the old and new values. If the number of elements is different (meaning it deletes the old texture and makes a new one), then something goes wrong in setting the internal state of the corresponding colorTexture. This results in it appearing black to the user, and in the console there are WebGL errors.

Stepping through the code etc, I didn't see any obvious problems with the way the buffers were being managed. Not sure if it could be at the luma.gl layer.

I think it worked in the old version, where I guess you resize the texture rather than making a new one.

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

A heatmap with a new color-range.

Steps to Reproduce

Make a HeatmapLayer with some value in colorRange, then later use props with a differently shaped value for the same layer...

https://codepen.io/petertodd/pen/mdNwgWo - press enter to trigger the bug.

I just had a look at modifying the HeatmapLayer example codepen but it's not all that convenient for changing props. I have reproduced in a couple of different places (first spotted while using custom TriangleLayer but that is not the cause). I'll try to make a mini React-based test-case shortly.

Environment

  • Framework version: deck.gl@9.0.33
  • Browser: Chrome
  • OS: MacOS

Logs

WebGL: INVALID_OPERATION: bindTexture: attempt to use a deleted object
Screenshot 2024-10-19 at 09 44 08

@xinaesthete
Copy link
Author

xinaesthete commented Oct 19, 2024

https://codepen.io/petertodd/pen/mdNwgWo

Press "Enter" to trigger the bug. It should change to blue but instead it's black. I don't seem to see the WebGL warnings in either codepen console or devtools there - also I notice that just refers to https://unpkg.com/deck.gl@latest/dist.min.js for deck, so behaviour could change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant