deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Icon Layer drawArraysIntacnced error on iOS

Open ghost opened this issue 8 years ago • 11 comments

Getting an error using icon layers, same error as in the icon layer example on iOS, tried on Safari 11 and 12: First warning (not sure if its related)

luma: texture: Texture(https://raw.githubusercontent.com/uber-common/deck.gl-data/master/website/../examples/icon/location-icon-atlas.png,512x640) is Non-Power-Of-Two, disabling mipmaping

And error:

WebGL: INVALID_OPERATION: drawArraysInstanced: attempt to access out of bounds arrays

screen shot 2018-10-02 at 10 26 50

ghost avatar Oct 02 '18 09:10 ghost

I have the exact same error

vitorfranca-tw avatar Oct 02 '18 21:10 vitorfranca-tw

Same here. The issue appears after upgrade to latest version (6.1.1)

j13y avatar Oct 03 '18 09:10 j13y

You were using another version and it used to work? Which one was it?

vitorfranca-tw avatar Oct 03 '18 13:10 vitorfranca-tw

@vitorfranca-tw 5.3.4, but I've recently updated from 6.0.1 (didn't notice that version has an issue – layers not appears on Safari for Desktop). However, 6.1.1 fixes issue on Safari/Desktop but causes on mobile.

j13y avatar Oct 03 '18 14:10 j13y

@jarekpelczynski can you confirm the breakage happened between v6.0 and v6.1?

Pessimistress avatar Oct 03 '18 20:10 Pessimistress

luma: texture: Texture(https://raw.githubusercontent.com/uber-common/deck.gl-data/master/website/../examples/icon/location-icon-atlas.png,512x640) is Non-Power-Of-Two, disabling mipmaping

This is because WebGL1 (since it is Safari) doesn't support mip-mapping on Non-power-of-two textures, when we detect this we disable mipmaping and fire above warning, this should not cause any errors/crashes, and is un-related here.

I was trying to reproduce this on Desktop/Safari, I ran IconLayer on 6.0.3 and 6.1.1 but I am not able to reproduce the issue.

@jarekpelczynski @jordmccordgcv , can you confirm if this is indeed a regression between 6.0.3 and 6.1.1 ?

1chandu avatar Oct 03 '18 21:10 1chandu

@Pessimistress

Ok, I was able to reproduce this by using iOS-Simulator/Safari and website iconLayer example

With 6.0-release website build : no crash 6 0 0-release-website-no-crash

With 6.1-release website build : crash 6 1 0-release-website-crash-1

With latest master branch website build crash

master-website-crash-1

Looks like related to Attribute-0 not being a Buffer but a Constant, before releasing 6.1 we fixed an issue with attribute-0 here : https://github.com/uber/luma.gl/issues/612

So one possibility is that this fix is not getting applied to iOS browser and it should be. Also another thing I noted, when running on simulator, I see it is using Apple Software Renderer instead of GPU. Not sure if this the same case running on a device.

We might need a fix in probe.gl or how we classify mobile browser for attribute-0 workaround.

1chandu avatar Oct 04 '18 01:10 1chandu

Making following change in luma.gl fixes the crash (verified using iOS simulator)

https://github.com/uber/luma.gl/blob/d5c43cffd3405a35441f4a7d8e483bff6437b2fd/modules/core/src/webgl/vertex-array-object.js#L21

change return isWebGL2(gl) || isMobile() || (getBrowser() === 'Chrome'); to return isWebGL2(gl) || (getBrowser() === 'Chrome');, i.e. disable this for mobile browsers to match the behavior with Safari desktop.

1chandu avatar Oct 04 '18 05:10 1chandu

@jarekpelczynski @jordmccordgcv @vitorfranca-tw , here is a build of deck.gl website with possible fix, can you please try this out and verify this example works. CC: @Pessimistress https://1chandu.github.io/deck.gl/#/examples/core-layers/icon-layer

1chandu avatar Oct 04 '18 15:10 1chandu

@1chandu I've monkey-patched in luma.gl in my project and it works

j13y avatar Oct 05 '18 12:10 j13y

thanks @jarekpelczynski for verifying

I just published luma.gl 6.1.1 to include this fix, please upgrade and verify. Re-open if you still see it.

1chandu avatar Oct 05 '18 17:10 1chandu