This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
glBindAttribLocation(id, location, name): Error GL_INVALID_VALUE #9331
Copy link
Copy link
Closed
Milestone
Description
Platform: Android 4.3 on Nexus 4
Mapbox SDK version: master
Steps to trigger behavior
- Open SimpleMapViewActivity
- Zoom in a bit
W/mbgl ( 8747): {pboxsdk.testapp}[OpenGL]: Caching program in: /data/data/com.mapbox.mapboxsdk.testapp/cache/com.mapbox.gl.shader.fill.1e5a3a34.pbf
W/mbgl ( 8747): {pboxsdk.testapp}[OpenGL]: Caching program in: /data/data/com.mapbox.mapboxsdk.testapp/cache/com.mapbox.gl.shader.fill_outline.1e5a3a34.pbf
...
D/AndroidRuntime( 8747): Shutting down VM
W/dalvikvm( 8747): threadid=1: thread exiting with uncaught exception (group=0x4173a700)
E/AndroidRuntime( 8747): FATAL EXCEPTION: main
E/AndroidRuntime( 8747): java.lang.Error: glBindAttribLocation(id, location, name): Error GL_INVALID_VALUE at /Users/ivo/git/mapbox-gl-native/src/mbgl/gl/attribute.cpp:9
E/AndroidRuntime( 8747): at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Native Method)
E/AndroidRuntime( 8747): at com.mapbox.mapboxsdk.maps.NativeMapView.render(NativeMapView.java:176)
E/AndroidRuntime( 8747): at com.mapbox.mapboxsdk.maps.MapView.onDraw(MapView.java:420)
E/AndroidRuntime( 8747): at android.view.View.draw(View.java:13944)
E/AndroidRuntime( 8747): at android.widget.FrameLayout.draw(FrameLayout.java:467)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12838)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3057)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12775)
E/AndroidRuntime( 8747): at android.view.View.getDisplayList(View.java:12880)
E/AndroidRuntime( 8747): at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1411)
E/AndroidRuntime( 8747): at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1359)
E/AndroidRuntime( 8747): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2367)
E/AndroidRuntime( 8747): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2239)
E/AndroidRuntime( 8747): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1872)
E/AndroidRuntime( 8747): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
E/AndroidRuntime( 8747): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
E/AndroidRuntime( 8747): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
E/AndroidRuntime( 8747): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
E/AndroidRuntime( 8747): at android.view.Choreographer.doFrame(Choreographer.java:532)
E/AndroidRuntime( 8747): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
E/AndroidRuntime( 8747): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime( 8747): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 8747): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 8747): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 8747): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8747): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 8747): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 8747): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 8747): at dalvik.system.NativeStart.main(Native Method)
Activity
jfirebaugh commentedon Jun 21, 2017
According to GL specs
GL_INVALID_VALUEhere means either:indexis greater than or equal toGL_MAX_VERTEX_ATTRIBSprogramis not a value generated by OpenGL@ivovandongen Are you able to tell if either of those is the case?
ivovandongen commentedon Jun 21, 2017
It seems that we have 9 vertex attributes in this program (which is more than the 8 allowed on this device):
ivovandongen commentedon Jun 21, 2017
The shader involved is the line shader (in this case for the
admin-2-boundarieslayer)ivovandongen commentedon Jun 21, 2017
Looks like #9250 might have pushed the number of attributes over the limit.
cc @lbud
jfirebaugh commentedon Jun 22, 2017
Ah, damn. Well, now that native follows the gl-js dynamic shader strategy, we could rework the code to also avoid calling
glBindAttribLocationfor an attribute that won't be used. Then the 8 attribute limit would be hit only if you attempt to make all the properties data-driven simultaneously.Otherwise we'll have to figure out how to pack
a_widthanda_floorwidthtogether or something.lbud commentedon Jun 24, 2017
Capturing from slack + voice with @kkaefer:
We can't use
glGetActiveAttribbecause the program isn't linked yet by the time we need to bind attributes. We will therefore need to pass information about attributes (layout attributes + non-constant paint properties) intobindLocationswhen constructing the program. ⏳jfirebaugh commentedon Jun 24, 2017
You can link the program once (which will assign default locations for the attributes), use
glGetActiveAttrib, reassign locations withglBindAttribLocation, then link the program again.