diff options
author | Sven Gothel <sgothel@jausoft.com> | 2012-02-26 02:54:50 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2012-02-26 02:54:50 +0100 |
commit | cfa9d3d5185c1fa96d0c259d40e46813407d7b01 (patch) | |
tree | 968cd662e4ffbe4172a501cc15d191f190635f0d /src/jogl/classes/jogamp | |
parent | 397665ff472d83809a028e4f4a5d332294617623 (diff) |
GLContext.isCurrentContextHardwareRasterizer(): Recognize 'softpipe' (Gallium) as software rasterizer. Check for NULL and issue warnings (TRIAGE THIS).
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index b87437088..3d3c387e1 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1087,10 +1087,25 @@ public abstract class GLContextImpl extends GLContext { isHardwareRasterizer = false; } else { // On some platforms (eg. X11), a software GL impl. does not properly declare itself properly. + // FIXME: We have to evaluate whether this heuristic approach is acceptable. final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper(); - final long _glGetString = glDynLookupHelper.dynamicLookupFunction("glGetString"); - final String glRenderer = glGetStringInt(GL.GL_RENDERER, _glGetString).toLowerCase(); - isHardwareRasterizer = !glRenderer.contains("software"); + final long _glGetString = glDynLookupHelper.dynamicLookupFunction("glGetString"); + if(0 == _glGetString) { + // FIXME + System.err.println("Warning: Entry point to 'glGetString' is NULL."); + Thread.dumpStack(); + } else { + String glRenderer = glGetStringInt(GL.GL_RENDERER, _glGetString); + if(null == glRenderer) { + // FIXME + System.err.println("Warning: GL_RENDERER is NULL."); + Thread.dumpStack(); + } else { + glRenderer = glRenderer.toLowerCase(); + isHardwareRasterizer = ! ( glRenderer.contains("software") /* Mesa3D */ || + glRenderer.contains("softpipe") /* Gallium */ ); + } + } } return isHardwareRasterizer; } |