Bug 890

: Jogl 2.1.2 doesn't recognize GL2ES2 profile on GLES3 capable hardware
: [JogAmp] Jogl : Brice Figureau <brice.figureau>
: embedded: Sven Gothel <sgothel>
: RESOLVED FIXED    
: critical    
: ---    
: 2   
: embedded_arm   
: other   
Type: --- SCM Refs:
2dce639c479f820d1a1e701f5eddffc4b02f5e0f 4b134a3bd83e80e6a48bb0dfd893079ca457866e 3875b4d8e4dcd1b3a0a93283346bea51ecd0a2eb
Workaround: ---
Attachments: Full jogl 2.1.2 logcat on sony Xperia

Description Brice Figureau 2013-11-04 17:26:29 CET
Created attachment 535 [details]
Full jogl 2.1.2 logcat on sony Xperia

On our Sony Xperia ZL, or Google Nexus 4 (both containing hardware capable of ES3), jogl fails to initialize a GL2ES2 context and fail with:



> FATAL EXCEPTION: main
> java.lang.RuntimeException: Unable to start activity ComponentInfo{com.daysofwonder.tt.android/com.daysofwonder.tt.android.TTActivity}: javax.media.opengl.GLException: Profile GL2ES2 is not available on null, but: [GLProfile[GLES3/GLES3.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL4ES3/GLES3.hw]]
>   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2070)
>   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2095)
>   at android.app.ActivityThread.access$600(ActivityThread.java:137)
>   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
>   at android.os.Handler.dispatchMessage(Handler.java:99)
>   at android.os.Looper.loop(Looper.java:213)
>   at android.app.ActivityThread.main(ActivityThread.java:4791)
>   at java.lang.reflect.Method.invokeNative(Native Method)
>   at java.lang.reflect.Method.invoke(Method.java:511)
>   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
>   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
>   at dalvik.system.NativeStart.main(Native Method)
> Caused by: javax.media.opengl.GLException: Profile GL2ES2 is not available on null, but: [GLProfile[GLES3/GLES3.hw], GLProfile[GLES3/GLES3.hw], GLProfile[GL4ES3/GLES3.hw]]
>   at javax.media.opengl.GLProfile.get(GLProfile.java:909)
>   at javax.media.opengl.GLProfile.getGL2ES2(GLProfile.java:827)
>   at com.daysofwonder.tt.android.TTActivity.getGLProfile(TTActivity.java:450)
>   at com.daysofwonder.tt.android.TTActivity.onCreate(TTActivity.java:197)
>   at android.app.Activity.performCreate(Activity.java:5008)
>   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
>   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2034)
>   ... 11 more
Comment 1 Sven Gothel 2013-11-07 08:40:11 CET
2dce639c479f820d1a1e701f5eddffc4b02f5e0f

    - Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings
      - GLProfile: Add GL2ES2 -> ES3 mapping
      - EGLContext: Reuqest major '3' for ES3
      - EGLGLCapabilities/EGLGraphicsConfiguration: Consider EGLExt.EGL_OPENGL_ES3_BIT_KHR
    
    - Validate isGLES*() usage and definition
      - Fix BuildComposablePipeline's isGLES() code
    
      - For GLSL related queries use isGLES() instead of isGLES2(),
        which would exclude ES3
    
    - Add and use ShaderCode.createExtensionDirective(..)
      - Supporting creating GLSL extension directives while reusing strings from GLExtensions
    
    - Minor cleanup of GLContextImpl.setGLFuncAvail(..)
Comment 2 Sven Gothel 2013-11-18 15:36:00 CET
4b134a3bd83e80e6a48bb0dfd893079ca457866e
  EGLGraphicsConfiguration: Add detailed DEBUG output for failed EGL-Config Queries

3875b4d8e4dcd1b3a0a93283346bea51ecd0a2eb
  GLContextImpl's Version Validation: Only validate Integer based Version 
  if requested context or string-version is >= 3.0
    
    .. otherwise, spec doesn't require integer based version to work!