public class GLRendererQuirks extends Object
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
Modifier and Type | Field and Description |
---|---|
static int |
BuggyColorRenderbuffer
Buggy FBO color renderbuffer target,
i.e.
|
static int |
DontCloseX11Display
Closing X11 displays may cause JVM crashes or X11 errors with some buggy drivers
while being used in concert w/ OpenGL.
|
static 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.
|
static int |
GLES3ViaEGLES2Config
Bug 925 - Accept an ES3 Context, if reported via GL-Version-String w/o
EGLExt.EGL_OPENGL_ES3_BIT_KHR . |
static int |
GLFlushBeforeRelease
The OpenGL context needs a
glFlush() before releasing it, otherwise driver may freeze:
OSX < 10.7.3 - NVidia Driver. |
static int |
GLNonCompliant
Non compliant GL context due to a buggy implementation not suitable for use.
|
static int |
GLSharedContextBuggy
Buggy shared OpenGL context support within a multithreaded use-case, not suitable for stable usage.
|
static int |
GLSLBuggyDiscard
GLSL
discard command leads to undefined behavior or won't get compiled if being used. |
static int |
GLSLNonCompliant
GLSL is not compliant or even not stable (crash)
OSX < 10.7.0 (?) - NVidia Driver.
|
static int |
NeedCurrCtx4ARBCreateContext
Need current GL context when calling new ARB CreateContext function,
otherwise driver crashes the VM.
|
static int |
NeedCurrCtx4ARBPixFmtQueries
Need current GL context when calling new ARB pixel format query functions,
otherwise driver crashes the VM.
|
static 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.
|
static int |
NoARBCreateContext
No reliable ARB_create_context implementation,
even if driver claims otherwise.
|
static int |
NoDoubleBufferedBitmap
On Windows no double buffered bitmaps are guaranteed to be available.
|
static 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.
|
static int |
NoFullFBOSupport
No full FBO support, i.e.
|
static int |
NoMultiSamplingBuffers
|
static int |
NoOffscreenBitmap
No offscreen bitmap available, currently true for JOGL's OSX implementation.
|
static int |
NoPBufferWithAccum
No pbuffer supporting accumulation buffers available,
even if driver claims otherwise.
|
static int |
NoSetSwapInterval
Crashes application when trying to set EGL swap interval on Android 4.0.3 / Pandaboard ES / PowerVR SGX 540
|
static int |
NoSetSwapIntervalPostRetarget
SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel)
|
static int |
NoSurfacelessCtx
No support for ES or desktop GL >= 3.0 current context without surface,
i.e.
|
static int |
SingletonEGLDisplayOnly
Bug 948 - NVIDIA 331.38 (Linux X11) EGL impl.
|
Constructor and Description |
---|
GLRendererQuirks() |
GLRendererQuirks(int[] quirks,
int offset,
int len) |
public static final int NoDoubleBufferedPBuffer
public static final int NoDoubleBufferedBitmap
public static final int NoSetSwapInterval
public static final int NoOffscreenBitmap
public static final int NoSetSwapIntervalPostRetarget
public static final int GLSLBuggyDiscard
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.
public static final int GLNonCompliant
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:It still has to be verified whether the AMD OpenGL 3.1 core driver is compliant enought.
public static final int GLFlushBeforeRelease
glFlush()
before releasing it, otherwise driver may freeze:
public static final int DontCloseX11Display
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 X11
, not with GLX/DRI renderer.
See Bug 515 - https://jogamp.org/bugzilla/show_bug.cgi?id=515
and X11Util.ATI_HAS_XCLOSEDISPLAY_BUG
.
See Bug 705 - https://jogamp.org/bugzilla/show_bug.cgi?id=705
public static final int NeedCurrCtx4ARBPixFmtQueries
Drivers known exposing such bug:
See Bug 480 - https://jogamp.org/bugzilla/show_bug.cgi?id=480
public static final int NeedCurrCtx4ARBCreateContext
Drivers known exposing such bug:
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
public static final int NoFullFBOSupport
Also enabled via BuggyColorRenderbuffer
.
Quirk can also be enabled via property: jogl.fbo.force.min
.
public static final int GLSLNonCompliant
public static final int GL4NeedsGL3Request
public static final int GLSharedContextBuggy
X11 Mesa DRI Intel(R) driver >= 9.2.1 cannot handle multithreaded shared GLContext usage with non-blocking exclusive X11 display connections. References:
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:On Android 4.*, Huawei's Ascend G615 w/ Immersion.16 could not make a shared context current, which uses a pbuffer drawable:
public static final int GLES3ViaEGLES2Config
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, ..
public static final int SingletonEGLDisplayOnly
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:
Platform.CPUFamily#X86
public static final int NoMultiSamplingBuffers
multi
sampling
available,
i.e. driver may crash.
Appears on:
final AbstractGraphicsDevice adevice = GLDrawableFactory.getDesktopFactory(); // or similar if( GLRendererQuirks.existStickyDeviceQuirk(adevice, GLRendererQuirks.NoMultiSamplingBuffers) ) { // don't use MSAA }
public static final int BuggyColorRenderbuffer
Appears on:
Note: Also enables NoFullFBOSupport
.
Note: GLFBODrawable always uses texture attachments if set.
Quirk can also be enabled via property: jogl.fbo.force.nocolorrenderbuffer
.
public static final int NoPBufferWithAccum
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:
public static final int NeedSharedObjectSync
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:
See Bug 1088 - https://jogamp.org/bugzilla/show_bug.cgi?id=1088
public static final int NoARBCreateContext
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:
public static final int NoSurfacelessCtx
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:
public GLRendererQuirks()
public GLRendererQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException
quirks
- an array of valid quirksoffset
- offset in quirks array to start readinglen
- number of quirks to read from offset within quirks arrayIllegalArgumentException
- if one of the quirks is out of rangepublic static final int getCount()
public static GLRendererQuirks getStickyDeviceQuirks(AbstractGraphicsDevice device)
AbstractGraphicsDevice
's GLRendererQuirks
.
The AbstractGraphicsDevice
s are mapped via their AbstractGraphicsDevice.getUniqueID()
.
Not thread safe.
public static boolean areSameStickyDevice(AbstractGraphicsDevice device1, AbstractGraphicsDevice device2)
AbstractGraphicsDevice.getUniqueID()
,
otherwise false.public static void addStickyDeviceQuirk(AbstractGraphicsDevice device, int quirk) throws IllegalArgumentException
public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, int[] quirks, int offset, int len) throws IllegalArgumentException
public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks quirks) throws IllegalArgumentException
public static boolean existStickyDeviceQuirk(AbstractGraphicsDevice device, int quirk)
Query
of sticky AbstractGraphicsDevice
's GLRendererQuirks
.
Not thread safe. However, use after changing the sticky quirks is safe.
public static void pushStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks dest)
Pushing
the sticky AbstractGraphicsDevice
's GLRendererQuirks
to the given destination
.
Not thread safe. However, use after changing the sticky quirks is safe.
public final void addQuirk(int quirk) throws IllegalArgumentException
quirk
- valid quirk to be addedIllegalArgumentException
- if the quirk is out of rangepublic final void addQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException
quirks
- an array of valid quirks to be addedoffset
- offset in quirks array to start readinglen
- number of quirks to read from offset within quirks arrayIllegalArgumentException
- if one of the quirks is out of rangepublic final void addQuirks(GLRendererQuirks quirks)
quirks
- valid GLRendererQuirks to be addedpublic final boolean exist(int quirk) throws IllegalArgumentException
quirk
- the quirk to be testedIllegalArgumentException
- if quirk is out of rangepublic final StringBuilder toString(StringBuilder sb)
public static void validateQuirk(int quirk) throws IllegalArgumentException
quirk
- the quirk to be validated, i.e. whether it is out of rangeIllegalArgumentException
- if quirk is out of rangepublic static final String toString(int quirk) throws IllegalArgumentException
quirk
- the quirk to be converted to StringIllegalArgumentException
- if quirk is out of rangeCopyright 2010 JogAmp Community.