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]HexagonLayer issues warnings if colorRange has "too many" elements (starting with version 9.1.x) #9511

Open
clo-vis opened this issue Mar 10, 2025 · 2 comments
Labels

Comments

@clo-vis
Copy link

clo-vis commented Mar 10, 2025

Description

If I create a HexagonLayer with a large colorRange, the following warnings are issued:

  • INVALID_VALUE: texSubImage2D: width or height out of range
  • GL_INVALID_VALUE: Desired resource size is greater than max texture size.

In addition, all hexagons become black.

These warnings were not issued with deck.gl 9.0.x.

Expected Behavior

Same behavior as in deck.gl 9.0.x, or at least a warning in the documentation of colorRange about large color ranges (and what "large" means).

Steps to Reproduce

Add

colorRange: new Array(2 ** 14 + 1).fill([186, 74, 0, 128]),

to the HexagonLayer example in the documentation.

Environment

  • Framework version: 9.1.4
  • Browser: Opera, Edge, Firefox
  • OS: Windows

Logs

  • INVALID_VALUE: texSubImage2D: width or height out of range
  • GL_INVALID_VALUE: Desired resource size is greater than max texture size.
@liuwo23
Copy link

liuwo23 commented Mar 13, 2025

Modern graphics hardware has a limit on the size of textures. If you set the color range too large, the deck.gl may try to create or use texture resources that exceed this limit during internal processing. For example, the texSubImage2D function, which is used to update a portion of the texture, fires an INVALID error if the width or height passed in exceeds the legal range of the texture If you try to create a texture with a size larger than the maximum texture size supported by your hardware, a GL error is triggered.

//Query for the maximum texture size
const gl = document.createElement('canvas').getContext('webgl'); const maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);

Set the appropriate colorrange so that the texture resources generated by the colorrange do not exceed the maximum limit

@clo-vis
Copy link
Author

clo-vis commented Mar 13, 2025

As this is "working as intended", it's an issue in the documentation of colorRange - but I cannot change the issues's label from bug to doc.

Since valid colorRanges suddenly became invalid after upgrading from 9.0 to 9.1, the Upgrade Guide could also mention this breaking 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

2 participants