Top Description Fields Constructors Methods
com.jogamp.opengl

public Class GLRendererQuirks

extends Object
Class Inheritance
Imports
java.util.IdentityHashMap, com.jogamp.nativewindow.AbstractGraphicsDevice, com.jogamp.opengl.GLCapabilitiesImmutable, com.jogamp.common.os.Platform, com.jogamp.opengl.egl.EGL, .EGLExt

GLRendererQuirks contains information of known bugs of various GL renderer. This information allows us to workaround them.

Using centralized quirk identifier enables us to locate code dealing w/ it and hence eases it's maintenance.

Some GL_VENDOR and GL_RENDERER strings are listed here .

Field Summary

Modifier and TypeField and Description
private int
private static final String[]
public static final int
BuggyColorRenderbuffer

Buggy FBO color renderbuffer target, i.e. driver may crash.

public static final int
DontCloseX11Display

Closing X11 displays may cause JVM crashes or X11 errors with some buggy drivers while being used in concert w/ OpenGL.

public static final int
GL4NeedsGL3Request

GL4 context needs to be requested via GL3 profile attribute

  • OSX >= 10.9.0 - kCGLOGLPVersion_GL4_Core may not produce hw-accel context. Bug 867 @ https://jogamp.org/bugzilla/.
public static final int
GLES3ViaEGLES2Config

Bug 925 - Accept an ES3 Context, if reported via GL-Version-String w/o EGLExt#EGL_OPENGL_ES3_BIT_KHR.

public static final int
GLFlushBeforeRelease

The OpenGL context needs a glFlush() before releasing it, otherwise driver may freeze:

  • OSX < 10.7.3 - NVidia Driver. Bug 533 and Bug 548 @ https://jogamp.org/bugzilla/.
public static final int
GLNonCompliant

Non compliant GL context due to a buggy implementation not suitable for use.

public static final int
GLSharedContextBuggy

Buggy shared OpenGL context support within a multithreaded use-case, not suitable for stable usage.

public static final int
GLSLBuggyDiscard

GLSL discard command leads to undefined behavior or won't get compiled if being used.

public static final int
GLSLNonCompliant

GLSL is not compliant or even not stable (crash)

  • OSX < 10.7.0 (?) - NVidia Driver. Bug 818 @ https://jogamp.org/bugzilla/.
public static final int
NeedCurrCtx4ARBCreateContext

Need current GL context when calling new ARB CreateContext function, otherwise driver crashes the VM.

public static final int
NeedCurrCtx4ARBPixFmtQueries

Need current GL context when calling new ARB pixel format query functions, otherwise driver crashes the VM.

public static final int
NeedSharedObjectSync

Need GL objects (VBO, ..) to be synchronized when utilized concurrently from multiple threads via a shared GL context, otherwise driver crashes the VM.

public static final int
NoARBCreateContext

No reliable ARB_create_context implementation, even if driver claims otherwise.

public static final int
NoDoubleBufferedBitmap

On Windows no double buffered bitmaps are guaranteed to be available.

public static final int
NoDoubleBufferedPBuffer

Crashes XServer when using double buffered PBuffer with GL_RENDERER:

  • Mesa DRI Intel(R) Sandybridge Desktop
  • Mesa DRI Intel(R) Ivybridge Mobile - 3.0 Mesa 8.0.4
  • Gallium 0.4 on AMD CYPRESS
public static final int
NoFullFBOSupport

No full FBO support, i.e. not compliant w/

  • GL_ARB_framebuffer_object
  • EXT_framebuffer_object
  • EXT_framebuffer_multisample
  • EXT_framebuffer_blit
  • EXT_packed_depth_stencil
public static final int
NoMultiSamplingBuffers

No reliable MSAA / FSAA multi sampling available, i.e. driver may crash.

public static final int
NoOffscreenBitmap

No offscreen bitmap available, currently true for JOGL's OSX implementation.

public static final int
NoPBufferWithAccum

No pbuffer supporting accumulation buffers available, even if driver claims otherwise.

public static final int
NoSetSwapInterval

Crashes application when trying to set EGL swap interval on Android 4.0.3 / Pandaboard ES / PowerVR SGX 540

public static final int
NoSetSwapIntervalPostRetarget

SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel)

public static final int
NoSurfacelessCtx

No support for ES or desktop GL >= 3.0 current context without surface, i.e. without a default framebuffer as read- and write drawables.

public static final int
SingletonEGLDisplayOnly

Bug 948 - NVIDIA 331.38 (Linux X11) EGL impl.

private static final IdentityHashMap<String, GLRendererQuirks>

Constructor Summary

AccessConstructor and Description
public
public
GLRendererQuirks(final int[]
an array of valid quirks
quirks
,
final int
offset in quirks array to start reading
offset
,
final int
number of quirks to read from offset within quirks array
len
)

Method Summary

Modifier and TypeMethod and Description
public final void
addQuirk(final int
valid quirk to be added
quirk
)

public final void
addQuirks(final int[]
an array of valid quirks to be added
quirks
,
final int
offset in quirks array to start reading
offset
,
final int
number of quirks to read from offset within quirks array
len
)

public final void
addQuirks(final GLRendererQuirks
valid GLRendererQuirks to be added
quirks
)

public static void
public static void
addStickyDeviceQuirks(final AbstractGraphicsDevice device, final int[] quirks, final int offset, final int len)

Adding given quirks of sticky AbstractGraphicsDevice's GLRendererQuirks.

public static void
public static boolean
areSameStickyDevice(final AbstractGraphicsDevice device1, final AbstractGraphicsDevice device2)

Returns true if both devices have the same AbstractGraphicsDevice#getUniqueID(), otherwise false.

public final boolean

Returns:

true if quirk exist, otherwise false
exist
(final int
the quirk to be tested
quirk
)

public static boolean
public static final int
getCount()

Return the number of known quirks.

public static GLRendererQuirks
public static void
public final StringBuilder
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static final String

Returns:

the String equivalent of this quirk
toString
(final int
the quirk to be converted to String
quirk
)

public static void
validateQuirk(final int
the quirk to be validated, i.e. whether it is out of range
quirk
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_bitmaskback to summary
private int _bitmask
_namesback to summary
private static final String[] _names
BuggyColorRenderbufferback to summary
public static final int BuggyColorRenderbuffer

Buggy FBO color renderbuffer target, i.e. driver may crash.

Appears on:

  • GL_VENDOR Brian Paul
  • GL_RENDERER Mesa X11
  • GL_VERSION 2.1 Mesa 7.2

Todo

We have to determine the exact version range, i.e. not adding the quirk with fixed driver version!

Note

Also enables NoFullFBOSupport.

Note

GLFBODrawable always uses texture attachments if set.

Quirk can also be enabled via property: jogl.fbo.force.nocolorrenderbuffer.

DontCloseX11Displayback to summary
public static final int DontCloseX11Display

Closing X11 displays may cause JVM crashes or X11 errors with some buggy drivers while being used in concert w/ OpenGL.

Some drivers may require X11 displays to be closed in the same order as they were created, some may not allow them to be closed at all while resources are being used somehow.

Drivers known exposing such bug:

  • Mesa < 8.0 _with_ X11 software renderer Mesa X11, not with GLX/DRI renderer.
  • ATI proprietary Catalyst X11 driver versions:
    • 8.78.6
    • 8.881
    • 8.911
    • 9.01.8

See Bug 515 - https://jogamp.org/bugzilla/show_bug.cgi?id=515 and jogamp.nativewindow.x11.X11Util#ATI_HAS_XCLOSEDISPLAY_BUG.

See Bug 705 - https://jogamp.org/bugzilla/show_bug.cgi?id=705

GL4NeedsGL3Requestback to summary
public static final int GL4NeedsGL3Request

GL4 context needs to be requested via GL3 profile attribute

  • OSX >= 10.9.0 - kCGLOGLPVersion_GL4_Core may not produce hw-accel context. Bug 867 @ https://jogamp.org/bugzilla/.
GLES3ViaEGLES2Configback to summary
public static final int GLES3ViaEGLES2Config

Bug 925 - Accept an ES3 Context, if reported via GL-Version-String w/o EGLExt#EGL_OPENGL_ES3_BIT_KHR.

The ES3 Context can be used via EGL#EGL_OPENGL_ES2_BIT.

The ES3 Context must be created with version attributes:

 EGL.EGL_CONTEXT_CLIENT_VERSION, 2, ..

  • Mesa/AMD >= 9.2.1
  • Some Android ES3 drivers ..
GLFlushBeforeReleaseback to summary
public static final int GLFlushBeforeRelease

The OpenGL context needs a glFlush() before releasing it, otherwise driver may freeze:

  • OSX < 10.7.3 - NVidia Driver. Bug 533 and Bug 548 @ https://jogamp.org/bugzilla/.
GLNonCompliantback to summary
public static final int GLNonCompliant

Non compliant GL context due to a buggy implementation not suitable for use.

Currently, Mesa >= 9.1.3 (may extend back as far as 9.0) OpenGL 3.1 compatibility context is not compliant. Most programs will give completely broken output (or no output at all. For now, this context is not trusted.

The above has been confirmed for the following Mesa 9.* GL_RENDERER strings:
  • Mesa .* Intel(R) Sandybridge Desktop
  • Gallium 0.4 on AMD RS880

It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought.

GLSharedContextBuggyback to summary
public static final int GLSharedContextBuggy

Buggy shared OpenGL context support within a multithreaded use-case, not suitable for stable usage.

X11 Mesa DRI Intel(R) driver >= 9.2.1 cannot handle multithreaded shared GLContext usage with non-blocking exclusive X11 display connections. References:

  • Bug 873: https://jogamp.org/bugzilla/show_bug.cgi?id=873
  • https://bugs.freedesktop.org/show_bug.cgi?id=41736#c8

However, not all multithreaded use-cases are broken, e.g. our GLMediaPlayer does work.

The above has been confirmed for the following Mesa 9.* strings:
  • GL_VENDOR Intel Open Source Technology Center
  • GL_RENDERER Mesa DRI Intel(R) Sandybridge Desktop
  • GL_RENDERER Mesa DRI Intel(R) Ivybridge Mobile
  • GL_VERSION 3.1 (Core Profile) Mesa 9.2.1

On Android 4.*, Huawei's Ascend G615 w/ Immersion.16 could not make a shared context current, which uses a pbuffer drawable:

  • Android 4.*
  • GL_VENDOR Hisilicon Technologies
  • GL_RENDERER Immersion.16
  • GL_VERSION OpenGL ES 2.0

GLSLBuggyDiscardback to summary
public static final int GLSLBuggyDiscard

GLSL discard command leads to undefined behavior or won't get compiled if being used.

Appears to have happened on Nvidia Tegra2, but seems to be fine now.
FIXME: Constrain version.

GLSLNonCompliantback to summary
public static final int GLSLNonCompliant

GLSL is not compliant or even not stable (crash)

  • OSX < 10.7.0 (?) - NVidia Driver. Bug 818 @ https://jogamp.org/bugzilla/.
NeedCurrCtx4ARBCreateContextback to summary
public static final int NeedCurrCtx4ARBCreateContext

Need current GL context when calling new ARB CreateContext function, otherwise driver crashes the VM.

Drivers known exposing such bug:

  • ATI proprietary Catalyst Windows driver on laptops with a driver version as reported in GL_VERSION:
    • null
    • < 12.102.3.0 ( amd_catalyst_13.5_mobility_beta2 )

See Bug 706 - https://jogamp.org/bugzilla/show_bug.cgi?id=706
See Bug 520 - https://jogamp.org/bugzilla/show_bug.cgi?id=520

NeedCurrCtx4ARBPixFmtQueriesback to summary
public static final int NeedCurrCtx4ARBPixFmtQueries

Need current GL context when calling new ARB pixel format query functions, otherwise driver crashes the VM.

Drivers known exposing such bug:

  • ATI proprietary Catalyst driver on Windows version ≤ XP. TODO: Validate if bug actually relates to 'old' ATI Windows drivers for old GPU's like X300 regardless of the Windows version.

See Bug 480 - https://jogamp.org/bugzilla/show_bug.cgi?id=480

NeedSharedObjectSyncback to summary
public static final int NeedSharedObjectSync

Need GL objects (VBO, ..) to be synchronized when utilized concurrently from multiple threads via a shared GL context, otherwise driver crashes the VM.

Usually synchronization should not be required, if the shared GL objects are created and immutable before concurrent usage.
However, using drivers exposing this issue always require the user to synchronize access of shared GL objects.

Synchronization can be avoided if accessing the shared GL objects exclusively via a queue or Ringbuffer, see GLMediaPlayerImpl as an example.

Appears on:

  • Platform OSX
    • detected on OSX 10.9.5 first
    • any driver
    • enabled for all OSX versions

See Bug 1088 - https://jogamp.org/bugzilla/show_bug.cgi?id=1088

NoARBCreateContextback to summary
public static final int NoARBCreateContext

No reliable ARB_create_context implementation, even if driver claims otherwise.

Some drivers wrongly claim to support ARB_create_context. However, the creation of such context fails:

  com.jogamp.opengl.GLException: AWT-EventQueue-0: WindowsWGLContex.createContextImpl ctx !ARB, profile > GL2
  requested (OpenGL >= 3.0.1). Requested: GLProfile[GL3bc/GL3bc.hw], current: 2.1 (Compat profile, FBO, hardware)
  - 2.1.8787

Appears on:

  • GL_VENDOR ATI Technologies Inc.
  • GL_RENDERER ATI Radeon 3100 Graphics
  • GL_VERSION 2.1.8787
  • Platform Windows

NoDoubleBufferedBitmapback to summary
public static final int NoDoubleBufferedBitmap

On Windows no double buffered bitmaps are guaranteed to be available.

NoDoubleBufferedPBufferback to summary
public static final int NoDoubleBufferedPBuffer

Crashes XServer when using double buffered PBuffer with GL_RENDERER:

  • Mesa DRI Intel(R) Sandybridge Desktop
  • Mesa DRI Intel(R) Ivybridge Mobile - 3.0 Mesa 8.0.4
  • Gallium 0.4 on AMD CYPRESS
For now, it is safe to disable it w/ hw-acceleration.
NoFullFBOSupportback to summary
public static final int NoFullFBOSupport

No full FBO support, i.e. not compliant w/

  • GL_ARB_framebuffer_object
  • EXT_framebuffer_object
  • EXT_framebuffer_multisample
  • EXT_framebuffer_blit
  • EXT_packed_depth_stencil
. Drivers known exposing such bug:
  • Mesa 7.12-devel on Windows with VMware SVGA3D renderer:
    • GL_VERSION: 2.1 Mesa 7.12-devel (git-d6c318e)
    • GL_RENDERER: Gallium 0.4 on SVGA3D; build: RELEASE;

Also enabled via BuggyColorRenderbuffer.

Quirk can also be enabled via property: jogl.fbo.force.min.

NoMultiSamplingBuffersback to summary
public static final int NoMultiSamplingBuffers

No reliable MSAA / FSAA multi sampling available, i.e. driver may crash.

Appears on:

  • GL_VENDOR nouveau
  • GL_RENDERER Gallium 0.4 on NV34

Todo

We have to determine the exact version range, i.e. not adding the quirk with fixed driver version!

TODO: Since we currently don't handle this quirk internally, a user may need to do the following:
final AbstractGraphicsDevice adevice = GLDrawableFactory.getDesktopFactory(); // or similar
if( GLRendererQuirks.existStickyDeviceQuirk(adevice, GLRendererQuirks.NoMultiSamplingBuffers) ) {
   // don't use MSAA
}
NoOffscreenBitmapback to summary
public static final int NoOffscreenBitmap

No offscreen bitmap available, currently true for JOGL's OSX implementation.

NoPBufferWithAccumback to summary
public static final int NoPBufferWithAccum

No pbuffer supporting accumulation buffers available, even if driver claims otherwise.

Some drivers wrongly claim to support pbuffers with accumulation buffers. However, the creation of such pbuffer fails:

  com.jogamp.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format

Appears on:

  • GL_VENDOR Intel
  • GL_RENDERER Intel Bear Lake B
  • GL_VERSION 1.4.0 - Build 8.14.10.1930
  • Platform Windows

NoSetSwapIntervalback to summary
public static final int NoSetSwapInterval

Crashes application when trying to set EGL swap interval on Android 4.0.3 / Pandaboard ES / PowerVR SGX 540

NoSetSwapIntervalPostRetargetback to summary
public static final int NoSetSwapIntervalPostRetarget

SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel)

NoSurfacelessCtxback to summary
public static final int NoSurfacelessCtx

No support for ES or desktop GL >= 3.0 current context without surface, i.e. without a default framebuffer as read- and write drawables.

See OpenGL spec 3.0, chapter 2.1 OpenGL Fundamentals, page 7 or
OpenGL ES spec 3.0.2, chapter 2.1 OpenGL Fundamentals, page 6:

It is possible to use a GL context without a default framebuffer, in which case
a framebuffer object must be used to perform all rendering. This is useful for
applications neeting to perform offscreen rendering.

The feature will be attempted at initialization and this quirk will be set if failing.

Known drivers failing the specification:

  • GNU/Linux X11 Nvidia proprietary driver
    • GL_VERSION 4.4.0 NVIDIA 340.24
    • Platform GNU/Linux X11

SingletonEGLDisplayOnlyback to summary
public static final int SingletonEGLDisplayOnly

Bug 948 - NVIDIA 331.38 (Linux X11) EGL impl. only supports _one_ EGL Device via EGL#eglGetDisplay(long).

Subsequent calls to EGL#eglGetDisplay(long) fail.

Reusing global EGL display works.

The quirk is autodetected within EGLDrawableFactory's initial default device setup!

Appears on:

  • EGL_VENDOR NVIDIA
  • EGL_VERSION 1.4
  • GL_VENDOR NVIDIA Corporation
  • GL_VERSION OpenGL ES 3.0 331.38 (probably w/ 1st NV EGL lib on x86)
  • GL_VERSION OpenGL ES 3.1 NVIDIA 355.06 (unstable)
  • Platform X11
  • CPU Family Platform.CPUFamily#X86

stickyDeviceQuirksback to summary
private static final IdentityHashMap<String, GLRendererQuirks> stickyDeviceQuirks

Constructor Detail

GLRendererQuirksback to summary
public GLRendererQuirks()
GLRendererQuirksback to summary
public GLRendererQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException
Parameters
quirks:int[]

an array of valid quirks

offset:int

offset in quirks array to start reading

len:int

number of quirks to read from offset within quirks array

Exceptions
IllegalArgumentException:
if one of the quirks is out of range

Method Detail

addQuirkback to summary
public final void addQuirk(final int quirk) throws IllegalArgumentException
Parameters
quirk:int

valid quirk to be added

Exceptions
IllegalArgumentException:
if the quirk is out of range
addQuirksback to summary
public final void addQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException
Parameters
quirks:int[]

an array of valid quirks to be added

offset:int

offset in quirks array to start reading

len:int

number of quirks to read from offset within quirks array

Exceptions
IllegalArgumentException:
if one of the quirks is out of range
addQuirksback to summary
public final void addQuirks(final GLRendererQuirks quirks)
Parameters
quirks:GLRendererQuirks

valid GLRendererQuirks to be added

addStickyDeviceQuirkback to summary
public static void addStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk) throws IllegalArgumentException

Adding given quirk of sticky AbstractGraphicsDevice's GLRendererQuirks.

Not thread safe.

See Also
getStickyDeviceQuirks(AbstractGraphicsDevice)
addStickyDeviceQuirksback to summary
public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final int[] quirks, final int offset, final int len) throws IllegalArgumentException

Adding given quirks of sticky AbstractGraphicsDevice's GLRendererQuirks.

Not thread safe.

See Also
getStickyDeviceQuirks(AbstractGraphicsDevice)
addStickyDeviceQuirksback to summary
public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks quirks) throws IllegalArgumentException

Adding given quirks of sticky AbstractGraphicsDevice's GLRendererQuirks.

Not thread safe.

See Also
getStickyDeviceQuirks(AbstractGraphicsDevice)
areSameStickyDeviceback to summary
public static boolean areSameStickyDevice(final AbstractGraphicsDevice device1, final AbstractGraphicsDevice device2)

Returns true if both devices have the same AbstractGraphicsDevice#getUniqueID(), otherwise false.

existback to summary
public final boolean exist(final int quirk) throws IllegalArgumentException
Parameters
quirk:int

the quirk to be tested

Returns:boolean

true if quirk exist, otherwise false

Exceptions
IllegalArgumentException:
if quirk is out of range
existStickyDeviceQuirkback to summary
public static boolean existStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk)

Query of sticky AbstractGraphicsDevice's GLRendererQuirks.

Not thread safe. However, use after changing the sticky quirks is safe.

See Also
getStickyDeviceQuirks(AbstractGraphicsDevice)
getCountback to summary
public static final int getCount()

Return the number of known quirks.

getStickyDeviceQuirksback to summary
public static GLRendererQuirks getStickyDeviceQuirks(final AbstractGraphicsDevice device)

Retrieval of sticky AbstractGraphicsDevice's GLRendererQuirks.

The AbstractGraphicsDevices are mapped via their AbstractGraphicsDevice#getUniqueID().

Not thread safe.

See Also
areSameStickyDevice(AbstractGraphicsDevice, AbstractGraphicsDevice)
pushStickyDeviceQuirksback to summary
public static void pushStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks dest)

Pushing the sticky AbstractGraphicsDevice's GLRendererQuirks to the given destination.

Not thread safe. However, use after changing the sticky quirks is safe.

See Also
getStickyDeviceQuirks(AbstractGraphicsDevice)
toStringback to summary
public final StringBuilder toString(StringBuilder sb)
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
toStringback to summary
public static final String toString(final int quirk) throws IllegalArgumentException
Parameters
quirk:int

the quirk to be converted to String

Returns:String

the String equivalent of this quirk

Exceptions
IllegalArgumentException:
if quirk is out of range
validateQuirkback to summary
public static void validateQuirk(final int quirk) throws IllegalArgumentException
Parameters
quirk:int

the quirk to be validated, i.e. whether it is out of range

Exceptions
IllegalArgumentException:
if quirk is out of range