Skip to content

Commit

Permalink
Cache hillshade textures based on texture size, not tile size.
Browse files Browse the repository at this point in the history
Fixes #7690 -- hillshade layers leak GPU memory.
  • Loading branch information
ChrisLoer committed Dec 12, 2018
1 parent 64ebdda commit 1bcd8dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/draw_hillshade.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function prepareHillshade(painter, tile, layer, sourceMaxZoom, depthMode, stenci
// tiles will appear blank, because as you can see above the alpha value for these textures
// is always 0
context.pixelStoreUnpackPremultiplyAlpha.set(false);
tile.demTexture = tile.demTexture || painter.getTileTexture(tile.tileSize);
tile.demTexture = tile.demTexture || painter.getTileTexture(tile.dem.stride);
if (tile.demTexture) {
const demTexture = tile.demTexture;
demTexture.update(pixelData, { premultiply: false });
Expand Down

0 comments on commit 1bcd8dd

Please sign in to comment.