summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* FBObject/GLFBODrawable: Debug / glError detectionSven Gothel2012-10-022-12/+21
| | | | | | | - Enh. Debug output a bit - FBObject: Detect glError @ syncFramebuffer MSAA blit, throw GLException if glError to fail-fast - TODO: May add Mesa NoFBOMSAA Quirk to disable even trying it ..
* Fix commit fbe331f013608eb31ff0d8675f4e4c9881c9c48b (Bug 616 - Remove ↵Sven Gothel2012-10-022-17/+6
| | | | | | | | | XInitThreads()) X11Util/Native: Fix X11Util_initialize0() arguments were wrong and code still invoked XInitThreads() .. woops; Added missing included "jogamp_nativewindow_x11_X11Util.h" incl. it's generation via javah, which was the culprit of not detecting it at compile time. This is a fix for commit fbe331f013608eb31ff0d8675f4e4c9881c9c48b
* Relax Bug 613 workaround of commit 92398025abdabb2fdef0d78edd41e730991a6f94Sven Gothel2012-10-0220-108/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | Utilizing a GlobalToolkitLock in general to lock the display connection results in deadlock situations where locked surfaces signal other [offscreen] surfaces to render. We have to see whether we find a better solution, for now sporadic XCB assertion still happen. But it is preferrable to point to the root cause, then to jumping through hoops to complicate locking or even to deadlock. Locking: - X11GLXGraphicsConfigurationFactory add missing device locking in: - getAvailableCapabilities - chooseGraphicsConfigurationStatic - Newt/X11Window: Discard display events after window close. Relax ATI XCB/threading bug workaround: - ToolkitProperties: requiresGlobalToolkitLock() -> hasThreadingIssues() - NativeWindowFactory: Don't use GlobalToolkitLock in case of 'threadingIssues' the impact is too severe (see above) - NativeWindowFactory: Add getGlobalToolkitLockIfRequired(): To be used for small code blocks. If having 'threadingIssues' a GlobalToolkitLock is returned, otherwise NullToolkitLock. - X11GLXContext: [create/destroy]ContextARBImpl: Use 'NativeWindowFactory.getGlobalToolkitLockIfRequired()' for extra locking Misc Cleanup: - *DrawableFactory createMutableSurface: Also create new device if type is not suitable - *DrawableFactory createDummySurfaceImpl: Pass chosenCaps and use it (preserves orig. requested user caps)
* JAWTUtil ToolkitLock: Add lock counter to make lock validation recursive ↵Sven Gothel2012-09-301-2/+10
| | | | (Fix regression of commit 92398025abdabb2fdef0d78edd41e730991a6f94)
* test script: remove deleted unit testSven Gothel2012-09-301-1/+0
|
* NullToolkitLock.validateLocker(): Throw exception if locking is required ↵Sven Gothel2012-09-302-6/+4
| | | | (detecting impl. bugs)
* X11Util: Detailed closing information only in DEBUG mode, just print summarySven Gothel2012-09-301-4/+9
|
* Merge remote-tracking branch 'origin/master'Sven Gothel2012-09-301-0/+20
|\
| * Merge pull request #52 from xranby/bcm.vc.iv-autodetectSven Gothel2012-09-291-0/+20
| |\ | | | | | | _getNativeWindowingType() TYPE_BCM_VC_IV autodetection.
| | * Add braces and fix indentation to conform with jogl coding standards.Xerxes Rånby2012-09-301-2/+4
| | |
| | * ".bcm.vc.iv" is enough now -> NEWT agnostic relative package path.Xerxes Rånby2012-09-301-1/+1
| | |
| | * _getNativeWindowingType() TYPE_BCM_VC_IV autodetection.Xerxes Rånby2012-09-301-0/+18
| |/ | | | | | | Signed-off-by: Xerxes Rånby <[email protected]>
* | Bug 623: X11Util adds property ↵Sven Gothel2012-09-301-1/+6
| | | | | | | | 'nativewindow.debug.X11Util.ATI_HAS_NO_MULTITHREADING_BUG' to disable GlobalToolkitLock workaround for testing.
* | Workaround for Bug 623: Sporadic XCB assertion failures w/ ATI proprietary ↵Sven Gothel2012-09-3021-88/+496
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | driver and w/o native X11 locking The proprietary ATI X11 driver does not handle multi-threaded [GL] clients well, i.e. triggers an XCB assertion 'from time to time'. It almost seems like that the driver either: - aliases all display connections to it's connection name, i.e. server; or - utilizes a build-in display connection w/o locking, used for some reason +++ - X11Lib: Add QueryExtension(dpy, name) allowing early driver determination w/o GL - X11Util detects 'requiresGlobalToolkitLock' and 'markAllDisplaysUnclosable' via X11 extensions. In case certain ATI extensions are available, both are set to true. - X11GLXDrawableFactory: Dropped setting 'markAllDisplaysUnclosable', using X11Util's detection (see above). - New GlobalToolkitLock to satisfy certain driver restrictions (ATI's XCB multithreading bug) - NativeWindowFactory handles new property requiresGlobalToolkitLock, in which case the new GlobalToolkitLock is being used instead of ResourceToolkitLock. - JAWTUtil ToolkitLock locks GlobalToolkitLock 1st to match new 'requiresGlobalToolkitLock' property. - Document static method requirement of X11Util, GDIUtil and OSXUtil via marker interface ToolkitProperties - ToolkitLock: New method 'validateLocked()', allowing use to validate whether the device/toolkit is properly locked and hence to detect implementation bugs. See unit test class: ValidateLockListener
* Cache XineramaIsEnabled(dpy) per display-name in X11Util minimize triggering ↵Sven Gothel2012-09-292-8/+24
| | | | | | | | | | | | | | | | ATI driver bug of sporadic XCB errors and to reduce server roundtrips. Enhances commit: e4176f4e76f519b3599ad557210def3d35266e7b X11Util.XineramaIsEnabled(dpy) hash maps the Xinerama enable result to the dpy-name. Minimize triggering ATI driver bug of sporadic XCB errors: Our multithreading code somehow triggers an _XReply in XQueryExtension beside other functions, which fails the XCB assertion: ../../src/xcb_io.c:178: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed. This only appears w/ ATI driver and is probably due to a race condition in the driver (?). This change also reduces server roundtrips / querying time for the cost of 1 hash-map.
* Misc X11: Add GLX_MESA_swap_control; GLXExtensions (private); X11GLXContext ↵Sven Gothel2012-09-2910-25/+642
| | | | commented out GLX_MESA_swap_control; native test of Mesa context-retarget bug, cannot reproduce yet.
* GLContext.makeCurrent(): Clean API docSven Gothel2012-09-291-13/+17
|
* GLDrawableHelper.init(..): Avoid double reshape if subsequent display issues ↵Sven Gothel2012-09-295-7/+10
| | | | | | reshape Adding boolean sendReshape argument to be set to false, if subsequent display won't reshape.
* Adding Mesa Quirk 'NoSetSwapIntervalPostRetarget': SIGSEGV on ↵Sven Gothel2012-09-286-38/+64
| | | | | | | | | | | | setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) Analyzing 'TestGLContextDrawableSwitchNEWT' crash at setSwapInterval -> dri2SetSwapInterval after retargeting the context (new drawable association). Turns out Mesa's dri2SetSwapInterval may have a bug. +++ GLContext TRACE_SWITCH: Add drawable handle to debug/trace output.
* X11 NativeWindow: Fix Error and IOError handler, i.e. NPE checks and no JVM ↵Sven Gothel2012-09-282-39/+35
| | | | dependency (signal is async); X11Util: XSync w/ discard reusable Display when queue-in.
* Texture: Clarifiy API doc of getTextureObject(GL)Sven Gothel2012-09-281-1/+6
|
* NativeWindow/X11 + NEWT/X11: Cache 'isXineramaEnabled()' to reduce X11 ↵Sven Gothel2012-09-285-16/+22
| | | | server roundtrips.
* NEWT X11 ScreenMode: Ignore invalid rotation eventSven Gothel2012-09-283-56/+53
|
* GLXUtil: Lock X11 DeviceSven Gothel2012-09-284-49/+98
|
* FBObject: Clarify reset(..), resetSamplingSink(..) ; Rename ↵Sven Gothel2012-09-274-46/+74
| | | | | | | | | | | 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
* Fix Bug 616: X11: Remove XInitThreads() dependency while cleaning up device ↵Sven Gothel2012-09-2738-623/+701
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix Bug 621, JVM Crashes During X11 Shutdown while closing all unclosed ↵x11_xinitthreadsSven Gothel2012-09-213-25/+47
| | | | | | | | | | | | | | | | | | | | 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.
* FBObject: Small cleanup of freeColorbufferImpl(gl, i) -> ↵Sven Gothel2012-09-211-27/+26
| | | | freeAllColorbufferImpl(gl)
* MacOSXCGLContext: Fix missing initialization of 'needsSetContextPBuffer' if ↵Sven Gothel2012-09-213-7/+9
| | | | not offscreen-layer.
* MacOSXCGLDrawableFactory: Cannot use shared context to retrieve quirks since ↵Sven Gothel2012-09-212-12/+23
| | | | it's transient, store it.
* NativeWindowFactory/NEWT: Use relative sub-package names in ↵Sven Gothel2012-09-202-8/+15
| | | | | | | | | | | | | | NativeWindowFactory's TYPE_* strings, not NEWT's; NEWTFactory: Use default NEWT package name if rel. 'path'. Use relative sub-package names in NativeWindowFactory's TYPE_* strings, not NEWT's Otherwise NEWT depends solely on NativeWindowFactory strings - Default subpackages denominate a relative path, i.e. start with a dot: '.egl', '.windows', '.x11' - Custom name may be absolute, eg: 'my.company.special.drivers.chip4' NEWTFactory: Use default NEWT package name if relative 'path'. - If NativeWindowFactory type starts w/ dot (rel. path), simply prepend the default NEWT package prefix otherwise use complete package name as-is.
* Add GLRendererQuirks; Fix shared EGL/ES resources;Sven Gothel2012-09-2020-278/+625
| | | | | | | | | | | | | | | | | | | | | | | 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).
* FBO tests: Add singleBuffer cmd-line option for offscreen-layered tests; ↵Sven Gothel2012-09-203-5/+24
| | | | FBOMRT: Allow test w/ only one attachment number (sure not MRT then)
* OSX CALayer / MacOSXCGLContext: Remove pbuffer swap garbage; Split ↵Sven Gothel2012-09-203-73/+106
| | | | | | | | | | | | | | | | | | | | | pbuffer/FBO revalidation/redraw; Don't sync @ needsDisplay Simplified pbuffer replacement: Simply keep holding the pbuffer reference in native code until receiving newPBuffer @ swap. The newPBuffer will be established @draw method. This allows removing interaction at destroy pbuffer, which caused garbage and crash. Remove pbuffer swap garbage See above. Split pbuffer/FBO revalidation/redraw Don't sync @ needsDisplay - No need to sync @ repaint command setNSOpenGLLayerNeedsDisplay* since we use volatiles and all lifecycle action is done @draw -> faster
* GLFBODrawableImpl: Fix garbage @ swap, add [disabled] reset-quirk for testingSven Gothel2012-09-201-17/+48
| | | | | | | | | Fix garbage @ swap: Reset the front buffer _after_ swap. Add [disabled] reset-quirk for testing: On some OSX GPUs (old NV 7xxx only ?), reconfig/resize of FBO fails, recreate whole FBO w/ quirk enabled.
* FBObject cleanup / review: strings, simplified re-attachment, removed ↵Sven Gothel2012-09-201-169/+262
| | | | | | | | | | | | redundancy, adding quirk. Strings: Cleanup status strings; More verbose TextureAttachment toString() Simplified re-attachment: Using simple switch/case block to recreate renderbuffer instead of task list (duh!) Removed redundant calls to bind(gl) Adding quirk for re-attachment: detach all 1st, then recreate. Disabled per default.
* GLReadBufferUtil, ShaderUtil: Catch GLException (and dump if thrown), to ↵Sven Gothel2012-09-202-20/+31
| | | | increase robustness $ glReadPixels and Get NUM_SHADER_BINARY_FORMATS
* Make GLBufferStateTracker more robust: Catch GLError on Get(), causes ↵Sven Gothel2012-09-201-6/+8
| | | | INVALID_ENUM w/ pname GL_PIXEL_UNPACK_BUFFER_BINDING on GL 3.0 Mesa 8.0.4
* Fix Bug 612: glVertexAttribIPointer/glVertexAttribLPointer are ↵Sven Gothel2012-09-201-0/+4
| | | | | | | | | | BufferObjectKind (VBO) and needs a RangeCheck as well Fix glVertexAttribIPointer/glVertexAttribLPointer (Bug 612) Similar to glVertexAttribPointer: - Mark both BufferObjectKind - Add RangeCheck to both
* Fix non NIO direct GL semantics: Restrict certain GL function to ↵Sven Gothel2012-09-201-29/+36
| | | | | | | | | | | | | | | | | | | | | NIODirectOnly (again) Partially reverting commits 375ab2da54ded1f3b3d90dc21b91fc6b87c64285 45a42f7c7f7fce4e6c7eb495591c438bdf0170a2 Both commits had flaws regarding: - GL spec: Pointer functions required passed memory pointers to persist - JNI: Primitive arrays may change their native memory location (swap), even if they were not GC'ed. Xerxes Ranby and I discussed whether we are able to track the primitive non direct NIO backed arrays and pinpoint them. JNI's Get*ArrayElements may be able to pinpoint, however it could result in a copy of the data, which would render this feature non performant. The tracking itself may be another no-go, since it would add up complexity and failing to free resources would be another negative sideeffect.
* unit test, typo in docSven Gothel2012-09-181-2/+1
|
* Documenting Bug 586Sven Gothel2012-09-171-0/+172
|
* Fixes Bug 615 - X11: Use proper screen index/name for shared resources and ↵Sven Gothel2012-09-175-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Anotate focus tests in regards to OSX stability .. sporadically won't gain ↵Sven Gothel2012-09-173-8/+8
| | | | focus and receive keyboard input via AWTRobot
* Analyze crash of shared context each running in multiple threads, disabled ↵Sven Gothel2012-09-173-175/+113
| | | | | | | | 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.
* Complete 646714d3dab87396b9a3119bf90ca26e0b1c97ce / Fix Bug 601: Add missing ↵Sven Gothel2012-09-162-2/+22
| | | | enqueueKeyEvent(..) in WindowsDriver; Fix API doc typo.
* Fix Bug 601: Harmonize order of key events incl. auto-repeat and adding ↵Sven Gothel2012-09-1614-45/+223
| | | | | | | | | | | | | | | | | | | | | AUTOREPEAT_MASK modifier bit. Refine InputEvent toString(..) and list modifiers by name. As now described in NEWT's KeyEvent: +/** + * Key events are delivered in the following order: + * <ol> + * <li>{@link #EVENT_KEY_PRESSED}</li> + * <li>{@link #EVENT_KEY_RELEASED}</li> + * <li>{@link #EVENT_KEY_TYPED}</li> + * </ol> + * In case the native platform does not + * deliver keyboard events in the above order or skip events, + * the NEWT driver will reorder and inject synthetic events if required. + * <p> + * Besides regular modifiers like {@link InputEvent##SHIFT_MASK} etc., + * the {@link InputEvent#AUTOREPEAT_MASK} bit is added if repetition is detected. + * </p> + */
* Adding test case for Bug 611: On Windows XP is a performance issue, after ↵Sven Gothel2012-09-162-5/+87
| | | | JOGL initialization there seems to be a huge time lag when trying to open the Desktop folder.
* OSX: Disable TestSWTAccessor03AWTGLn - NSLocking issues w/ SWT/AWT ..Sven Gothel2012-09-162-61/+74
|
* Added very basic unit test of 1 GLProfile initializationSven Gothel2012-09-161-0/+51
|