| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
syncFramebuffer(..) -> syncSamplingSink(..)
- reset(..) adds a new argument, boolean resetSamplingSink, allowing to trigger a reset
on the samplink sink as well. Use cases are documented.
- made public: resetSamplingSink()
- Rename syncFramebuffer(..) -> syncSamplingSink(..) to clarify semantics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locking, resulting in a native-lock-free impl.
The X11 implementation details of NativeWindow and NEWT used the X11 implicit locking facility
XLockDisplay/XUnlockDisplay, enabled via XInitThreads().
The latter useage is complicated within an unsure environment where the initialization point of JOGL
is unknown, but XInitThreads() requires to be called once and before any other X11 calls.
The solution is simple and thorough, replace native X11 locking w/ 'application level' locking.
Following this pattern actually cleans up a pretty messy part of X11 NativeWindow and NEWT,
since the generalization of platform independent locking simplifies code.
Simply using our RecursiveLock also speeds up locking, since it doesn't require JNI calls down to X11 anymore.
It allows us to get rid of X11ToolkitLock and X11JAWTToolkitLock.
Using the RecursiveLock also allows us to remove the shortcut of explicitly createing
a NullToolkitLocked device for 'private' display connections.
All devices use proper locking as claimed in their toolkit util 'requiresToolkitLock()' in X11Util, OSXUtil, ..
Further more a bug has been fixed of X11ErrorHandler usage, i.e. we need to keep our handler alive at all times
due to async X11 messaging behavior. This allows to remove the redundant code in X11/NEWT.
The AbstractGraphicsDevice lifecycle has been fixed as well, i.e. called when closing NEWT's Display
for all driver implementations.
On the NEWT side the Display's AbstractGraphicsDevice semantics has been clarified,
i.e. it's usage for EDT and lifecycle operations.
Hence the X11 Display 2nd device for rendering operations has been moved to X11 Window
where it belongs - and the X11 Display's default device used for EDT/lifecycle-ops as it should be.
This allows running X11/NEWT properly with the default usage, where the Display instance
and hence the EDT thread is shared with many Screen and Window.
Rendering using NEWT Window is decoupled from it's shared Display lock
via it's own native X11 display.
Lock free AbstractGraphicsDevice impl. (Windows, OSX, ..) don't require any attention in this regard
since they use NullToolkitLock.
Tests:
======
This implementation has been tested manually with Mesa3d (soft, Intel), ATI and Nvidia
on X11, Windows and OSX w/o any regressions found in any unit test.
Issues on ATI:
==============
Only on ATI w/o a composite renderer the unit tests expose a driver or WM bug where XCB
claims a lack of locking. Setting env. var 'LIBXCB_ALLOW_SLOPPY_LOCK=true' is one workaround
if users refuse to enable compositing. We may investigate this issue in more detail later on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
display connections.
This is a regression of JOGL commit f2cfb6119a3663715ed2d572643949b3bef58662 to fix Bug 610.
Commit f2cfb6119a3663715ed2d572643949b3bef58662 closed all open display connections at
JVM shutdown in order of their creation.
This is required IF the driver is the proprietary ATI on X11.
X11Util.setMarkAllDisplaysUnclosable(true) is called in this case.
However, this behavior causes a SIGSEGV for other GPU driver, i.e. Nvidia :)
This fix only closes the pending display connections in their respective order
IF X11Util.getMarkAllDisplaysUnclosable() == true.
Hence the 'new' cleanup as introduced in the offending commit
is only performed on the erroneous ATI driver.
Manually tested w/ TestGearsES2AWT, see it's commandline options for details.
|
|
|
|
| |
not offscreen-layer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add GLRendererQuirks:
- Contains centralized 'tagged' workarounds for GL renderer bugs (quirks)
- Accessible via GLContext and GLDrawableFactory
- Initialized in GLContext.setAvailability*
-
Simplify GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(..) & use Quirks
- use quirks
- instead of passing booleans for each config, pass factory & device
Fix shared EGL/ES resources:
- GLProfile needs to initialize EGLDrawableFactory's shared resources before desktop,
so EGLDrawableFactory can use the fallback defaultDisplay & defaultSharedResource
for host mapped sharedResources (hack).
- If using defaultSharedResources for host mapped ones,
do not go through initialization cycles - simply map (sharedResource + context).
- EGLDrawableFactory: Use device's unique-key instead of connection only,
since the latter causes a collision (EGL-connection == X11-connection).
|
|
|
|
| |
FBOMRT: Allow test w/ only one attachment number (sure not MRT then)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
device denominated 'mutable' surfaces (dummy, offscreen, ..)
Fix follows findings of Rob Hatcherson, but instead of parsing the display connection ourself
we use the X11 macro 'DefaultScreen(display)'
See <http://tronche.com/gui/x/xlib/display/opening.html#Display>
"The screen number specified in the display_name argument is returned by the DefaultScreen() macro
(or the XDefaultScreen() function)."
Since I currently have no two-head X11 setup here, only xinerama via virtualbox,
pls test / validate.
Note: One Display connection may span multiple screens, i.e.:
display 'lala:0.1' may span from screen 1 - 3 (non xinerama mode)
Discussion:
[1] How to validate whether a screen number belongs to one display connection ?
We can query ScreenCount(display), however it is not clear what the range would be.
[2] With 1 display connection spanning multiple screens, what is/are the proper connection string[s] ?
[3] After all, it seems this ancient configuration really cannot beat a modern setup w/ XRandR
having Xinerama enabled. The latter is the default anyways.
|
|
|
|
| |
focus and receive keyboard input via AWTRobot
|
|
|
|
|
|
|
|
| |
test for OSX > 10.7.0
Shared context w/ 3 context each running in there own thread is instable here on OSX 10.7.4/NVidia,
SIGSEGV @ glDrawArrays / glBindBuffer .. any shared VBO.
Seems to run fine on 10.6.8/NVidia.
|
|
|
|
| |
JOGL initialization there seems to be a huge time lag when trying to open the Desktop folder.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NSOpenGLContext::setView(NULL || incomplete-view) ; Add missing [ctx release] in MyNSOpenGLLayer ; Misc
NSOpenGLContext::setView(NULL || incomplete-view) was called on 2 occasions:
[1] - MacOSXCGLContext native createContext
[2] - NSOpenGLLayer internals
For [1], we simply don't call setView(..) ourselfs in case view is NULL or incomplete (invisible)
For [2], we need to wrap the class 'MyNSOpenGLContext:NSOpenGLContext' and capture setView(NULL)
++
Add missing [ctx release] in MyNSOpenGLLayer, otherwise resource won't get dealloc'ed
+++
Misc:
- MacOSXCGLContext. contextRealized(true): set pbuffer -> ctx, otherwise 1st makeCurrent call will not catch it
- MacOSXOnscreenCGLContext: don't add ContextUpdater to invisible ProxySurface's (dummy window)
|
|
|
|
| |
bitmap test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLOffscreenAutoDrawable.FBO and as an OffscreenLayerSurface's drawable (OSX) - Fix Bugs 569 and 599
Summary:
=========
The new FBObject based GLFBODrawable implementation allows the seamless utilization of
FBO offscreen rendering in single buffer, double buffer and MSAA mode.
The GLFBODrawable uses a parent drawable based on a
dummy surface to allow a GLOffscreenAutoDrawable.FBO creation
or a mutable surface supporting an existing offscreen layer surface (OSX CALayer).
Offscreen GLDrawable's and GLOffscreenAutoDrawable's can be selected via the
GLCapabilities. If simply !onscreen is selected in the caps instance w/o enabling FBO, PBuffer or Bitmap,
the factory will automatically choose regarding availability:
FBO > PBuffer > Bitmap
Double buffering is supported in MSAA more (intrinsic) and explicit in non MSAA.
It is preferred when delivering resources (texture id's or framebuffer names)
to a shared GLContext.
This is demonstrated in (emulates our OSX CALayer implementation):
TestFBOOffThreadSharedContextMix2DemosES2NEWT,
TestFBOOnThreadSharedContext1DemoES2NEWT
and with the OSX JAWT OffscreenLayerSurface itself. FBO is the preferred choice.
+++
Offscreen drawables can be resized while maintaining a bound GLContext (e.g. w/ GLAutoDrawable).
Previously both, drawable and context, needed to be destroyed and recreated at offscreen resize.
Common implementation in GLDrawableHelper is used in the implementations
(NEWT's GLWindow, AWT GLCanvas, SWT GLCanvas).
+++
Tested:
=======
Manually run all unit tests on:
- Linux x86_64 NVidia/AMD/Mesa3d(ES)
- OSX x86_64 NVidia
- Windows x86_64 NVidia
- Android arm Mali-400/Tegra-2
No regressions.
Disclaimer:
===========
This feature is committed almost in one patch.
Both previous commits were introducing / fixing the capabilities behavior:
90d45928186f2be99999461cfe45f76a783cc961
9036376b7806a5fc61590bf49404eb71830de92f
I have to appologize for the huge size and impact (files and platforms) of this commit
however, I could not find a better way to inject this feature in one sane piece.
NativeWindow Details:
=====================
Complete decoupling of platform impl. detail of surfaces
implementing ProxySurface. Used to generalize dummy surfaces and EGL surfaces
on top of a native platform surface.
- ProxySurface.UpstreamSurfaceHook -> UpstreamSurfaceHook
- abstract class ProxySurface -> interface ProxySurface + ProxySurfaceImpl
- Misc. implementations
JOGL Details:
=====================
FBOObject: API Change / Simplification & Usability
- Removed reference counter to remove complexity, allow user to choose.
- Add 'dispose' flag for detachColorbuffer(..), allowing to keep attachment alive
- Fix equals operation of Attachment
- Check pre-exising GL errors
- Interface Colobuffer gets lifecycle methods
- Add static factory methods to create Attachments w/o FBObject instance
- Reset:
- Clip min size to 1
- Keep alive samplingSink, i.e. don't issue resetMSAATexture2DSink(..).
It gets called at syncFramebuffer()/use(..) later on before actual usage.
This allows the consumer to utilize the GL_FRONT buffer until (e.g.) swap.
- misc bugfixes
GLOffscreenAutoDrawable: API Change
- Reloc and interfacing
- class com.jogamp.opengl.OffscreenAutoDrawable -> javax.media.opengl.*
interfaces GLOffscreenAutoDrawable extends GLAutoDrawable
GLOffscreenAutoDrawable.FBO extends GLOffscreenAutoDrawable, GLFBODrawable
- Added general implementation and FBO specialization
- Replacing GLPBuffer (deprecated) .. usable for any offscreen GLDrawable via factory
GLAutoDrawable:
- Add 'GLDrawable getDelegatedDrawable()'
- Refine documentation of setContext(..), remove disclaimer and fixme tags
GLDrawableFactory:
- Refine API doc and it's selection mechanism for offscreen.
- Add createOffscreenDrawable(..)
- Add createOffscreenAutoDrawable(..)
- Add canCreateFBO(..)
- Mark createGLPbuffer(..) deprectated
Mark GLPBuffer deprecated
New: GLFBODrawable extends GLDrawable
GLCanvas (AWT and SWT): Add offscreen resize support w/o GLContext recreation
GLAutoDrawableBase .. GLWindow:
- Add offscreen resize support w/o GLContext recreation
- Remove double swapBuffer call
-
GLBase/GLContext:
- Add:
- boolean hasBasicFBOSupport()
- boolean hasFullFBOSupport()
- int getMaxRenderbufferSamples()
- boolean isTextureFormatBGRA8888Available()
GLContext: Fix version detection and hasGLSL()
- Version detection in setGLFunctionAvailability(..)
- Query GL_VERSION ASAP and parse it and compare w/ given major/minor
- Use parsed version if valid and lower than given _or_ given is invalid.
- Use validated version for caching (procaddr, ..), version number, etc.
- Fix hasGLSL()
Since 'isGL2ES2()' is true if 'isGL2()'
and the latter simply alows GL 1.*, we confine the result to a GL >= 2.0
on desktops. FIXME: May consider GL 1.5 w/ extensions.
- return isGL2ES2();
+ return isGLES2() ||
+ isGL3() ||
+ isGL2() && ctxMajorVersion>1 ;
GLDrawableImpl:
- Add 'associateContext(GLContext, boolean)' allowing impl.
to have a (weak) reference list of bound context.
This is was pulled up from the OSX specific drawable impl.
- swapBuffersImpl() -> swapBuffersImpl(boolean doubleBuffered)
and call it regardless of single buffering.
This is required to propagate this event to impl. properly,
i.e. FBODrawable requires a swap notification.
- Clarify 'contextMadeCurrent(..)' protocol
GLDrawableHelper:
- Add resize and recreate offscreen drawable util method
- Simplify required init/reshape calls for GLEventListener
-
GLGraphicsConfigurationUtil:
- fixWinAttribBitsAndHwAccel: Reflect sharede context hw-accel bits
- OSX has no offscreen bitmap, use pbuffer
- use proper offscreen auto selection if offscreen and no modes are set
EGL Context/Drawable/DrawableFactory: Abstract native platform code out of base classes
- Use EGLWrappedSurface w/ UpstreamSurfaceHook to handle upstream (X11, WGL, ..)
lifecycle - in case the EGL resource is hooked up on it.
Invisible dummy surfaces: All platforms
- size is now reduced to 64x64 and decoupled of actual generic mutable size
- fix device lifecycle, no more leaks
+++
OSX
====
Enable support for GLFBODrawableImpl in offscreen CALayer mode
- NSOpenGLImpl: hooks to calayer native code
- calayer code:
- allows pbuffer and texures (FBO)
- decouple size and draw calls avoiding flickering
- enable auto resize of calayer tree
MacOSXCGLContext:
- NSOpenGLImpl:
- Fix false pbuffer 'usage', validate the pointer
- If !pbuffer, copy other window mode bits of caps
-
MacOSXCGLGraphicsConfiguration:
- Only assume pbuffer if !onscreen
- Remove reference of native pixelformat pointer
Native code:
- use 'respondsToSelector:' query before calling 'new' methods
avoiding an error message where unsuported (prev. OSX versions)
- if monitor refresh-rate is queried 0, set to default 60hz
- add missing NSAutoreleasePool decoration
+++
Android / NEWT:
===============
Issue setVisible(..) w/o wait, i.e. queue on EDT,
@Android surfaceChanged() callback. Otherwise we could deadlock:
setVisible(..) -> EDT -> setVisibleImpl(..) -> 'GL-display'.
the latter may may cause havoc while Android-EDT is blocked [until it's return].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it to native type) ; OSX Caps selection ; WGL/GDI BITMAP fix
Fix window mode attribute bit FBO_BIT usage in platform dependent code (map it to native type)
All platform dependent winAttrBit mapping: 'nativeType -> winAttrBit' and 'GLCapabilities -> winAttrBits'
shall replace FBO_BIT w/ the native type of the wrapper surface, i.e. WINDOW_BIT (X11, WGL, CGL) or PBUFFER_BIT (EGL).
This condenses to changes in
- EGLGraphicsConfiguration: EGLConfigDrawableTypeBits / GLCapabilities2AttribList
- X11GLXGraphicsConfiguration: FBCfgDrawableTypeBits, XVisualInfo2GLCapabilities / GLCapabilities2AttribList
- WindowsWGLGraphicsConfiguration: AttribList2DrawableTypeBits, PFD2DrawableTypeBits / GLCapabilities2AttribList
- OSX CGL/NS requires changes in MacOSXCGLContext, i.e. fix the surface mode of
NSPixelFormat2GLCapabilities, CGLPixelFormat2GLCapabilities results.
This change is included in the upcoming commit (class is heavily edited).
OSX chooseGraphicsConfigurationStatic: Add missing 'GLGraphicsConfigurationUtil.fixGLCapabilities(..)' call
- all platform impl. require to fix the given user caps due to the new offscreen auto selection mode
WindowsWGLGraphicsConfiguration*: ARB / GDI updateGraphicsConfiguration*()
- ARB method detects early whether it's suitable for given HDC, i.e. in case of BITMAP (it's not here)
- GDI methods detect failure while choosing PFD and doesn't care of DOUBLEBUFFER in case of bitmap (fixes BITMAP usage)
Capabilities/GLCapabilities:
- Fix missing double-buffer check in GLCapabilities.equals()
- add 'copyFrom(..)' method copy all data from give caps
|
|
|
|
| |
Proper canvas size and direct events.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check for leaked display handles
GLProfile / all shutdown methods: Remove ShutdownType to remove complexity (not required)
Proper shutdown sequence:
GLProfile - GLDrawableFactory+ - GLContext - NativeWindowFactory - [X11Util, OSXUtil, ..]
GLDrawableFactory: Always keep shutdown-hook alive, required for X11Util shutdown (@ JVMShutdown only)
X11Util: Shutdown
- @ JVMShutdown only
- If GL vendor ATI: close pending X11 display connections in proper order of creation.
This finally removes the SIGV when shutting down the JVM on X11 w/ ATI driver.
EGLDisplayUtil: Add shutdown, allowing to validate whether leaked EGL display handles remain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
availability detection for EGL, WGL and OSX.
Introducing Capabilities 'bitmap' boolean, complementing the offscreen modes FBO and PBuffer.
This allows:
1 - deterministic setting of the offscreen mode
2 - utilizing auto configuration of offscreen mode, if !onscreen !FBO !PBuffer and !Bitmap
3 - adding 'availability' semantic of 'onscreen' boolean,
i.e. if onscree:=1 for a queried instance, the offscreen modes still indicate offscreen
availability - see [4]
4 - avoiding explosion of the availability list due to [3],
one Capability entry reflect on- and offscreen settings.
Add FBO availability detection for EGL, WGL and OSX.
Tested manually w/ 'TestGLCapabilities01NEWT' on X11 [NV, ATI], WGL[NV], OSX[NV].
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NewtBaseActivity onPause()/onResume(): add setVisible(..) allowing recreation and avoid usage of unavail resources
- crucial for power suspend/resume, which itself calls activity onPause()/onResume(),
this ensures resources are not used onPause().
- Animator suspend is not sufficient due to surfaceRedrawNeeded(..) hook etc ..
- iff power suspend leads to surfaceDestroyed(..), recreation is now possible due to setVisible(true) on onResume()
even though I have not observed this on Android 2.3 and 4.0.1
Tested on Android 2.3 and Android 4.0.1
|
|
|
|
| |
ScreenDriver, WindowDriver] to reduce complexity and programatic selection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'firstUIActionOnProcess' of initSingleton() method
The notion of changing the threading behavior of native initialization was deprecated for over a year.
The code still contained the bits and pieces, i.e. whether X11Util.initSingletion() is invoked
before or after optional AWT initialization.
This condition has been removed now and behavior is uniform, i.e.
X11Util.initSingletion() is invoked after optional AWT initialization.
- Removed GLProfile.initSingleton(boolean firstUIActionOnProcess), use remaining GLProfile.initSingleton()
- Removed NativeWindowFactory.isFirstUIActionOnProcess()
- Changed NativeWindowFactory.initSingleton(boolean firstUIActionOnProcess) to
NativeWindowFactory.initSingleton()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
12.04/Pandaboard(Omap4, PowerVR SGX 540) 103/108 tests passed (before freeze) of 124 total
Fix GLCanvas's JAWTWindow reference
- drawable.getNativeSurface() may not be a JAWTWindow
due to our EGL WrappedSurface. Hence store the created JAWTWindow reference locally.
Add ES2 test in TestAWT01GLn
- test EGL/ES2 w/ AWT GLCanvas
Ubuntu 12.04/Pandaboard(Omap4, PowerVR SGX 540): 103/108 tests passed (before freeze) of 124 total
- machine freezes around test 108 ..
- new passed unit test high for ES2 incl. AWT tests
|
|
|
|
|
|
| |
:= false to be consistent w/ GLDrawableFactory.createOffscreenDrawable()
TestGLDrawable01NEWT: Enhance test case to run w/ EGLDrawableFactory (ES2) besides GL2 and GLX/WGL/..-Factory
|
|
|
|
|
|
|
|
|
|
|
| |
remove GL error checking in FBObject bind/unbind.
- User GL code caused errors shall not fail impl.
- FBObject bind/unbind GL error checking is almost useless due to it's simple code,
would only catch user GL code errors, which should be ignored here.
- MultisampleDemoES2: Only enable GL_MULTISAMPLE if available, i.e. validate passed multisample flag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
offscreen drawables, reported by Mark Raynsford
New common GLAutoDrawableBase missed to close the AbstractGraphicsDevice
in case it has been created and dedicated for the passed GLDrawable.
This detailed knowledge is only known to the creator, hence it is passed
in the constructor and is being passed through all specializations.
Further more the new X11/GLX impl. of GLDrawableFactory's
'createMutableSurfaceImpl' always creates it's own private X11 display connection
to avoid locking / threading issues. Since the old implementation reused the
shared display connection which is prone to threading issues, this bug was not visible before.
Also fixed the unit test TestNEWTCloseX11DisplayBug565,
now correctly validating that no display connection is left over
after a new cycle of create/destroy of onscreen and offscreen drawables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NewtCanvasSWT allowing to parent NEWT windows natively.
SWT GLCanvas creates lazy when resource is ready
- Ensures drawable and context are created when size > zero and native visualID is valid.
The latter is platform dependent.
- Note that you cannot utilize custom GLCapabilities w/ this one,
since the configurations is already realized - use NewtCanvasSWT.
Create new NewtCanvasSWT allowing to parent NEWT windows natively:
- Similar to NewtCanvasAWT
- Allows attaching / detaching NEWT windows
NewtCanvasAWT: Public setNEWTChild(..) fixed
Added test cases for the above - tested on Linux, OSX and Windows w/ SWT
Note: As usual for OSX, add -XstartOnFirstThread
Details:
- NEWT Display has new method: 'EDTUtil setEDTUtil(EDTUtil)'
allowing to set a custom event dispatch utility.
We use this to set our SWTEDTUtil for using NEWT w/ SWT
complying w/ SWT threading constraints.
|
|
|
|
|
|
| |
cstr on SWT thread,
which seems not to be required.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLAutoDrawable multi-threading w/ proper pattern (hope so)
Considering code changes and remarks:
3ed491213f8f7f05d7b9866b50d764370d8ff5f6
1a91ec5c8b6fd9d9db7bc115569c369fe7b38e9b
3334a924309a9361a448d69bc707d4cce416b430
4f27bcecf7484dc041551f52a5c49e2884cb3867
It seems necessary to have
- recursive locking employed for all semantic actions which changes drawable & context (and the Window resource)
- to avoid deadlock, we have to ensure the locked code segment will not spawn
off to another thread, or a thread holds the lock, spawns of an action requiring the lock. .. sure
- other read-only methods (flags, ..) shall at least utilize a safe local copy of a volatile field
if further use to produce the result is necessary.
- flags like sendReshape require to be volatile to guarantee it's being processed
Patch impacts: AWT/SWT GLCanvas, GLAutoDrawableBase [and it's specializations]
and hopefully closes any loopholes of missing a cache hit, etc.
If you review this and find optimizations, i.e. removing a lock due to semantics etc,
don't hold back and discuss it, please.
|
|
|
|
| |
canvas.addControlListener(swtUpstreamHook);
|
|
|
|
|
|
| |
toggle mouse adapter :)
Moved the fullscreen toggle mouse adapter to main test class.
|
| |
|
|
|
|
|
|
|
|
|
| |
setting by setSampleBuffers(true) and setBackgroundOpaque(false)
This bug lead to X11 GLCapabilities rgba: 8/8/8/1 - which ofc is invalid. Sideeffect was a bad selected GLXFB configuration
and the GLContext couldn't be made current.
Patch sets alpha bits reflecting reality carefully after opaque/samples. Added API doc note.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- New FBObject implementation handling FBO and it's attachments *** API CHANGE: Util -> Core ***
while it's size and sample-count can be reconfigured on the fly.
- com.jogamp.opengl.util.FBObject -> com.jogamp.opengl.FBObject
- agnostic to texture unit
- separate attachments using OO hierarchy reflecting FBO
- handling MSAA and blitting
- no FBO destruction for reconfig (attach/detach)
- New GLFBODrawableImpl impl. an FBObject based GLDrawable
- Instantiated by a dummy native surface (onscreen and invisible)
hooked up to a dummy GLDrawable, which is the delegation for context creation.
- Utilizies ProxySurface.UpstreamSurfaceHook for dummy surface
avoiding specialization for native platforms.
- TODO: Allow to utilize common surface interface as a
dummy-surface to supporting API seperation of
windowing/GL. The latter allows impl. of createGLDrawable(NativeSurface)
with FBO.
- New OffscreenAutoDrawable (extends GLAutoDrawableDelegate)
for all offscreen drawables. Shall replace GLPbuffer.
- New GLCapabilities*.isFBO() / setFBO(boolean) to request FBO offscreen,
similar to isPBuffer(). Rule: if both are requested, FBO shall be favored.
- GLContext adds raw FBO availability query (min. FBO avail),
FBObject contains fine grained queries (TODO: Move parts to GLContext for efficiency).
- Add framebuffer tracking, allowing fast querying:
- GLBase/GLContext:
public int getBoundFramebuffer(int target);
public int getDefaultDrawFramebuffer();
public int getDefaultReadFramebuffer();
- GLContextImpl
public final void setBoundFramebuffer(int target, int framebufferName)
.. called by GL impl bind framebuffer
- GL: getDefaultDrawFramebuffer(), getDefaultReadFramebuffer()
Adding default framebuffer queries being issued by
GL.glBindFramebuffer(target, 0) w/ a default framebuffer, o.e. zero.
This allows a transparent use of a custom FBO even in case the applications
attempts to reset FBO to zero.
Value flow: GL <- GLContext <- GLDrawable,
- GLCapabilities handle fbo/pbuffer seperate, don't disable the other
- GLContext/GL track read/write framebuffer to be queried by FBObject
to determine whether to bind/unbind a framebuffer
- Test cases for multiple FBO w/ and w/o MSAA
Other Features:
- New interface ProxySurface.UpstreamSurfaceHook,
allowing to hook an upstream surface of unknown type
providing lifecycle and information (size, ..) callbacks.
Used for all new dummy NativeSurface impl and SWT GLCanvas.
- GLContext -> GLDrawable propagation context/drawable lifecycle
via ProxySurface.UpstreamSurfaceHook allowing dynamic resources
to react (create, init, ..)
- contextRealized()
- contextMadeCurrent()
- SurfaceChangeable -> MutableSurface
currently only contains setting the surface handle.
TODO: May need to move ProxySurface.UpstreamSurfaceHook -> MutableSurface.UpstreamSurfaceHook,
allowing other impl. classes (NEWT OffscreenWindow) to utilize the new
upstream hookup mechanism - will allow FBO/Dummy window to work.
- SWT GLCanvas using ProxySurface.UpstreamSurfaceHook for proper size
propagation.
- New GLAutoDrawable::getUpstreamWidget(), allowing GLEventListener
to fetch the owning Java side UI element (NEWT, SWT, AWT, ..).
- GLDrawableFactory: Removed createOffscreenSurface() - unused and not GL related
- EGLDrawableFactory handles device/profile avail. mapping
while actually creating context/drawable.
This allows us to learn whether the ES context is software/hardware as well as FBO avail.
- EGLDrawable: Removed secret buckets of EGL configs :)
Employ native surface (X11, WGL, ..) to EGL 'mapping' in
EGLDrawableFactory utilizing new EGLUpstreamSurfaceHook (implements ProxySurface.UpstreamSurfaceHook).
Other Bugs:
- Add CTX_OPTION_DEBUG to ctx/extension cache key since only a debug ctx
may expose the ARB debug capability.
This bug caused lack of ARB/AMD debug functionality.
- Fix GLProfile deadlock (debug mode, w/ EGL/ES, no X11),
dump availability information _after_ lock.
- ImmModeSink draw(): Use GL's glDrawElements(..), don't cast for GL2ES1.
Fixes use for GL2ES2.
- Fix KeyEvent.getKeyChar() comment (-> only stable for keyTyped(..))
Misc:
- Refined alot of API doc
- New GLExtensions holds commonly used GL extension strings,
allows better referencing and usage lookup.
- Move GL (interface) decl. to GLBase
- GLBuffers: Cleanup API doc (format, types)
- TextureIO: Add PAM and PPM static suffix identifier
- GLCapabilities getNumSamples() returns 0 if sampleBuffers is disabled, this seems to be more natural.
- finalized a lot
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GLProfile and GLContext*
GLProfile: Enhance bootsrapping performance of loading GL*Impl class
- Offthread classloading of all GL*Impl via reflection at startup
reduces startup time here around 12% (800ms down to 700ms).
GLContext*: Enhance bootsrapping performance of querying available GL profiles
- Add PROFILE_ALIASING mode, defaults to true - can be disabled w/ property 'jogl.debug.GLContext.NoProfileAliasing'
- PROFILE_ALIASING:
If true (default), bootstrapping the available GL profiles
will use the highest compatible GL context for each profile,
hence skipping querying lower profiles if a compatible higher one is found.
Linux x86_64 - Nvidia: 28%, 700ms down to 500ms
Linux x86_64 - AMD : 40%, 1500ms down to 900ms
- GL*Impl:
- make fields final: glProfile, _context, buffer*Tracker and glStateTracker
- allow null _context/glProfile in initialization (bootstrapping)
- JoglVersion.getDefaultOpenGLInfo(..)
- add arg: 'boolean withCapabilitiesInfo', allowing to suppres the list of caps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GL[Auto]Drawable/GLContext re-association (switch) incl. unit test.
- GLContext adds FBO availability to profile mapping
- GLContext added 'GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly)'
allowing to set the write GLDrawable. This method enables switching context/drawable.
Fix GL[Auto]Drawable/GLContext re-association (switch) incl. unit test
Commit eed8508ae1132e5f45f788e9cb3f3d5a1050ac70 impl. of GLAutoDrawable's setContext(..)
enabled proper setting of the GLAutoDrawable context incl. updating the context's drawables.
Test covers:
- remove/set (GLContext, GLEventListener) of GL[Auto]Drawable
- switch (GLContext, GLEventListener) of 2 GLAutoDrawables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- GLAutoDrawable (compat change - recompile):
- 'void invoke(boolean wait, GLRunnable glRunnable)' -> 'boolean invoke(boolean wait, GLRunnable glRunnable)'
Allows notifying caller whether the task has been executed or at least enqueued.
- GLAutoDrawable add 'GLEventListener removeGLEventListener(int index)'
- This allow one to remove a specific GLEventListener and reusing it (return value).
- GLDrawableImpl remove 'destroy()' to favor 'setRealized(false)'
- Using more common code of GLAutoDrawableBase, i.e. GLPbufferImpl can use defaultDestroyOp().
- Removes redundancy of methods
- GLAutoDrawableBase/Delegate
- better 'default' names to emphasize it's purpose, adding API doc
- includes more generic functionality
- defaultWindowDestroyNotify()
- defaultDestroyOp()
- TestGLAutoDrawableDelegateNEWT demonstrates a simple example w/ all window events handled.
- Fix TestParenting01cSwingAWT's threading use (gl disturbance thread)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GLWindow, ..); Add new GLAutoDrawableDelegate.
- Refine API doc
- 'void setContext(GLContext)' -> 'GLContext setContext(GLContext)'
- Add note to createContext(GLContext) override
-Use new abstract impl. GLAutoDrawableBase, used by:
- GLWindow
- GLAutoDrawableDelegate
- GLPbufferImpl
- Add new GLAutoDrawableDelegate incl. unit test
|
|
|
|
|
|
|
| |
- Gears w/ 640x480 size and proper aspect ratio frustum
- query type of drawable.getNativeSurface() instead of auto-drawable itself
- RedSquareES2 allow setting no-rotation and aspect-ratio for frustum
- TestInitConcurrentNEWT: Don't use vsync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
setSwapInterval() deadlock; Reuse JAWT instance; Cleanup
- Fixes
- OSXUtil.CreateCALayer*(..): Pass layer target size (if known).
This fixes Bug #589
- MacOSXWindowSystemInterface-pbuffer.m:
- ALL: displayLink NULL check
- setSwapInterval(..): lock only for variable setting,
could deadlock when start/stop CVDisplayLink
- JAWTWindow.destroy(): use 'surfaceLock' instead of 'synchronized'
- Cleanup / Performance
- JAWTWindow.lockSurface(): Reuse JAWT instance
- MacOSXJAWTWindow: AttachJAWTSurfaceLayer0(..) -> SetJAWTRootSurfaceLayer0(..)
Reflects semantic better.
- DEBUG
- JAWTWindow.updateBounds(..) notify of bounds change
|
|
|
|
| |
onscreen/offscreen-layer resize test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locking ; Revise threading code; Proper name for SWT unit tests.
SWT GLCanvas:
- Fix destroy()
drawable.setRealized(false); is being called within dispose() method
- Remove local concurrency hack
[MT-0] The hack: 'final GLContext ctx = getContext(); a = null != ctx ? ctx.something() : 0;'
is thread safe locally, however, w/o covering the hole use case of the caller
it makes no sense to add thread safe code here - would be only an illusion.
In case any of the methods are called outside of a locked state
extra care should be added. Maybe we shall expose locking facilities to the user.
However, since the user shall stick to the GLEventListener model while utilizing
GLAutoDrawable implementations, she is safe due to the implicit locked state.
- Removing out-of-process locking
[MT-1] Claiming the recursive lock in the dispose/display/.. methods
and _then_ issuing a complex off-thread GL task could lead to deadlock.
The GL task could involve calling GLEventListener methods, which itself
could try to manipulate the GLCanvas -> deadlock.
Similar to [MT-0] we may need to either find a proper locking mechanism
or simply ignore it and reduce functionality.
TBH .. the number of scenarious of the mentioned deadlock are very limited
and exotic.
- Revise threading code
[MT-2] Besides the other MT-* remarks, the logic whether to spawn off
the GL task and determination which thread to use is too complex and redundant.
(See isRenderThread(), runInGLThread() and runInDesignatedGLThread())
- Proper name for SWT unit tests.
Reflect the semantics.
|
| |
|
|
|
|
|
|
| |
directory instead of tempdir, so they get archived (CI/jenkins).
Multisample/TestGLReadBufferUtilTextureIOWrite01NEWT: Add offscreen test
|
|
|
|
| |
'List<? extends CapabilitiesImmutable> l'
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android implementation.
Note: Currently only w/ Android implementation.
Note: On Android there is no way to reliably be notified of the current keyboard state.
It would be best, if your code does not rely on this information
Window adds:
- setKeyboardVisible(boolean)
- isKeyboardVisible() // unreliable on Android
|