Bug 1383: Cleanup GLContextImpl.setGLFunctionAvailability(..): Parameter, variables and clip at 180 line width (details)
Bug 1383: GLContext.isValidGLVersion() ensure only one profile bit is set max; Add OpenGL version 4.6 (details)
Bug 1283: GLContextImpl.setGLFunctionAvailbility(..) calls: When leaving OpenGL version open, don't assume the profile (details)
Bug 1383: GLContextImpl.setGLFunctionAvailbility(..): Ensure only one requested profile bit is set; Query GL_CONTEXT_PROFILE_MASK for hasCtxProfileBits (details)
Bug 1383: Final fix: Always test GL3CompatNonCompliant and test on requested version/profile, also .. (details)
iOS: Initial working commit supporting iOS (ipad pro 11)
using our OpenJFK 9 x86_64 and arm64 build.
Test demo class is 'com.jogamp.opengl.demos.ios.Hello', residing in the new demo folder 'src/demos/com/jogamp/opengl/demos/ios/Hello.java'.
This commit does not yet include a working NEWT specialization for iOS, but it shall followup soon.
Instead this commit demonstrates JOGL operating on native UIWindow, UIView and CAEAGLLayer as provided by Nativewindow's IOSUtil.
Test Video https://www.youtube.com/watch?v=Z4lUQNFTGMI
+++
Notable bug: The FBO used and sharing the COLORBUFFER RENDERBUFFER memory resources with CAEAGLLayer to be displayed in the UIView seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24 or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation).
Therefor the default demo GLEventListener chosen here don't require a depth buffer ;-)
This issue can hopefully be mitigated with other means than using a flat FBO sink similar to FBO multisampling.
iOS: Clean up promotion of EAGLLayer use down to FBObject
Initial commit bba73bc096250a3c7fc036d84b1ea054d1b70b06 hacked its path using a context global EGLLayer instance attachement. The hack was good for the first demo, however, it forbid using other FBObjects etc on the way.
Properly specifying FBObject.Attachment.StorageDefinition, allowing the user to inject code for selected FBO attachements to define their storage. This might be useful for different platforms as well - however, it is OS agnostic and instance specific now.
In this sense, GLFBODrawableImpl, hosting FBObject, has a more specific instance of FBObject.Attachment.StorageDefinition for color-renderbuffer. It is passed along newly created color renderbuffer.
GLDrawableFactoryImpl.createGLDrawable uses a derived interface, OnscreenFBOColorbufferStorageDefinition which is defined in IOSEAGLDrawableFactory and return by its getter. GLDrawableFactoryImpl.createGLDrawable is therefor platform agnostic again.
Bottom line is, as more platforms will be added, these semi-public interfaces have to adapt to suit them all ..
All this due to iOS architecture for 'onscreen rendering' using a FBO which shares its color renderbuffer storage with the EAGLLayer, associated with the UIView. A bit weird maybe in first sight, but efficient for creating cheap hardware design ;-) Only criticism here is that Apple didn't bother using EGL and an extension.
Notable bug as mentioned before: The FBO used and sharing the COLORBUFFER RENDERBUFFER memory resources with CAEAGLLayer to be displayed in the UIView seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24 or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation).
This workaround re-binds the used color renderbuffer for EAGLLayer presentation at the end of the FBO drawable instantiation.
FBO DEPTH buffer works now as demonstrated w/ GearsES2.
We have to issue one more test now, using a demo using an FBO itself.
Adding the missing JogAmp copyright tag on certain files.
Currently in debate whether 'JogAmp Community' is a legal Copyright tag in the first place, we might need to add (or replace it with) my authorship. However, as authorship is well documented via the git repository, this should be no real world issue.
- IOSUtil/OSXUtil: Return float value and refine name to GetScreenPixelScale*
- WindowDriver's updateMaxScreenPixelScaleByDisplayID(..) and updateMaxScreenPixelScaleByWindowHandle(..) will only update the maxPixelScale, as actual user pixelSize change should not be triggered here.
A user pixelSize adaption to the changed underlying scale capabilities (e.g. switch monitor) should be supported by the implemented WindowDriver's: updatePixelScale(..) called by native code.
NEWT iOS: Support Multi-Touch Events, PixelScale, ..
Note: Two subsequent commit will add some required change in the native UIWindow/UIView creation methods to actually make the NEWT view being displayed ;-)
The demo 'com.jogamp.opengl.demos.ios.Hello' demonstrated a standard NEWT application running on iOS. Previous NativeWindow wrap-around demo is preserved in 'com.jogamp.opengl.demos.ios.Hello1'.
Tested on ipad 11'inch arm64 and x86_64 simulation: - Using GearsES2 demo - PixelScale 1f, 2f and 0f - last two using max pixel scale - Touch w/ GearsES2 works: -- 1 finger rotate -- 2 finger drag -- 2 finger pinch-zoom gesture detection
Astonishingly, the original code path doesn't show up the CAEAGL View/Layer (only the red test background) even though t is 1:1 equal to this alternative calls. Keeping the original path intact for future validation, another round of hours of analysis.
The original code path will be removed in the next commit.
Fixed clean target so it doesn't fail if GlueGenTask is not present
If gluegen was cleaned, the GlueGenTask would be absent, which would cause a failure in jogl clean (even though GlueGenTask isn't needed in the clean target). So, modified the jogl build so it doesn't load GlueGenTask in the clean target.
Orig commit by Wade Walker. This alternative patch uses the ant target common.gluegen.init to define the 'gluegen' task post gluegen compile check and pre 'gluegen' call, avoiding the if-then-else ant-task state query: <equals arg1="${ant.project.invoked-targets}" arg2="clean" />
Removed illegal reflective access to sun.java2d.opengl.OGLUtilities
We were reading a variety of surface type definitions from sun.java2d.opengl.OGLUtilities using reflection, which has thrown warnings since Java 9 and which soon will become illegal. For now, just hard-coded these types to remove the warnings that happen during static initialization. Eventually the entire Java2D class will have to be revamped if we want to be able to actually use it.
Bug 1363: Java 11: Don't use sun.awt.SunToolkit.awtLock/Unlock on Java9+ [illegal reflective access]
Avoid illegal reflective access to sun.awt.SunToolkit.awtLock/Unlock on Java9+
Apparently these give a performance benefit on X11 by avoiding taking the AWT global lock, and instead only taking a Java lock defined in sun.awt.SunToolkit. But this has thrown a warning since Java 9, and will soon be illegal. If a performance problem remains on X11, we'll need to find another solution.
Orig patch by Wade Walker. This patch only skips utilizing said API on Java9+ while maintaining orig code path for Java8.
Bug 1363: Java 11: Don't use GraphicsDevice.getScaleFactor() on Java9+ [illegal reflective access]
Use non-reflective method to get the pixel scale on Java9+
It's now possible to use GraphicsConfiguration.getDefaultTransform() instead of using reflection to get the pixel scale, which eliminates an illegal reflective access warning.
Bug 1363: Java 11: Use getPixelScale standard method even on Mac under Java9+
Changed getPixelScale to use standard method, even on Mac
Previously it used a Mac-specific method, but the new standard method of device.getDefaultConfiguration().getDefaultTransform() seems to work on Mac, so use it instead to avoid illegal reflective access warnings.
Previous commits removed access to OSX's GraphicsDevice.getCGDisplayID() on Java9+, avoiding illegal reflective access.
Here we JAWTUtil.getMonitorDisplayID(..) simply returns null if Java9 or !OSX, so the sole NewtFactory caller falls back to the alternative working solution.
Orig patch Wade Walker: This was used on Mac OS only to create a MonitorDevice in NewtFactoryAWT. But there was a fallback method for creating MonitorDevice, and testing with TestGearsES2GLJPanelAWT shows that the fallback method seems to give identical results on Mac, so changed to just use the fallback method (which is now the only method) everywhere. This gets rid of an illegal reflective access.
- GNU/Linux AMD GPU regression -- 1) No compat profiles on X11 device -- 2) Remaining core only profiles disclose buggy GLProfile selection -- This needs to be fixed pre-release
Bug 1384: Allow GLRendererQuirks to be overridden by user properties
Allow GLRendererQuirks to be overridden by user properties, allowing to either force (inject) a quirk by a user property or to ignore a quirk by a user property.
This helps: - debugging certain quirk behavior (See Bug 1383) - allowing a user to customize the quirk setting
+++
This patch also refines the quirk: GLNonCompliant -> GL3CompatNonCompliant, i.e. constraints its semantics to GL3 compatible context.
+++
This patch also removed useless code of GLRendererQuirk, i.e. the 'int[] quirk' array arguments which are nonsense or wasteful, as we operate with bitmasks.
Bug 1383: GLContextImpl.setGLFunctionAvailbility(..): Ensure only one requested profile bit is set; Query GL_CONTEXT_PROFILE_MASK for hasCtxProfileBits
and finally guess the GL profile bit if none could be determined: 'isESReq ? GLContext.CTX_PROFILE_ES : GLContext.CTX_PROFILE_COMPAT'
Bug 1383: Final fix: Always test GL3CompatNonCompliant and test on requested version/profile, also ..
also, if requested version is within GL3CompatNonCompliant valid range, i.e. < 3.1, the detected actual version will be clipped for valid mapping to the requested data.
Here it might be essential to know, that all versions are being 'scanned' via mapGLVersions from high to low. Therefor Version 3.0 would be tried before 2.0 and both will be mapped to the clipped actual version 3.0. The true actual version could be the maximum, however, using the very same would lead to trying an invalid unavailable GLProfile.
On Mesa, if requesting a 3.1 compat profile, we receive a 4.5 core profile.
This is natural due to constraints within glXCreateContextAttribsARB, i.e. GLX_CONTEXT_PROFILE_MASK_ARB is only a available for versions >= 3.2 and these are not available on Mesa.
Tested with Mesa 18.3.6 of Debian 10 Buster, which also confirms Bug 1385 fix of limitating GL3CompatNonCompliant to Mesa < 18.2.0
Bug 1363: Java 11: JAWTUtil: Use sun.awt.SunToolkit.awtLock/Unlock and disableBackgroundErase (impl. semantics)
Commit 13c6bbbde5ea476d60e0a2f04a5172d3302d0edd simply removed the AWT commonly used SunToolkit lock/unlock methods, which was incorrect. It lead to certain resources access collisions as access has to be synchronized using the same reentry lock across AWT and NativeWindow/JOGL.
We utilize the new com.jogamp.common.util.UnsafeUtil of GlueGen commit 07c1885e9a3d1f3a3853414648c06fb3864bc69f to disable the IllegalAccessLogger while fetching the methods/fields and making them accessible.
JAWUtil also hosts access to SunToolkit's disableBackgroundAccess(Component) aligning the code for GLCanvas, NewtCanvasAWT and AWTCanvas.
Bug 1390: Fix GLPixelBuffer.GLPixelAttributes::convert(GL, int, boolean) failure on unsupported GL data format/type
GLPixelBuffer.GLPixelAttributes::convert(GL, int, boolean) failed on unsupported GL data format/type
On Mesa/AMD for GLPBuffer chosen GLCaps used rgba 10/10/10/2 and the GLContext set default values: GL_IMPLEMENTATION_COLOR_READ_FORMAT: 0x1908 GL_RGBA GL_IMPLEMENTATION_COLOR_READ_TYPE: 0x8368 GL_UNSIGNED_INT_2_10_10_10_REV
GLPixelBuffer.GLPixelAttributes::getPixelFormat(int format, int type) currently does not handle the type GL_UNSIGNED_INT_2_10_10_10_REV and hence returned a null PixelFormat.
Therefor the ctor GLPixelAttributes failed and threw the exception: "Caught GLException: Could not find PixelFormat for format and/or type: PixelAttributes[fmt 0x1908, type 0x8368, null]"
This fix has the GLContext default values pre-validated in the convert(..) method and to use default GL_RGBA and GL_UNSIGNED_BYTE fallback values if not supported. This is most important to be future proof.
Later we may shall add these 32bit coding 2+10+10+10 and its reverse.
Bug 1392: X11PixmapGLXDrawable::createPixmap() requires X11GLXGraphicsConfiguration having a valid XVisualInfo
Therefor X11GLXGraphicsConfiguration::GLXFBConfig2GLCapabilities(..) also needs to clean the GLGraphicsConfigurationUtil.BITMAP_BIT from drawableTypeBits and if all removed, drop the FBConfig.
Buig 1389: Fix SIGSEGV on OpenJDK11 on [NSApplicationAWT sendEvent:]
Culprit of the crash and the non propagated action on NSApp main-thread was _simply_ our OSXUtil_KickNSApp() 'kick alive' NSApplicationDefined NSEvent sent to the NSApp.
Java11's NSApp code overrides sendEvent and handles NSApplicationDefined + subtype=ExecuteBlockEvent using the given data1 as a function pointer. 8-O
ExecuteBlockEvent defined as 0, which we have sent.
Simply passing subtype=8888 avoids this side-effect. Whether it is still required to KickNSApp() is another question.
+++
Further, make code a bit more robuts regarding the offscreenSurfaceLayer at JAWTWindow invalidate. I.e. if still not detached, do the late cleanup there. This just in case the OSX Context callback to disassociate the drawable has been missed.
Bug 1393: MacOS/iOS: Issue updateSizePosInsets0 async to AppKit Main-Thread
Additionally, setPointerIcon0 must also be made async on AppKit (instead of wait), we have to assume/hope the user won't pull the PointerIconImpl instance in-between ;-) Hence removing the comment regarding the lifecycle.
To allow proper testing of whether all AppKit calls are performed on its Main-Thread where required, we inject the libMainThreadChecker.dylib when property 'nativewindow.debug.OSXUtil.MainThreadChecker' is set.
See <https://developer.apple.com/documentation/code_diagnostics/main_thread_checker?language=objc> Lib-Name: /Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
Bug 1393: Adding test cases setting visibility before enabling exclusive context thread animator
MacOS Java11 freezes occur on 3rd NEWT window creation (orderFront) after enabling exclusive context thread animator. Here we add set visibility upfront which does not trigger the freeze on the AppKit main thread. Note: OpenJDK8 works flawlessly. For some reason, the exclusive context thread enabled animator interferes when 'orderFront' is issued.
Bug 1393: MacOS: Implement AppKit EDTUtil operating solely on main-thread
Introducing boolean property 'newt.macos.useAppKitEDTUtil', which defaults to 'false'. If enabled, the new AppKitEDTUtil is being used, operating on the AppKit main thread. This is used to ease debugging Bug 1393, minimizing thread context switches.
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
Bug 1156: Utilize internal glGetStringi (same as glGetString) - Robostness
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.
getCustomClass(..) shall throw all required exceptions upstream. Previous essential NEWT driver exception information got suppressed if failing, only disclosed in debug mode.
Bug 1156: GBM: Bring up incl GL rendering (TODO: GBM working page flip / sync)
- 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
Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWT
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.
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
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
Bug 1156: LinuxKeyEventTracker: Fix 64bit InputEvent and attempt to only use keyboard event files
The time structure on 64bit machines uses two 8 byte long values instead of two 4 bytes int values on 32bit machines. The insufficient read on 64bit machines caused an IllegalArgument exception. This fix considers 32 or 64 bit operation.
Class renamed: LinuxEventDeviceTracker -> LinuxKeyEventTracker, as it tracks key events specifically.
Now the EventDeviceManager tries to only use /dev/input/by-id/*-event-kbd keyboard event files, which reduces the handling on kbd event files only.
Having fixed mouse and keyboard input with previous commit, the demo com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT shows via key press - i -> pointer visible/invisible - c -> pointer icon change
Bug 1406: DRMUtil: Probe DRM device whether it has resources attached (and is the desired one)
First issue was that the proper DRM file had to be queries, as Raspberry 4 may have two of them: <-- /dev/dri/dri0 /dev/dri/dri0 /dev/dri/by-path/platform-fec00000.v3d-card -> ../card0 /dev/dri/by-path/platform-soc:gpu-card -> ../card1 -->
This patch attempts to probe all /dev/dri/card[0..99] using this arbitrary range. The test loop ends if: - drmOpenFile succeeds and drmModeGetResources delivers non-null value - the iterated probed file doesn't even exist - 100 files has been tested ;-)
Misc: - Remove unused SysExit.. - showFPS=true default - allow setting 'useDoubleBuffer' via '-single' - demos.es2.GearsES2: Don't be verbose on display even w/o animator
IF '-noanim', issue glWindow.display() from main thread instead of using the animator thread otherwise. This shall test the swap buffering code in single threaded mode!
NEWT: Align DisplayImpl.createPointerIcon(..) behavior; PointerIconImpl.validatedHandle() shall not create native resource.
Semantic cleanup for clarity and equal behavior
Align DisplayImpl.createPointerIcon(..) behavior - return null handle of createPointerIconImplChecked(..) shall be accepted, no exception for neither of the two creation methods.
PointerIconImpl.validatedHandle() shall not create native resource. - throws exception if handle is null (about to be used) - no native creation shall happen here.
Display.PointerIcon.validate(): Removed, not used.
Bug 1156, Bug 1401: Disable DesktopGL on EGL w/ DRM/GBM earlier in 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.
Now that was quite a miss, causing the bugs in the first place! The freeze was caused in the JVM, as this open GetPrimitiveArrayCritical(..) disabled the GC. This was reported via '-Xcheck:jni'. Depending on the system/jvm, the freeze may happen early or only after a while.
This code path was not executed with new property 'newt.disable.PointerIcon' set, but from there to finding the missing critical release - a journey:
- jstack showed
"main" #1 prio=5 os_prio=0 cpu=275.71ms elapsed=51.93s allocated=9710K defined_classes=472 tid=0x00007f7084015000 nid=0x1a39 waiting on condition [0x00007f70897c2000] java.lang.Thread.State: RUNNABLE at jogamp.opengl.es3.GLES3Impl.dispatch_glUniformMatrix4fv1(Native Method) at jogamp.opengl.es3.GLES3Impl.glUniformMatrix4fv(GLES3Impl.java:2585) at jogamp.opengl.es3.GLES3Impl.glUniform(GLES3Impl.java:10713)
-- said that this thread was no more running, waiting on condition .. -- glUniformMatrix4fv1 was given an array!
- '-Xcheck:jni' gave:
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
-- Now it is clear that the lack of releasing the critical array, returning to Java and then calling other JNI methods caused the Warning - and eventually the freeze.
Bug 1409: GNU/Linux DRM Console: Clear stdin before exit and don't act on stdin in vsync-wait-loop
User input during test from the console will also end up in stdin of the console after the java application has been closed. This is not only annoying, but also a security concern, as the input gets executed if containing a CR.
Commit d5ba4cae824087879a4857e20961a95da04eaebb clarified and simplified the lifecycle of a PointerImpl instance, i.e. drop its resurrection in PointerImpl.validateHandle() in favor of a hard exception.
This caused detection of subsequent PointerImpl lifecycle issues, as instances were not fully destroyed on Display closing and references not null'ed in Display and Screen instances.
Bug 1413 - NEWT X11Window: NewtWindows_getFrameExtends(..) may hang on XPeekEvent(..)
The wait loop uses XPeekEvent(dpy, &e), which can block indefinite if queue is empty.
Replace with timeout only _and_ only wait on CreateWindow0(..) not when queried via X11Display dispatch loop on events when it is assumed the information has been propagated already.
Bug 1200: GLRendererQuirks.NoSurfacelessCtx still persists on Linux/X11 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 1393: Make window position check more tolerant (2x insets or 64 pixels, whichever is greater)
Certain WM's may modify the windowing position 'a little', which has been experienced on one X11 server during invisible setting. The insets were removed and its value added to the position!
We could argue that this is an issue in our windowing code, however, the WM is free to reposition a window.
Bug 1156: NEWT Window: Better handling of fixed console case: Not resizable and not repositionable.
Our two fixed size and position console cases 'bcm.egl' and 'egl.gbm' (drm.gbm) only operate in a console like fullscreen mode.
We should earmark and expose this behavior, as well as handle it by not waiting for a position / size and not attempting to change position and size.
Reducing WindowImpl.minimumReconfigStateMask to bare minimum values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED; New WindowImpl.mutableSizePosReconfigStateMask extends WindowImpl.minimumReconfigStateMask, representing previous values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED | STATE_MASK_FULLSCREEN | STATE_MASK_RESIZABLE | STATE_MASK_REPOSITIONABLE;
All WindowDriver implementations previously using WindowImpl.minimumReconfigStateMask are now using WindowImpl.mutableSizePosReconfigStateMask but the explicit console driver named above.
I would have liked to add the STATE_BIT_FULLSCREEN to the current stateMask to notify this semantics, however this would have lead to more code changes as our fullscreen mode assumes to be 'on top' of the normal mode. Here the normal mode is essentially fullscreen and no back/forth fullscreen setting is useful or allowed. Therefore, both fixed size & position console driver won't expose themselves as being in fullscreen mode.
Bug 1416 - Allow EGLDrawableFactory re-creation after shutdown() - be functional
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 1411 DRM/GBM JOGL: Fix 'junit.run.console' - fourth times
the property 'generic.junit.run.newt.headless.include.pattern' to run target 'generic.junit.run.newt.headless' multiple times for different unit tests must be unset within the caller space of ant.
also fixed other occasions (never really worked on multiple calls).
Bug 1156: Seperate DRM/GBM NEWT native library from main head NEWT native library
DRM/GBM is enabled for Linux in general. Nativewindow's 'nativewindow_drm' DRM/GBM native library is already seperated.
NEWT get its 'newt_drm' DRM/GBM native library.
NEWT's main head native library is renamed from 'newt' -> 'newt_head' and is earmarked for further seperation similar to Nativewindow's. At least a 'newt_wayland' will probably followup when support is added.
Goal is to remove DRM/GBM dependency for Linux X11 operation as well as removing X11 dependency for Linux DRM/GBM operation.
Bug 1156 Regression (Bug 1417): Probe whether 'eglGetPlatformDisplay(..)' is 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 1287 - Complete Immutable glNamedBufferStorage support in 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.
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 1312: GLContextShareSet: Utilize WeakIdentityHashMap for shareMap and 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.