Bug 759 - No Rendering Results w/ Mesa 9.2.0-devel and Gallium 0.4 on AMD RS880
Summary: No Rendering Results w/ Mesa 9.2.0-devel and Gallium 0.4 on AMD RS880
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: pc_x86_64 linux
: --- major
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-06-21 03:43 CEST by Juan Camilo Prada
Modified: 2013-07-02 18:31 CEST (History)
2 users (show)

See Also:
Type: ---
SCM Refs:
jogl a053732720628d57d38bda401053833259bf1657
Workaround: ---


Attachments
Debug trace generated by my application (8.29 KB, application/x-7z-compressed)
2013-06-21 03:43 CEST, Juan Camilo Prada
Details
GLFW program showing output on Mesa 9.1.3, AMD 3.1 context (2.13 KB, application/octet-stream)
2013-07-02 16:32 CEST, Mark Raynsford
Details
Mesa compatibility context mess (17.97 KB, image/png)
2013-07-02 18:20 CEST, Mark Raynsford
Details
Mesa core context (19.50 KB, image/png)
2013-07-02 18:20 CEST, Mark Raynsford
Details
Patch to weaken quirk for Mesa contexts (1.19 KB, patch)
2013-07-02 18:27 CEST, Mark Raynsford
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Juan Camilo Prada 2013-06-21 03:43:10 CEST
Created attachment 483 [details]
Debug trace generated by my application

Hi,

I found some issues when running my application under Linux (Fedora 19 Beta) with AMD RS880 chipset using the latest aggregated build of Jogl2.

the main issue is that i dont get to render anything on screen. Not from my rendering routines and not from any of jogl routines (like text rendering).

I also tried the demos, and even though they run, i dont get to see anything rendered in the windows.

On IRC, sgothel helped me debug my application and so I got the debug log that I am attaching to this report.

Also, when discussing the log with Sven Gothel, he recommended me to modify GLContextImpl.java

The diff of the modification is the following (sorry if this is not the best way to share it. I'm still new to git and all this patching thing)



diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index cab629c..22eb5c2 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1640,7 +1640,7 @@ public abstract class GLContextImpl extends GLContext {
             }
             quirks[i++] = quirk;
         }
-        if( glRenderer.contains("Intel(R)") && compatCtx && ( major > 3 || major == 3 && minor >= 1 ) )
+        if( ( major > 3 || major == 3 && minor >= 1 ) )
         {
             // FIXME: Apply vendor version constraints!
             final int quirk = GLRendererQuirks.GLNonCompliant;


Doing that and compiling Jogl again, allowed my application to render the textures again. 

Sven also recommended to try with:

 if( compatCtx && ( major > 3 || major == 3 && minor >= 1 ) )

But that crashed the application as soon as the GLWindow was created. (Still need to look into the exact error on that one)


Let me know if there is any other test I should run to help fix this issue.

Thanks
Comment 1 Juan Camilo Prada 2013-06-21 05:44:08 CEST
So, in order to better target the constraint the right modification should be as stated by this diff:

diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index cab629c..7d30018 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1640,7 +1640,7 @@ public abstract class GLContextImpl extends GLContext {
             }
             quirks[i++] = quirk;
         }
-        if( glRenderer.contains("Intel(R)") && compatCtx && ( major > 3 || major == 3 && minor >= 1 ) )
+        if( ((glRenderer.contains("Intel(R)") && compatCtx) || glRenderer.contains("AMD")) && ( major > 3 || major == 3 && minor >= 1 ) )
         {
             // FIXME: Apply vendor version constraints!
             final int quirk = GLRendererQuirks.GLNonCompliant;
Comment 2 Sven Gothel 2013-06-21 10:49:19 CEST
manually merged.
Comment 3 Mark Raynsford 2013-07-02 16:32:25 CEST
Created attachment 488 [details]
GLFW program showing output on Mesa 9.1.3, AMD 3.1 context
Comment 4 Mark Raynsford 2013-07-02 16:34:26 CEST
The attached amdcontext.zip program (in C using GLFW) does show output on:

renderer : Gallium 0.4 on AMD RV730
version  : 3.1 (Core Profile) Mesa 9.1.3
vendor   : X.Org

So this may be a JOGL problem, a Mesa development problem, a hardware problem...
Comment 5 Mark Raynsford 2013-07-02 18:20:08 CEST
Created attachment 489 [details]
Mesa compatibility context mess
Comment 6 Mark Raynsford 2013-07-02 18:20:37 CEST
Created attachment 490 [details]
Mesa core context
Comment 7 Mark Raynsford 2013-07-02 18:27:32 CEST
Created attachment 491 [details]
Patch to weaken quirk for Mesa contexts
Comment 8 Mark Raynsford 2013-07-02 18:29:07 CEST
Ok, I've been prodding this and it seems to be the fault of Mesa's compatibility
context.

TestGearsES2NEWT.test01_GL2ES2 gives the following output:

https://jogamp.org/bugzilla/attachment.cgi?id=489

The same code running in a core context gives:

https://jogamp.org/bugzilla/attachment.cgi?id=490

The core context looks like this:

GL:X11GLXContext [Version 3.1 (hardware) - 3.1 (Core Profile) Mesa 9.1.3 [GL 3.1.0, vendor 9.1.3 ( (Core Profile) Mesa 9.1.3)], options 0x305, this 0x734c4b73, handle 0x7ffc94003b50, jogamp.opengl.gl4.GL4bcImpl@15eda628,
   quirks: [NoDoubleBufferedPBuffer, NoSetSwapIntervalPostRetarget],
  Drawable: X11OnscreenGLXDrawable[Realized true,
  Factory   jogamp.opengl.x11.glx.X11GLXDrawableFactory@4f8a6f26,
  Handle    0x1e00002,
  Surface   jogamp.newt.driver.x11.WindowDriver[Config X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7ffcb40e4d30, owner true, ResourceToolkitLock[obj 0x9875096, isOwner false, <12bbacbd, 5f49b5e6>[count 1, qsz 0, owner <main-Animator>]]], idx 0], visualID 0x21c, fbConfigID 0xb6,
  requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL3/GL3.hw], on-scr[.]],
  chosen    GLCaps[glx vid 0x21c, fbc 0xb6: rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 24/0/0, dbl, mono  , hw, GLProfile[GL3/GL3.hw], on-scr[.]]]
, NEWT-Screen[.x11_:0.0-1-s0, idx 0, refCount 1, vsize [ 0 / 0  1440 x 900 ], X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7ffcb40c2810, owner true, ResourceToolkitLock[obj 0x60453fe9, isOwner false, <62670b5f, 5b1bbc71>[count 0, qsz 0, owner <NULL>]]], idx 0], NEWT-Display[.x11_:0.0-1, excl false, refCount 1, hasEDT true, edtRunning true, X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7ffcb40c2810, owner true, ResourceToolkitLock[obj 0x60453fe9, isOwner false, <62670b5f, 5b1bbc71>[count 0, qsz 0, owner <NULL>]]]], monitors: [Monitor[Id 0x0, 410 x 257 mm, viewport [ 0 / 0  1440 x 900 ], orig [Id 0x55, [ 1440 x 900 x 32 bpp ] @ 59.88 Hz, flags [], 0 degr], curr [Id 0x55, [ 1440 x 900 x 32 bpp ] @ 59.88 Hz, flags [], 0 degr], modeChanged false, modeCount 76]]]
, ParentWindow null
, ParentWindowHandle 0x0 (false)
, WindowHandle 0x1e00002
, SurfaceHandle 0x1e00002 (lockedExt window true, surface true)
, Pos 137/352 (auto false), size 640x480
, Visible true, focus true
, Undecorated false (false)
, AlwaysOnTop false, Fullscreen false
, WrappedSurface null
, ChildWindows 0, SurfaceUpdatedListeners num 0 [], WindowListeners num 3 [com.jogamp.newt.opengl.GLWindow$2@79f0cd71, com.jogamp.opengl.test.junit.util.QuitAdapter@303ff442, com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT$2@36bd31cd, ], MouseListeners num 2 [com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT$4@3f10a5ce, com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2$GearsMouseAdapter@5df597ba, ], KeyListeners num 3 [com.jogamp.opengl.test.junit.util.QuitAdapter@303ff442, com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT$3@26bc6487, com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2$GearsKeyAdapter@1a6beeef, ], windowLock <24139a76, 301cb7b>[count 2, qsz 0, owner <main-Animator>], surfaceLockCount 1]], direct true] , 3.1 (hardware) - 3.1 (Core Profile) Mesa 9.1.3

The following patch reduces the scope of the quirk to allow Mesa 3.1 (and
above) core contexts:

https://jogamp.org/bugzilla/attachment.cgi?id=491

I've tested this locally against Mesa 9.1.3, but not on Intel yet.
Comment 9 Mark Raynsford 2013-07-02 18:31:08 CEST
The patch is against 3a32a59045ced338b2c5098cfb1102f847420efc