Closed
Description
I expanded TestContextRestart
in the "master"-branch jme3-examples sub-project to study some issues I'm seeing with context restarts in LWJGL v3. The issues are platform-dependent and reproducible.
Running on current "master"-branch with LWJGL v3 on my WIndows 11 laptop, reshape()
is invoked just once:
Mar 30, 2022 5:59:43 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.6.0-SNAPSHOT
* Branch: master
* Git Hash: 30774ef
* Build Date: 2022-03-30
Mar 30, 2022 5:59:45 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 3.3.1 build 7 context running on thread jME3 Main
* Graphics Adapter: GLFW 3.4.0 Win32 WGL Null EGL OSMesa VisualC DLL
Mar 30, 2022 5:59:45 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: NVIDIA GeForce RTX 2070/PCIe/SSE2
* OpenGL Version: 3.2.0 NVIDIA 497.33
* GLSL Version: 1.50 NVIDIA via Cg compiler
* Profile: Core
Mar 30, 2022 5:59:47 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio Renderer Information
* Device: OpenAL Soft
* Vendor: OpenAL Community
* Renderer: OpenAL Soft
* Version: 1.1 ALSOFT 1.21.1
* Supported channels: 64
* ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_device_clock ALC_SOFT_HRTF ALC_SOFT_loopback ALC_SOFT_loopback_bformat ALC_SOFT_output_limiter ALC_SOFT_pause_device
* AL extensions: AL_EXT_ALAW AL_EXT_BFORMAT AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_BFORMAT AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_EXT_SOURCE_RADIUS AL_EXT_STEREO_ANGLES AL_LOKI_quadriphonic AL_SOFT_bformat_ex AL_SOFTX_bformat_hoa AL_SOFT_block_alignment AL_SOFTX_callback_buffer AL_SOFTX_convolution_reverb AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_direct_channels_remix AL_SOFT_effect_target AL_SOFT_events AL_SOFTX_filter_gain_ex AL_SOFT_gain_clamp_ex AL_SOFT_loop_points AL_SOFTX_map_buffer AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length AL_SOFT_source_resampler AL_SOFT_source_spatialize
Mar 30, 2022 5:59:47 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Mar 30, 2022 5:59:47 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 2
Mar 30, 2022 5:59:47 PM jme3test.app.TestContextRestart$1 reshape
INFO: reshape(width=640 height=480)
Mar 30, 2022 5:59:47 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: NVIDIA GeForce RTX 2070/PCIe/SSE2
* OpenGL Version: 3.2.0 NVIDIA 497.33
* GLSL Version: 1.50 NVIDIA via Cg compiler
* Profile: Core
Mar 30, 2022 5:59:50 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: NVIDIA GeForce RTX 2070/PCIe/SSE2
* OpenGL Version: 3.2.0 NVIDIA 497.33
* GLSL Version: 1.50 NVIDIA via Cg compiler
* Profile: Core
BUILD SUCCESSFUL in 10s
Running on current "master"-branch with LWJGL v2 on my WIndows 11 laptop, reshape()
is invoked 3 times:
Mar 30, 2022 6:10:03 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.6.0-SNAPSHOT
* Branch: master
* Git Hash: 30774ef
* Build Date: 2022-03-30
Mar 30, 2022 6:10:04 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: C:\WINDOWS\System32\DriverStore\FileRepository\nvhm.inf_amd64_d745ea92fee8ab77\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvhm.inf_amd64_d745ea92fee8ab77\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvhm.inf_amd64_d745ea92fee8ab77\nvldumdx.dll,C:\WINDOWS\System32\DriverStore\FileRepository\nvhm.inf_amd64_d745ea92fee8ab77\nvldumdx.dll
* Driver Version: null
* Scaling Factor: 1
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jme3.util.ReflectionAllocator (file:/C:/Users/sgold/Documents/NetBeansProjects/jmonkeyengine/jme3-core/build/libs/jme3-core-3.6.0-SNAPSHOT.jar) to method sun.nio.ch.DirectBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of com.jme3.util.ReflectionAllocator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar 30, 2022 6:10:04 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: NVIDIA GeForce RTX 2070/PCIe/SSE2
* OpenGL Version: 3.2.0 NVIDIA 497.33
* GLSL Version: 1.50 NVIDIA via Cg compiler
* Profile: Core
Mar 30, 2022 6:10:05 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio Renderer Information
* Device: OpenAL Soft
* Vendor: OpenAL Community
* Renderer: OpenAL Soft
* Version: 1.1 ALSOFT 1.15.1
* Supported channels: 64
* ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_loopback
* AL extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_source_latency
Mar 30, 2022 6:10:05 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
Mar 30, 2022 6:10:05 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Mar 30, 2022 6:10:05 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 4
Mar 30, 2022 6:10:05 PM jme3test.app.TestContextRestart$1 reshape
INFO: reshape(width=640 height=480)
Mar 30, 2022 6:10:07 PM jme3test.app.TestContextRestart$1 reshape
INFO: reshape(width=1,920 height=1,080)
Mar 30, 2022 6:10:10 PM jme3test.app.TestContextRestart$1 reshape
INFO: reshape(width=500 height=400)
I believe this is symptomatic of a bug in recent versions of GLFW: the GLFWWindowSizeCallback
isn't always invoked when it should be.