Skip to content

[Bug] IconLayer: Texture corruption caused by premature generateMipmapsWebGL() calls in v9.2 #9841

@Sixeight

Description

@Sixeight

Description

In v9.2, due to luma.gl Texture API changes, generateMipmapsWebGL() must be called manually (previously automatic via mipmaps: true property).

icon-manager.ts was updated to call generateMipmapsWebGL(), but it's called at inappropriate timings - specifically before texture data is fully written, leading to texture corruption:

Flavors

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

Expected Behavior

Mipmap generation is performed only when a texture exists.

Steps to Reproduce

  1. Create an IconLayer with auto-packing enabled (default)
  2. Use many icons with dynamic updates
  3. Use different icon types/colors (forces texture atlas resize)
  4. Icons disappear (especially on low-performance GPU environments)

Minimal Reproduction Script

Run this script in browser console after loading your deck.gl app:

// Delay mipmap generation to force the bug
(function() {
  const canvas = document.querySelector('canvas');
  const gl = canvas.getContext('webgl2') || canvas.getContext('webgl');

  const originalGenerateMipmap = gl.generateMipmap.bind(gl);

  gl.generateMipmap = function(target) {
    const delay = 50 + Math.random() * 100; // 50-150ms delay
    setTimeout(() => {
      originalGenerateMipmap(target);
    }, delay);
  };

  console.log('Mipmap delay enabled - icons should disappear soon');
})();

Environment

  • Framework version: v9.2.2
  • Browser: Chrome
  • OS: macOS

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions