Bug 1052

Summary: Wrong GLProfile mapping: GL4ES3 -> GL3, allowed are only [GL4bc, GL4 and GLES3]
Product: [JogAmp] Jogl Reporter: Xerxes Rånby <xerxes>
Component: openglAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
79ac86efa3f0b114ce456e7f2a8ef341932fd17c 278a884e459b1180a947ff24edecdef1a7fc6cb7
Workaround: ---
Attachments: GL4ES3bug.java
Runtime Version Check test.log
Runtime Debug Logs test_dbg.log

Description Xerxes Rånby 2014-08-24 23:40:31 CEST
Created attachment 624 [details]
GL4ES3bug.java

OS: Ubuntu 14.04 x64
Driver: Mesa 10.1.3
lspci -> GPU:
04:00.0 VGA compatible controller: NVIDIA Corporation G86 [GeForce 8500 GT] (rev a1)

The bug can be triggered using the GL4ES3bug.java testcase
by requesting a GL4ES3 profile.
final GLProfile glp = GLProfile.get(GLProfile.GL4ES3);

javac -cp ./jogamp-all-platforms/jar/gluegen-rt.jar:./jogamp-all-platforms/jar/jogl-all.jar:. GL4ES3bug.java
java -Djogl.debug.DebugGL -Djogl.debug.TraceGL -cp ./jogamp-all-platforms/jar/gluegen-rt.jar:./jogamp-all-platforms/jar/jogl-all.jar:. GL4ES3bug

output:
glGetString(<int> 0x1F02) = OpenGL ES 3.0 Mesa 10.1.3
...
Caught GLException: Not a GL4ES3 implementation
...
Caused by: javax.media.opengl.GLException: Not a GL4ES3 implementation
	at javax.media.opengl.TraceGL4bc.getGL4ES3(TraceGL4bc.java:143)
	at TextRendering.init(TextRendering.java:34)

The bug is _not_ triggered if the user request GLES3 instead of GL4ES3.
final GLProfile glp = GLProfile.get(GLProfile.GLES3);
Comment 1 Xerxes Rånby 2014-08-24 23:41:32 CEST
Created attachment 625 [details]
Runtime Version Check test.log

Add Runtime Version Check test.log
Comment 2 Xerxes Rånby 2014-08-24 23:42:19 CEST
Created attachment 626 [details]
Runtime Debug Logs test_dbg.log

Add Runtime Debug Logs test_dbg.log
Comment 3 Xerxes Rånby 2014-08-25 00:44:54 CEST
As seen in the runtime version check and debug log:

The Mapping of GL4ES3 using these drivers tries to use GL3.hw instead of GLES3.hw!
GL4ES3 	GLProfile[GL4ES3/GL3.hw]
Comment 4 Sven Gothel 2014-08-30 12:11:41 CEST
Your test code is incomplete, TextRendering is missing!

It would be better to demonstrate a wrong context/profile logic
with a most small test code.

Further more, it would be great if you (and everybody) could just offer
the test code via git, so I can pull it :)

However, I will try to analyze the wrong mapping ..
Comment 5 Sven Gothel 2014-08-30 12:13:20 CEST
Official unit test to test profile/context mappings:
  com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT
Comment 6 Sven Gothel 2014-09-02 02:07:35 CEST
79ac86efa3f0b114ce456e7f2a8ef341932fd17c

Test enhancements triggering issue 'Bug 1052 - OpenGL ES 3.0 Mesa 10.1.3 Caught GLException: Not a GL4ES3 implementation'
    
 - TestGLProfile01NEWT: Complete GLProfile and GL-object and GLContext validation
    
 - On OpenGL ES 3.0 Mesa 10.1.4 it produces:
    
test06GLProfileGL4ES3(com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT)
    javax.media.opengl.GLException: GL4ES3 is neither GL4bc, GL4 nor GLES3
   at com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT.validateGLProfileGL4ES3(TestGLProfile01NEWT.java:531)
   at com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT.validateOffline(TestGLProfile01NEWT.java:708)
        at com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT.test06GLProfileGL4ES3(TestGLProfile01NEWT.java:948)
    
i.e. wrong mapping of request GL4ES3 -> GL3
Comment 7 Sven Gothel 2014-09-02 02:22:02 CEST
278a884e459b1180a947ff24edecdef1a7fc6cb7
    
 - TestGLProfile01NEWT: Allow ctx.isGLES3Compatible() and hence GL4ES3 on GL3bc and GL3
    
 - GLProfile: Remove GL4ES3 mapping using GL3bc and GL3, only GL4bc, GL4 and GLES3 are allowed in static mapping.

+++

@Xerxes: Thx for finding this one.