aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
Commit message (Collapse)AuthorAgeFilesLines
* GLDrawableFactoryImpl:createMutableSurfaceImpl(..): Pass orig ↵Sven Gothel2023-03-046-40/+42
| | | | AbstractGraphicsDevice to allow EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources.
* GLDrawableFactoryImpl:createDummySurfaceImpl() and createSurfacelessImpl(): ↵Sven Gothel2023-03-047-69/+91
| | | | | | | Pass orig AbstractGraphicsDevice to allow EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources. EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources, e.g. GLContext. EGL 1.4 requires same native-display-ID of share-list context and newly created context!
* EGLGraphicsDevice: Cleanup and enhance API doc for clarity ...Sven Gothel2023-03-041-8/+8
|
* GLMediaPlayerImpl: destroyImpl(..) @ initGL(..) exception: Don't wait for ↵Sven Gothel2023-03-041-5/+8
| | | | streamWorker stop result (-> deadlock)
* Drop redundant NativeWindowFactory.getDefaultToolkitLock(type, deviceHandle) ↵Sven Gothel2023-03-021-3/+3
| | | | variant
* GLArrayData*: Shorten methods (*API Change*), use proper constructor and ↵Sven Gothel2023-02-242-2/+2
| | | | | | | | | | | | | finalize immutables, add growthFactor (default golden ratio 1.618), add getCapacity*() and printStats(..) The growthFactor becomes essential for better growth behavior and can be set via setGrowthFactor(). The other changes were merely to clean up the GLArrayData interface and its 4 implementations. Not great to change its API, but one name was misleading ['getComponentCount' -> 'getCompsPerEleme'], so overall .. readability is enhanced. Motivation for this change was the performance analysis and improvement of our Graph Curve Renderer.
* FFMPEGMediaPlayer: Add implementation update for FFmpeg version 4.* (Debian ↵Sven Gothel2023-02-238-341/+197
| | | | | | | | | | | | | | | | | | | | | | | 11), 5.* (Debian 12) and 6.* (Current Development trunk) From here on, libav support has been dropped. Required FFmpeg libraries to be fully matched by their major runtime- and compiletime-versions are: - avcodec - avformat - avutil - swresample Library avdevice is optional and only used for video input devices (camera). Library avresample has been removed, since FFmpeg dropped it as well in version 6.* and swresample is preferred for lower versions. The matching major-versions of each library to the FFmpeg version is documented within FFMPEGMediaPlayer class API-doc. Each implementation version uses the non-deprecated FFmpeg code-path and compilation using matching header files is warning-free.
* MacOSXCGLContext: Fix typo in DEBUG outputSven Gothel2023-01-221-10/+10
|
* MacOSXCGLContext: Enable DEBUG1398 explicitly w/o debugAll()Sven Gothel2023-01-221-1/+1
|
* jogl's Debug.class: Add explicit debugNotAll(..) variant to skip debugAll()Sven Gothel2023-01-221-1/+5
|
* MacOSXCGLContext.AttachGLLayerCmd: Allow DetachGLLayerCmd to revoke the ↵Sven Gothel2023-01-211-5/+11
| | | | | | | | attach command, essential if attach hasn't been done yet @ detach Otherwise a pending attach would still pass through after DetachGLLayerCmd releases the sync-lock from AttachGLCmd. DetachGLCmd also tests 0 != nsOpenGLLayer
* Don't import conditional platform specific 'static' code but fully qualify ↵Sven Gothel2023-01-201-11/+5
| | | | names when in use, make Android d8 (Dex'ing) happy
* MacOSXCGLDrawableFactory.canCreateGLPbuffer(): Disabled for MacOS >= 12, ↵Sven Gothel2023-01-181-2/+5
| | | | here > 10.14.0 (Mojave)
* MacOSXCGLContext: Avoid data race on lastSetNSViewCmd, use local copy like ↵Sven Gothel2023-01-181-3/+4
| | | | in madeCurrent
* X11GLXContext.getPlatformExtensionsStringImpl(): Add comment from pull ↵Sven Gothel2023-01-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | request regarding GLX extensions https://github.com/sgothel/jogl/pull/107 Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions ndjojo: glXQueryExtensionsString will make a request for glXQueryServerString if needed and will append the necessary client-side extensions. This doc, under the section "Using GLS Extensions", also suggests checking the glXQueryExtensionsString before using GLX extensions. +++ aschleck: For some more context this came up with the release of Mesa 20.3.0, which has client support for GLX_EXT_swap_control but no server support. The current JOGL behavior of appending the client extensions to the server extensions is incorrect. They should instead be intersected (with client-only extensions then appended) as the doc Nicole linked above says, which is precisely what glXQueryExtensionsString does. With the current extension querying behavior JOGL thinks glXSwapIntervalEXT is available under Mesa/llvmpipe even though it is not, causing a segfault at JOGL initialization time. I originally filed this as a Mesa bug (https://gitlab.freedesktop.org/mesa/mesa/-/issues/4128) along with some code that repro'd JOGL's checking behavior but it became apparent that Mesa is fine and the checking behavior is incorrect.
* Merge pull request #107 from ndjojo/platform-extensionsSven Gothel2023-01-161-10/+2
|\ | | | | Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions
| * Update X11GLXContext.javandjojo2021-01-201-10/+2
| |
* | Moved GlueGen's PlatformPropsImpl's static OSXVersion to ↵Sven Gothel2023-01-152-6/+29
| | | | | | | | GLContextImpl.MacOSVersion
* | Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-149-21/+22
| |
* | MacOS: MacOSXCGLContext.drawableUpdatedNotify(): Issue updateContext() on ↵Sven Gothel2023-01-141-21/+2
| | | | | | | | | | | | main thread, deferred w/o wait (MacOS >= 13) updateContextRegister() stays in current thread.
* | MacOS: MacOSXCGLContext.NSOpenGLImpl.release(): Don't wait for releasing ↵Sven Gothel2023-01-141-1/+2
| | | | | | | | context view on MacOS >= 10.14 (deadlock)
* | MacOS: MacOSXCGLContext: Simplify version flags, remove Tiger, add Mojave.Sven Gothel2023-01-141-6/+20
|/
* Fix 'typo' in branching, valid config index is >= 0 (not < 0)Sven Gothel2020-06-151-1/+1
| | | | | | | This issue was introduced in commit 0a6a592c04a85d8124aa9d38b67f0caa1d739b75 and the '2nd choice branch' obviously never tested. Thanks to Lathanda finding this issue on 6/14/20.
* Bug 1398: MacOSXCGLContext: Ensure AWT is available before using it when ↵Sven Gothel2020-04-061-5/+12
| | | | | | | query java.awt.EventQueue.isDispatchThread() If AWT is not available, isAWTEventDispatchThread() returns false, otherwise returns java.awt.EventQueue.isDispatchThread().
* Bug 1398: Avoid AWT-AppKit blocking feedback flush deadlock and SetNSViewCmd ↵Sven Gothel2020-04-061-28/+60
| | | | | | | | | | | | | | | | | | | on initial makeCurrent when offscreen makeCurrent shall skip SetNSViewCmd for offscreen, i.e. refine criteria of nsViewChanged. Previous term enforced SetNSViewCmd on initial call as lastNSViewDescr was null. Expand first term to require an actual non null NSView. contextMadeCurrent must avoid blocking to wait for completion of our SetNSViewCmd on AppKit. AWT has procedures running on AppKit under certain situations, where it issues a feedback flush on AWTEDT (from Appkit) blocking. This in turn deadlocks our SetNSViewCmd waiting on the AppKit, as we are blocking the AWTEDT waiting for same command. Further avoiding other potential deadlocks, by adding a 500ms timeout. Also clearing the lastSetNSViewCmd field post wait, regardless, which avoid repeatitive SetNSViewCmd issuance on timeout. Note that the SetNSViewCmd, we failed to wait for eventually gets executed.
* Bug 1398: Ensure CGLContext lock will be acquired before leaving user ↵Sven Gothel2020-03-051-25/+106
| | | | | | | | | | | | | | | | | | | | | | | | makeCurrent() call Command SetNSViewCmd sets NSOpenGLContext's NSView via [NSOpenGLContext setView:] on the main-thread as enforced since XCode 11 using SDK macosx10.15, see Bug 1398. This command is injected into OSX's main-thread @ NSOpenGLImpl.makeCurrent(long) only if required, i.e. issued only for a newly bound NSView and skipped for surface-less or offscreen 'surfaces'. This operation must be performed w/o blocking other tasks locking the NativeSurface on main-thread to complete. Since [NSOpenGLContext setView:] acquires the CGLContext lock on the main-thread, it can't be locked by the calling thread until this task has been completed. Command issuer NSOpenGLImpl.makeCurrent(long) will not acquire the CGLContext lock if this command is pending. contextMadeCurrent(true) cures the potential unlocked CGLContext by issuing a whole GLContext.release() and GLContext.makeCurrent() cycle while waiting for this command to be completed in-between. This GLContext cycle also ensures an unlocked NativeSurface.getLock() in-between, allowing potentially blocked other tasks on the main-thread to complete and hence this queued command to execute. Notable test provoking critical multithreading issues is com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT. Notable test exposing issues with an unlocked CGLContext is com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT.
* Bug 1398: MacOS: Perform [NSOpenGLContext setView:] on main-thread async w/o ↵Sven Gothel2020-02-241-100/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocking Set NSOpenGLContext's NSView via [NSOpenGLContext setView:] on the main-thread as enforced since XCode 11 using SDL macosx10.15, using Runnable SetNSViewCmd. This operation must be performed async w/o blocking to allow other tasks locking the NativeSurface on main-thread to complete. Further, since [NSOpenGLContext setView:] acquired the CGLContext lock, it can't be locked until this task has been completed. Worst case scenario for a late [NSOpenGLContext setView:] issuance might be corrupt initial frame(s) displayed. Since all concurrent locking is performed within JOGL, the unlocked CGLContext window risk is only academic. However, if native 3rd party toolkits take share control, we might have a situation. +++ SetNSViewCmd is issued @ makeCurrent() now as opposed to createContext(..) and associateDrawable(true). The latter was actually late as well, as it also happened after makeCurrent when updating the drawable association. It also missed setting a null NSView when detached! release() will also set a null NSView if called after associateDrawable(false). SetNSViewCmd will only be issued if the NSView has been changed, i.e. first makeCurrent() or changing the drawable. If issued, makeCurrent() will not lock the underlying CGLContext and hence allow SetNSViewCmd to perform - see above. +++ NSViewDescriptor class structure replaces the less convenient method 'getNSViewHandle(..)', exposing all collected drawable characteristics as fields. NSViewDescriptor also respects a ProxySurface's OPT_UPSTREAM_SURFACELESS mode, which results in not using any underlying NSView - similar to OPT_UPSTREAM_WINDOW_INVISIBLE. This change ensures that all surfaceless GL operations will not use any NSView.
* Bug 1420: Add FFMpeg 4.* versioned lib-names and provide optional internal ↵Sven Gothel2020-01-032-59/+153
| | | | | | | | | | | | | | | | | | | | | lib lookup New property 'jogl.ffmpeg.lib' may be set to 'internal', setting PREFER_SYSTEM_LIBS:=false (default it true) Non system internal libraries are named 'internal_<basename>', e.g. 'internal_avutil'. System default libraries are named '<basename>', e.g. 'avutil'. If PREFER_SYSTEM_LIBS is true (default), we lookup the default library first, then the versioned library names and last the internal library. If PREFER_SYSTEM_LIBS is false, we lookup the internal library first, then the versioned library names and last the default library.
* Bug 1312: GLContextShareSet: Utilize WeakIdentityHashMap for shareMap and ↵Sven Gothel2019-12-311-2/+3
| | | | | | | | | | | | its destroyedShares Picking up Tom Nuydens suggestion to utilize a WeakIdentityHashMap instead of a IdentityHashMap, allowing destroyed GLContext to be removed from the GLContextShareSet through the GC. TestSharedContextVBOES2NEWT5 demonstrates the use-case, having one master context and several slaves being spawn off, killed and new sets to be spawn off. Here the GLContextShareSet shall not hard-reference the destroyed and user-unreferenced context, but allowing the system to GC 'em.
* Bug 1312: GLContextShareSet CleanupSven Gothel2019-12-312-15/+63
| | | | | | | | | - refine some method names, eg -- 'addNew' -> 'mapNewEntry' -- 'hasCreatedSharedLeft(..)' -> 'hasCreatedSharesLeft(..)' - add 'getCreatedShareCount(..)' and 'getDestroyedShareCount(..)' - add 'getSize()' and 'printMap(..)'
* Bug 1347: Resolve Merged EGL/Desktop Profile MappingSven Gothel2019-12-283-8/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | GLProfile.computeProfileImpl(..) as of Bug 1084 is not the culprit here and its hardware criteria filter works. The issue is commit 99a064327bf991318841c858d21d13e55d6b39db of Bug 1203, in particular the change in GLProfile re: "Merge computed EGL-Profile-Map (1) and Desktop-Profile-Map (2) per device, instead of just using the last computation, preserving and favoratizing the Desktop-Profile-Map." Here the Desktop-Profile-Map overwrites the EGL-Profile-Map and hence the software mapping gets used. Indeed, this is a regression cause by the work of Bug 1203. +++ Resolution is to revert the explicit 'union mapping' and rely on an enhanced 'GLContextImpl.remapAvailableGLVersions(fromDevice, toDevice)' function. Here the EGLDrawableFactory _already_ maps the EGL device's GL Versions to the 'host' device (e.g. X11). This has to be refined so that the remap will not overwrite the 'host' device's already detected GL Versions. That alone is enough, so that GLProfile can simply use the 'mappedEGLProfiles' of the 'host' device if detected, which already is a merged mapping of X11 host- and EGL sub-device. In case no 'mappedEGLProfiles' are available, we simply use the 'mappedDesktopProfiles'.
* Bug 1287 - Complete Immutable glNamedBufferStorage support in ↵Sven Gothel2019-12-271-8/+9
| | | | | | | | | | | | GLBufferObjectTracker As of the time of implementation, named immutable buffers were not fully supported within GL 4.4. This has changed, i.e. GL 4.5 supports glNamedBufferStorage. This patch adds support for the immutable named buffer storage case. jogl commit 09fc7aa5539731bb0fba835caee61f6eb837ecff, added GLBufferObjectTracker allowing to keep required references to NIO object. This tracker complements the NIO buffer lifecycle with the GL semantics.
* Bug 1156 Regression (Bug 1417): Probe whether 'eglGetPlatformDisplay(..)' is ↵Sven Gothel2019-12-251-1/+37
| | | | | | | | | | | | | | | | | | available before using commit f4281b5ee80d7674134bfee357695a98382884a3 for Bug 1156 (DRM/GBM) introduced the call to 'eglGetPlatformDisplay(..)' for known EGL-platforms. However, 'eglGetPlatformDisplay(..)' is only available for EGL versions >= 1.5 or 'eglGetPlatformDisplayEXT(..)' if EGL extension 'EGL_EXT_platform_base' is available. This patch adds a singular EGL version probe and a secondary extension fallback test at first call using EGL_NO_DISPLAY on both EGL_VERSION and EGL_EXTENSION eglQueryString(..) calls. If 'eglGetPlatformDisplay*(..)' is not available, simply use 'eglGetDisplay(..)'. This regression also impacted Bug 1417 (Android bringup using current SDK + NDK), i.e. disabled most Android devices as their EGL version is often 1.4.
* Bug 1156: NEWT WindowDriver: Handle case with requested ↵Sven Gothel2019-12-091-0/+19
| | | | CapabilitiesImmutable not being GLCapabilitiesImmutable
* Bug 1416 - Allow EGLDrawableFactory re-creation after shutdown() - be functionalSven Gothel2019-12-091-0/+1
| | | | | | | | | | TestShutdownCompleteNEWT revealed that EGLDrawableFactory won't be properly re-created within subsequent GLProfile/GLDrawableFactory initSingleton() after a GLProfile.shutdown() call. Hence after the shutdown() call, subsequent GLProfile have no EGLDrawableFactory available and hence may not have a default device existent in case no desktop-factory is available. Allow EGLDrawableFactory to be re-created after a shutdown().
* Bug 1200: GLRendererQuirks.NoSurfacelessCtx still persists on Linux/X11 ↵Sven Gothel2019-12-081-3/+3
| | | | | | | | | | NVIDIA 440.36 using FBO Tested with com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsNewtAWT, which crashes in native makeCurrent of NV driver gl-core when using SurfacelessCtx. Therefor we had to revert the commit 4fe9e1dfa67f4e5d614f48c02ad88e4cdd1ed415 enabling SurfacelessCtx with NV driver >= 430.40.
* Bug 1156, Bug 1401: Disable DesktopGL on EGL w/ DRM/GBM earlier in ↵Sven Gothel2019-12-051-20/+22
| | | | | | | initialization Was within hasOpenGLDesktopSupport(), but then DesktopGL libs would have been already loaded and looked-up. This is not necessary and only wastes resources and time.
* VC4: Only load Broadcom EGL driver when guessVCIVUsedXerxes Rånby2019-12-042-40/+36
| | | | | | | | | | | | | Broadcom VC IV can be used from both console and from inside X11 When used from inside X11 rendering is done on an DispmanX overlay surface while keeping an X11 nativewindow under as input. When Broadcom VC IV is guessed only the Broadcom DispmanX EGL driver is loaded. Therefore standard TYPE_X11 EGL can not be used.
* VC4: Broadcom uses libbrcmEGL.so, libbrcmGLESv2.so, libbrcmOpenVG.so and ↵Xerxes Rånby2019-12-022-3/+17
| | | | | | | libbrcmWFC.so since 7 Jul 2016 Raspbian integration (two libGLES side-by-side) https://github.com/anholt/mesa/issues/24
* Bug 1200: probeSurfacelessCtx works at least since NVIDIA 430.40.Sven Gothel2019-11-281-2/+2
| | | | | | Added this version as the safe version to limit GLRendererQuirks.NoSurfacelessCtx setting. Bug 1200 - JOGL crashes on Debian8 GNU/Linux x86_64 'NVidia beta driver 355.06' @ probeSurfacelessCtx
* Bug 1156: Using EGL.eglCreatePlatformWindowSurface(..) crashes on NVIDIA ↵Sven Gothel2019-11-281-1/+4
| | | | | | 430.40 on GNU/Linux X11 Avoiding this method for now.
* Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWTSven Gothel2019-11-284-40/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding new classes DRMLib (gluegen of drm + gbm), DRMUtil and DRMMode GBMDummyUpstreamSurfaceHook to new package jogamp.nativewindow.drm, allowing full awareness of DRM + GBM within NativeWindow for JOGL + NEWT. DRMMode replaces the previous native code of collecting drmMode* attributes: active connector, used mode, encoder etc and also supports multiple active connectors. DRMUtil handles the global static drmFd (file descriptor), currently only the GNU/Linux DRM device is supported. GBMDummyUpstreamSurfaceHook provides a simple dummy GBM surface. NativeWindow provides the new nativewindow_drm.so and nativewindow-os-drm.jar, which are included in most 'all' jar packages. build property: setup.addNativeEGLGBM -> setup.addNativeDRMGBM Changes NativeWindowFactory: - TYPE_EGL_GBM -> TYPE_DRM_GBM while keeping the package ID of '.egl.gbm' for NEWT (using EGL) - Initializing DRMUtil at initialization Changes EGLDrawableFactory: - Using native GBM device for the default EGL display creation instead of EGL_DEFAULT_DISPLAY. This resolves issues as seen in Bug 1402, as well in cases w/o surfaceless support. - GL profile mapping uses surfaceless when available for GBM, otherwise uses createDummySurfaceImpl (dummy GBM surface via GBMDummyUpstreamSurfaceHook) - createDummySurfaceImpl uses a dummy GBM surface via GBMDummyUpstreamSurfaceHook - DesktopGL not available with GBM, see Bug 1401 NEWT's DRM + GBM + EGL Driver - Using DRMLib, DRMUtil and DRMMode, removed most native code but WindowDriver swapBuffer - ScreenDriver uses DRMMode, however currently only first connected CRT. - WindowDriver aligns position and size to screen, positions other than 0/0 causes DRM failure - WindowDriver reconfigure n/a NEWT TODO: - DRM Cursor support (mouse pointer) - Pointer event handling
* Bug 1156: GBM: Bring up incl GL rendering (TODO: GBM working page flip / sync)Sven Gothel2019-11-231-13/+20
| | | | | | | | | | | | | | | | | - EGLSurface: Factor out 'eglCreate[Platform]WindowSurface' NEWT egl.gbm.WindowDriver -- Properly use GBM fourcc format and use as visualID for GBM surface creation and EGL config selection -- Create eglSurface within this class -- Hook up GBM/DRM page flip (not working yet, no visible artifacts - no swap) - ProxySurfaceImpl.surfaceSwap() call upstreamSurface's implementation if available TODO: 'Permission denied' calling: - drmSetMaster (optional) - drmModeSetCrtc - drmModePageFlip
* Bug 1156: EGL-GBM: Fix NativeWindowFactory native-window-type query ↵Sven Gothel2019-11-221-1/+1
| | | | | | | | | | | | | | | | | | according to Bug 1156 - Special files like '/dev/dri/card0' can't be tested via isFile(), use exists() Order for GNU/Linux (and other unices) IMHO is 1) Display Server (Vendor neutral) 1.1) running X11 display server (DISPLAY check enough?) 1.2) running WAYLAND display server (WAYLAND_DISPLAY check enough?) 2) Console Mode Vendor Neutral 2.1) GBM (how to check?) 3) Console Mode Vendor Specific 3.1) VCIV (how to check)
* Bug 1156: EGL-GBM: [Re]use EGL Platform type for ↵Sven Gothel2019-11-222-35/+66
| | | | eglCreatePlatformWindowSurface as well (like eglGetPlatformDisplay)
* Bug 1156: GBM: FIXME: Remove scanning for desktop-GL via EGL, see commit ↵Sven Gothel2019-11-221-1/+6
| | | | e674f4fa0e795bd67335025123f9af727d856f7d
* Bug 1156: Utilize internal glGetStringi (same as glGetString) - RobostnessSven Gothel2019-11-222-81/+130
| | | | | | | | | Using EGL-GBM, using desktop GL we end up with an unsatisfied linkage error after the ProcAddressTable has been reset using the 'hasMajor' and 'hasCtxOptions'. However looking up using 'reqMajor' and 'reqCtxOptions' seems to work. Needs more analysis. This change also increases robustness for scanning through GL profiles at initialization.
* Bug 1156: EGL-GBM: Fix Cleanup (Newt package relocation / hack default GBM)Sven Gothel2019-11-211-4/+5
| | | | Now: TYPE_EGL_GBM == ".egl.gbm"
* Bug 1156: EGL-GBM: Cleanup Code & Replace Newt GBM implementationSven Gothel2019-11-211-11/+18
| | | | | | GBM driver is now under egl/gbm subpackage and has been replaced by bcm_vc_iv boilerplate. Native code is reentrant capable and cleaned up. TODO: EGLDisplayUtil work with SharedResourceRunner
* detect gbm platform on linux when no other display server is runningErik De Rijcke2019-11-211-1/+22
|