Skip to content

fix(aggregation-layers): init geometry.uv in Heatmap/ScreenGrid fragment shaders (#10300)#10448

Open
sergey-sotnikov wants to merge 2 commits into
visgl:masterfrom
sergey-sotnikov:patch-1
Open

fix(aggregation-layers): init geometry.uv in Heatmap/ScreenGrid fragment shaders (#10300)#10448
sergey-sotnikov wants to merge 2 commits into
visgl:masterfrom
sergey-sotnikov:patch-1

Conversation

@sergey-sotnikov

Copy link
Copy Markdown

Closes #10300

Background

HeatmapLayer and ScreenGridLayer fail to compile their fragment shaders on Chrome/Android with Adreno GPUs ("Fragment shader is not compiled", empty info log) — see #10300. Works in Firefox (non-ANGLE) and on desktop.

Root cause: weights-fs.glsl.ts and screen-grid-layer-fragment.glsl.ts call DECKGL_FILTER_COLOR(color, geometry) but never initialize the global geometry (FragmentGeometry). Every other layer fragment sets geometry.uv = ... before the hook call (see column-layer / solid-polygon-layer). Passing an uninitialized struct into a function is translated by ANGLE into code the Adreno driver's compiler silently rejects (chrome://gpu shows the dontInitializeUninitializedLocals Adreno workaround active).

Tested on Xiaomi Redmi Note 13 (Adreno 710), Chrome + Brave.

Change List

  • HeatmapLayer: init geometry.uv = vec2(0.); at the top of main() in weights-fs.glsl.ts
  • ScreenGridLayer: init geometry.uv = vec2(0.); at the top of main() in screen-grid-layer-fragment.glsl.ts

@chrisgervang

Copy link
Copy Markdown
Collaborator

Was this actually confirmed to fix the compile error on the reported Adreno device, or only inferred from the vertex-shader init pattern?

We have existing render golden-image tests covering both layers (test/render/test-cases/heatmap-layer.js, test/render/test-cases/screen-grid-layer.js), including gpuAggregation: true/false paths for ScreenGridLayer. These should catch any accidental visual regression from this change.. they still pass on my system, but I cannot test on Adreno.

Could you please run them (or an a similar test) on your Adreno device and provide screenshots of the before and after?

The big risk when accepting these device-specific changes are that they may fix this device, but may break another. The programming pattern is also not standardized across the project, so it's possible for a regression to occur and we don't have the ability to catch it.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 83.166%. remained the same — sergey-sotnikov:patch-1 into visgl:master

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.

[Bug] Compilation error in fragment shader "heatmap-layer-weights-transform-fragment-cached"

3 participants