| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Threading*:
- add invoke(..) generalizing the Therading decision
GLCanvas:
- remove 'manual' Threading decision, simply call Threading.invoke(..)
- use anonymous Runnable instances
- remove drawable lock, drawable is volatile instead
GLJPanel:
- remove 'manual' Threading decision, simply call Threading.invoke(..)
- use anonymous Runnable instances
- DEBUG: Use getThreadName() prefix
GLContextImpl:
- Remove GLWorkerThread idle command on makeCurrent(),
no holding of context in worker thread while idle.
- DEBUG: Use getThreadName() prefix
X11GLXContext:
- DEBUG: Use getThreadName() prefix
TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tolerate a buggy ARB createContext impl (always failing to create a context).
Now we only reset the GLContext state and
set the context/device availability flag if ARB create context actually was successful.
Otherwise the fallback 'old' context is being used w/o having it's context state cleared
and context/device availability is set later on.
This makes the general use of ARB_create_context more stable.
+++
Minor changes:
- Non compatibility fallback: Try forward context instead.
- Limit ARB context 'seeking' to >= OpenGL 2.0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
X11/Mesa 8.0.1 offers a GL 3.0 context w/o
having the GLX_ARB_create_context extension available
(even though the func-ptr glXCreateContextAttribsARB is not null).
We assumed that if no GLContext device availability is set,
it can be only GL 2.0 or ES1/ES2.
Fix: Relaxed these (false) constrains and map the created context
reflecting using it's actual attributes.
|
|
|
|
|
|
| |
and desktop (undefined).
*GLContext.setSwapIntervalImpl: Simple return success, set state in GLContext.
|
|
|
|
|
|
|
|
|
|
| |
4.0.3, Pandaboard ES, PowerVR SGX 540 Bug
GLContextImpl: Expose GL_RENDERER for impl.
- This allows reusing the 'early' string.
EGLContext workaround Android 4.0.3, Pandaboard ES, PowerVR SGX 540 Bug
- On mentioned platform, the app crashes when eglSwapInterval() has been called.
|
|
|
|
|
|
|
|
|
| |
getWidth()/getHeight() EGL surface queries.
EGLDrawable: Remove getWidth()/getHeight() EGL surface queries.
This code is not only redunant, since the surface dimension is known in the NativeWindow surface
returned by GLDrawableImpl., but also causes an exception since the EGL surface might not be realized
at the time it's dimension is being queried.
|
|
|
|
| |
(Gallium) as software rasterizer. Check for NULL and issue warnings (TRIAGE THIS).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
since no profile was mapped.
GLDrawableFactory*:
- Initialize defaultDevice, even if impl. is not available (no GL libraries for impl.), hence
- getDefaultDevice() always returns a valid device
- getIsDeviceCompatible() only returns 'true' if device is supported _and_ drawable factory is functional
GLProfile:
- default-desktop-device becomes default-device even if the desktop-factory itself
is not functional. This is due to the fact that the subsequent EGL-factory
always handles desktop-devices (X11->EGL, GDI->EGL, etc).
|
|
|
|
| |
massive '!!!' occurence
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLProfile.get<Profile>() methods.
We need to distinguish between software and hardware accelerated OpenGL profiles
to allow choosing the proper profiles [default, GL2ES1, GL2ES2, ..]
on platforms where both, software and hardware implementations exist (GL, GLES2, ..).
Where no preference is being requested, hardware acceleration is favored:
GLProfile.getDefault()
GLProfile.getGL2ES1()
GLProfile.getGL2ES2()
Some method signatures needed to change
GLProfile:
getMaxProgrammable(AbstractGraphicsDevice device) ->
getMaxProgrammable(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
GLProfile adds: isHardwareRasterizer()
Determination whether a hardware acceleration is being used or not
is extended in GLContextImpl by querying the current context's
GL_RENDERER string. If the latter contains 'software' (case insensitive)
it is not hardware accelerated. At least this works w/ newer Mesa3D impl,
where GLX_SLOW_CONFIG is not set!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ExtensionAvailabilityCache regression / enhancement:
- Set context version (w/o string) before caching.
This is required since we query the ctx version.
Regression from 4011e70eed8c88aee0fcd051a50ab3f15bb94f68
- Remove GLContextImpl state. Only use the passed value at initialization.
- Defined initialization, due to the 'new' cache/instantiation logic
Remove redundant GLContext profile bits:
- CTX_OPTION_ANY: implicit if !CTX_OPTION_FORWARD
- CTX_IMPL_ACCEL_HARD: implicit if !CTX_IMPL_ACCEL_SOFT
Cache key (ProcAddressTable, Extensions):
- Mask out GLContext.CTX_OPTION_DEBUG | GLContext.CTX_IMPL_ES2_COMPAT,
since they don't influence the cached values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(and clean up)
- GLContext
- Expose isFunctionAvailable(), isExtensionAvailable(),
getPlatformExtensionCount(), getGLExtensionCount()
- sort methods a bit
ExtensionAvailabilityCache:
- Favor StringBuilder instead of StringBuffer (faster)
- Resuse set's
- Hold dedicated counts of extensions, platform and GL
|
|
|
|
|
|
|
|
|
| |
Bug caused using wrong extension cache and probably the wrong procAddress table.
- do not reuse local field value if not cached
- issue resetState() after each createContextARBMapVersionsAvailable(..) query
- remove cache entry for extension (copy/paste bug)
- resetState() shall clean platform extProcAddressTable in specializations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory.
This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc.
- GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice()
since both are aligned by getDefaultDevice().
- Fix GL_ARB_ES2_compatibility detection and utilize
resulting isGLES2Compatible() where possible.
This allows ES2 compatible desktop profiles to use core ES2 functionality
(glShaderBinary() .. etc) even with a GL2ES2 desktop implementation.
- EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle
it uses windowHandle if available and differs.
This allows the ANGLE impl. to work.
- Properly order of EGL/ES library lookup:
ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM
EGL: libEGL.so.1, libEGL.so, EGL
- *DynamicLookupHelper reference will be null if it's library is not complete
(all tool libs, all glue libs and a ProcAddressFunc lookup function - if named).
- Enhance GL version string (incl. ES2 compatible, hw/sw, ..)
- GLBase: Fix docs and remove redundancies
- Prepared (disabled) DesktopES2DynamicLibraryBundleInfo
to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD).
Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY),
hence it's disabled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLContext.release's setCurrent(null) exception prone.
Catch releaseImpl's glFinish() exception (DebugGL)
glGetError() after glFinish() (eg. w/ debug pipeline) produced unknown error 0x0506
on OS X (10.7.2 NV).
Make GLContext.release's setCurrent(null) exception prone
Call setCurrent(null) in finalizer block to ensure it's 'released' out of the TLS
even when an exception is being thrown.
Make MacOSX Shared Resources 'destroy' more error prone (catch exceptions)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makeCurrent()/release()/destroy() calls ; Enable context switch tracing ; GLCanvas: proper AbstractGraphicsDevice destruction
GLContext*/GLDrawableHelper: Fix consistency of recursive makeCurrent()/release()/destroy() calls
Utilizing volatile and lock.tryLock(0) for lockConsiderFailFast(),
reducing redundant synchronization and using RecursiveLock implicit sync.
GLContext 'early-out' is the case where the thread already holds the
context, ie. context is already current and the native makeCurrent is skipped.
makeCurrent()'s 'early-out' w/o incr. the recursive lock of GLContext
and it's NativeSurface could lead to asymetry in lock/unlock count
with release()/destroy() calls. The 1st release actually released the
native ctx already.
Properly utilize recursive lock/unlock in all cases and impl. 'early-out' after locking.
Following the above in GLDrawableHelper.invokeGL()'s 'early-out' case as well,
ie calling makeCurrent()/release() symmetrical.
Introduce GLDrawableHelper.disposeGL(), which issues dispose on all GLEventListeners
within a current context and issued context destruction directly.
This simplifies GLAutodrawable's destroy/dispose calls and ensures
that the above sequence of events happens atomically (lock is being hold until destruction).
Enable context switch tracing
If property 'jogl.debug.GLContext.TraceSwitch' is defined, trace context switch.
GLCanvas: proper AbstractGraphicsDevice destruction
|
|
|
|
|
|
|
|
|
|
|
| |
12 -> 7 in initialization.
Reducing the calls to resetProcAddressTable() 12 -> 7 in initialization, saves:
Linux/AMD: 600ms -> 300ms
Linux/NV: 161ms -> 112ms
OSX 10.7/NV: 522ms -> 397ms
Still some freezes on OSX 10.6.8/NV .. further analysis is going on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'dead' thread (Applets)
GLDrawableFactory:
- clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..)
- add: getSharesResourceThread()
GLProfile:
- proper locking of initSingletion(..) path:
- Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread
while creating it's the sharedResource.
This simplifies and fixes GLProfile's locking code.
- Fix and simplify initSingleton(boolean) API doc - mark it deprecated.
- Add initSingleton() for controlled initialization only, pairing w/ shutdown(..)
Remove initSingleton(boolean) calls in code and test!
+++
Fix SharedResourceRunner 'dead' thread (Applets)
In Applets, stopping an Applet makes the browser Java plugin interrupting
and killing all related threads, including our SharedResourceRunner thread.
- Validate whether the shared resource thread is alive
- Catch interruption in shared resource thread and assume it's a kill signal
- releaseSharedResource: clear devicesTried set
|
|
|
|
| |
(GLContextImpl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
createImpl(): If successful must leave context current.
makeCurrentImpl(): Is only called if context is not just created,
hence the boolean parameter 'boolean newCreatedContext' is removed.
This clearifies and actually cleans up the native makeContextCurrent/releaseContext call pairs.
MacOSXCGLContext: CGL and NS impl. of native makeContextCurrent/releaseContext uses CGL locking
to provide a thread safety. This is recommended in OS X OpenGL documentation on
[shared context] multithreaded use cases.
Post creation code, as seen in some pbuffer cases is moved to overriden createImpl() methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
use (threading)
Bug 527 describes the situation where wglShareLists() fails (throws exception)
while the shared context is in use by another thread (some Animator).
It was reported by Jerome Jouvie.
The exception happens not everytime, but at least around 20% on manual tests
I have performed on the Windows platform.
The context in question are all JOGL's GL2, which natively where bound to an OpenGL 3.0 profile.
The WGL_ARB_create_context spec says http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt:
+++
Future versions of OpenGL may only support being added to a share
group at context creation time. Specifying such a version of a
context as either the <hglrc1> or <hglrc2> arguments to
wglShareLists will fail. wglShareLists will return FALSE, and
GetLastError will return ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB.
+++
Hence the 1st patch was to remove 'wglShareLists()' usage in case
we use the new WGL_ARB_create_context context creation method.
Even though this is a desired change, and works in general, it didn't fix the issue.
It seems that the shared context, which is passed @ new context creation,
cannot be used while it is in use itself in another thread.
This conclusion leads to the actual fix, ie. locking the shared context
while creating the new context which shares it.
Manual tests using this patch could not reproduce this issue (40 attempts).
Test: TestSharedContextListNEWT2
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
AbstractGraphicsConfiguration, if delegation is used.
This change restricts the usage of AbstractGraphicsConfiguration's getNativeGraphicsConfiguration()
to NativeSurface implementations and hence reduces complexity.
NativeSurface implementations are adapted and access to it's AbstractGraphicsConfiguration
is controlled via get/set method avoiding flawed usage (read/write), since read access shall
return the delegated AbstractGraphicsConfiguration, if used.
|
|
|
|
| |
dropping GL2ES[12] lists
|
|
|
|
|
|
| |
Cleanup Warnings and OSX ContextUpdater
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lifecycle deterministic; Remove warnings
Fix shared ctx release [onMainThread]
- Releasing the shared contexts caused a freeze of about 10s from one of the shared release operations.
[NSOpenGLContext release]
- Thorough triage concluded the workaround to release the shared ctx on the main thread.
- Using enhanced GLContextShareSet, see below
Make GLContextShareSet lifecycle deterministic
- Programmatically control the lifecycle of tracked shared ctx allows us using 'hard' references.
- Features queries for isShared() and ofc unregister a share set if all are destroyed.
Remove warnings
- MacOSXWindowSystemInterface.m used 'long', where 'GLint' was requested.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which only holds the 'update' state now.
Avoid calling updater() for every makeCurrent(), but if view's frame has changed only.
This solves the pixel flickering experienced on OSX.
- GLContextImpl:update() -> drawableUpdatedNotify() w/ comments
- ContextUpdater holds context, view, old view frame and the update state.
It doesn't issue NSOpenGLContext update() by itself, but allows querying and clearing the update flag.
- MacOSXOnscreenCGLContext impl drawableUpdatedNotify()
- register via ContextUpdater, and use it if available.
|
| |
|
|
|
|
| |
creation failed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NV_swap_group support; setSwapInterval();
resetStates()
- fixes a bug where X11GLXContext impl. resetState() !!
- marked all with @Override tag
- ensured super.resetStates() is called at end (oops)
getPlatformExtensionsStringImpl()*
- fixes a bug where X11GLXContext overrides GLContext cached GLX extension string query
- marked 'final' in GLContext to avoid bugs
- using abstract 'getPlatformExtensionsStringImpl()' called by ExtensionAvailabilityCache
Add premiliry GLX/WGL NV_swap_group support
- thought it might be a solution to sync swap of 2 windows
- none of my drivers/platforms support it, event though extension is avail on Linux
Promote setSwapInterval() (1 up)
- bumped above API up to public GLContext
- those extension should not spam the GL interfaces .. hmm
|
|
|
|
|
|
|
|
|
|
| |
glGetIntegerv(GL_MAJOR_VERSION|GL_MINOR_VERSION)
Status (Using 4.2 beta driver):
- Windows NV: Created and verified
- Linux AMD: Creates even non existing ones, 4.2 (available) verification returns 0.0
- Linux NV: Created but verification fails, returns 0.0
|
|
|
|
| |
-1/0, avoid driver bug.
|
|
|
|
|
| |
Indicates whether this GL object is compatible with OpenGL ES2,
i.e. has the extension <code>GL_ARB_ES2_compatibility</code>
|
|
|
|
|
|
|
|
| |
in aliased glDebugMessageInsert.
- GLDebugMessages add synchronous status - defaults to true
- GLContext/GLDebugMessages add dumpStack() if jogl.debug.DebugGL is set
- Remove param length in aliased glDebugMessageInsert.
|
|
|
|
|
|
| |
requested context
.. this fixes the bug where [GL2ES2/GL4bc] didn't fetch GL4bc, but a GL2 old context.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If GL_ARB_debug_output is not available, but GL_AMD_debug_output exist, fallback to the latter,
offering generic aliased methods translating the delta (AMD category <-> ARB source/type).
Generic aliased methods reside in GLContext*
Enable/Disable via GLContext and GLAutoDrawable.
To enable the GLDebugOutput feature GLContext.enableGLDebugMessage(true)
or GLContext.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG)
shall be called _before_ context creation via GLContext.makeCurrent()!
In case GLAutoDrawable is being used,
GLAutoDrawable.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG)
shall be issued before context creation via GLContext.makeCurrent()!.
After context creation, the GLDebugOutput feature may be enabled or disabled
at any time using this method.
Verify both unit tests for usability.
|
|
|
|
|
|
|
|
|
| |
RecursiveLock maintains a queue of waiting Threads,
ensuring the longest waiting thread will be notified at unlock.
Delete GLContextLock.
Cleanup HashMap generics style.
|
| |
|
|
|
|
| |
and trace pipeline.
|
|
|
|
|
|
| |
- StringBuffer -> StringBuilder
- ReflectionUtil.getBaseName -> class.getSimpleName()
- cleanup imports, generics and @Override for all touched classes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
jogamp.<module> (2/2) - edit files
- com.jogamp.opengl.impl -> jogamp.opengl
- com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc
- com.jogamp.nativewindow.impl -> jogamp.nativewindow
- com.jogamp.newt.impl -> jogamp.newt
This sorts implementation details from the top level, ie skipping the public 'com',
allowing a better seperation of public classes and implementation details
and also reduces strings.
This approach of public/private seperation is also used in the OpenJDK.
|
|
jogamp.<module> (1/2) - rename task
- com.jogamp.opengl.impl -> jogamp.opengl
- com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc
- com.jogamp.nativewindow.impl -> jogamp.nativewindow
- com.jogamp.newt.impl -> jogamp.newt
This sorts implementation details from the top level, ie skipping the public 'com',
allowing a better seperation of public classes and implementation details
and also reduces strings.
This approach of public/private seperation is also used in the OpenJDK.
|