MeshTextureLayer passes an uninitialized `color` to `DECKGL_FILTER_COLOR`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- computer-graphics
Research direction
Start at packages/deck.gl-raster/src/mesh-layer/mesh-layer-fragment.glsl.ts around lines 29-31, where vec4 color is declared uninitialized and passed to DECKGL_FILTER_COLOR. The fix is the one-line change suggested in the issue, vec4 color = vec4(0.0);. Done means the variable is initialized before the hook and the package still builds (run the repo's TypeScript build/tests to confirm no downstream shader code assumed the old form).
Written by the indexing model from the issue text.
Description
[!NOTE]
This issue was written by Claude (Claude Code) on behalf of @kylebarron, not by @kylebarron.
MeshTextureLayer's fragment shader declares color without a value and passes it straight into DECKGL_FILTER_COLOR:
In GLSL, reading an uninitialized variable is undefined behavior, so the driver may return any value.
This causes no visible bug today, because the first module in every built-in pipeline overwrites color without reading it (CreateTexture when image is set, CompositeBands in MultiCOGLayer). But nothing enforces that:
MeshTextureLayerPropsallowsrenderPipeline: []with noimage, which renders the uninitialized value.- A custom pipeline whose first module reads
colorbefore writing it (for exampleLinearRescaleplaced first) would work on whatever value happens to be there.
Fix
Initialize it to transparent:
vec4 color = vec4(0.0);
Found while reviewing #675, which combined this fix with re-declaring SimpleMeshLayer's sampler binding. This fix doesn't need that change.
🤖 Written by Claude Code on behalf of @kylebarron
- Dominant language
- TypeScript
- Stars
- 231
- Forks
- 33
- Avg merge
- 9h 29m
- Merged PRs (30d)
- 25
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/deck.gl-raster
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/deck.gl-raster#693 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
developmentseed/deck.gl-raster#674 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
developmentseed/deck.gl-raster#589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
developmentseed/deck.gl-raster#568 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
developmentseed/deck.gl-raster#697 ·
Maintainers usually reply within 1 day
All issues in developmentseed/deck.gl-raster
Similar issues
-
bug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/data-liberation-agent#685 ·
Maintainers usually reply within 1 day
-
Business
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
txn2/mcp-data-platform#2063 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Crosstalk-Solutions/project-nomad#1427 ·
Maintainers usually reply within 2 days