jmonkeyengine
jmonkeyengine copied to clipboard
OpenGLException in TestToneMapFilter
While running TestToneMapFilter
in jme3-examples, press the spacebar twice:
May 13, 2021 2:28:56 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.4.0-SNAPSHOT
* Branch: v3.4
* Git Hash: bdf15ba
* Build Date: 2021-05-13
May 13, 2021 2:28:57 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
May 13, 2021 2:28:57 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: GeForce GT 545/PCIe/SSE2
* OpenGL Version: 4.6.0 NVIDIA 390.143
* GLSL Version: 4.60 NVIDIA
* Profile: Compatibility
May 13, 2021 2:28:57 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
May 13, 2021 2:28:57 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
May 13, 2021 2:28:57 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
May 13, 2021 2:28:57 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 4
== Tone Mapping Sample ==
SPACE: Toggle tone-mapping OFF or ON
Y: Increase white-point
H: Decrease white-point
May 13, 2021 2:28:58 PM com.jme3.material.Material checkTextureParamColorSpace
WARNING: The texture Textures/HdrTest/Memorial.hdr has linear color space, but the material parameter ColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Tone Mapping OFF
Tone Mapping ON
May 13, 2021 2:29:00 PM com.jme3.app.LegacyApplication handleError
SEVERE: An OpenGL error has occurred!
org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.checkGLError(LwjglAbstractDisplay.java:145)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:166)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:201)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:242)
at java.lang.Thread.run(Thread.java:748)
After enabling graphics debug:
Tone Mapping OFF
Tone Mapping ON
[JME3] OpenGL debug message
ID: 1282
Source: API
Type: ERROR
Severity: HIGH
Message: GL_INVALID_OPERATION error generated. Render buffer not bound.
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at com.jme3.system.lwjgl.LwjglGLDebugOutputHandler.handleMessage(LwjglGLDebugOutputHandler.java:76)
at org.lwjgl.opengl.GL30.nglRenderbufferStorage(Native Method)
at org.lwjgl.opengl.GL30.glRenderbufferStorage(GL30.java:1079)
at com.jme3.renderer.lwjgl.LwjglGLFboGL3.glRenderbufferStorageEXT(LwjglGLFboGL3.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:107)
at com.sun.proxy.$Proxy2.glRenderbufferStorageEXT(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.updateRenderBuffer(GLRenderer.java:1812)
at com.jme3.renderer.opengl.GLRenderer.updateFrameBufferAttachment(GLRenderer.java:1869)
at com.jme3.renderer.opengl.GLRenderer.updateFrameBuffer(GLRenderer.java:1922)
at com.jme3.renderer.opengl.GLRenderer.setFrameBuffer(GLRenderer.java:2076)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1102)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1180)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:273)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:160)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:201)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:242)
at java.lang.Thread.run(Thread.java:748)
May 13, 2021 2:30:58 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
com.jme3.renderer.RendererException: An OpenGL error occurred - Invalid operation (Error Code: 1282)
at com.jme3.renderer.opengl.GLDebug.checkError(GLDebug.java:101)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:113)
at com.sun.proxy.$Proxy2.glRenderbufferStorageEXT(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.updateRenderBuffer(GLRenderer.java:1812)
at com.jme3.renderer.opengl.GLRenderer.updateFrameBufferAttachment(GLRenderer.java:1869)
at com.jme3.renderer.opengl.GLRenderer.updateFrameBuffer(GLRenderer.java:1922)
at com.jme3.renderer.opengl.GLRenderer.setFrameBuffer(GLRenderer.java:2076)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1102)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1180)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:273)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:160)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:201)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:242)
at java.lang.Thread.run(Thread.java:748)
This issue has been present since at least v3.1.0-stable, so it's not a recent regression.
Thanks, Riccardo!
I am testing this with the master branch, can't reproduce. Is this happening also with lwjgl3?
If you are still able to reproduce it, can you try change lines 1787-1790 in GLRenderer.java from
if (context.boundRB != id) {
glfbo.glBindRenderbufferEXT(GLFbo.GL_RENDERBUFFER_EXT, id);
context.boundRB = id;
}
to
//if (context.boundRB != id) {
glfbo.glBindRenderbufferEXT(GLFbo.GL_RENDERBUFFER_EXT, id);
context.boundRB = id;
//}
causing the framebuffer to be rebound every call, in case we are dealing with some sort of driver issue that unbounds the framebuffer...
Thank you for your investigations so far.
I just now reproduced the issue in the latest "master" branch, but only with LWJGL v2.
With LWJGL v3, I failed to reproduce the issue.
I tried commenting out the id
test per your suggestion, in "master" with LWJGL v2, and this resolved the issue.
Mhh, what is the value of fbOnLoad in GLRenderer line 637 ?
In the "v3.4" branch with LWJGL v2, it's 0.
If you're convinced this is a driver bug with no obvious workaround, then let's close this issue.
I am not entirely sure, i'd like to investigate it some more
Okay. Let me know if I can assist in any way.
I reproduced the crash on different hardware (GeForce RTX 2070), running Windows 10, so apparently it's not driver-specific. I'm still seeing the crash only with LWJGL 2.9.3, not with LWJGL 3.
I can not reproduce the crash. I am testing on Linux with LWJGL 2 and Mesa graphics driver.
> Task :jme3-examples:TestToneMapFilter.main()
Feb 09, 2023 11:57:42 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.7.0-SNAPSHOT
* Branch: master
* Git Hash: aaabd10
* Build Date: 2023-02-09
Feb 09, 2023 11:57:44 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.5 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
Feb 09, 2023 11:57:44 AM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: X.Org
* Renderer: AMD CEDAR (DRM 2.50.0 / 5.4.0-58-generic, LLVM 10.0.0)
* OpenGL Version: 3.3 (Core Profile) Mesa 20.0.8
* GLSL Version: 3.30
* Profile: Core
Feb 09, 2023 11:57:44 AM 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
Feb 09, 2023 11:57:44 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
Feb 09, 2023 11:57:44 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Feb 09, 2023 11:57:44 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 4
== Tone Mapping Sample ==
SPACE: Toggle tone-mapping OFF or ON
Y: Increase white-point
H: Decrease white-point
Feb 09, 2023 11:57:46 AM com.jme3.material.Material checkTextureParamColorSpace
WARNING: The texture Textures/HdrTest/Memorial.hdr has linear color space, but the material parameter ColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Tone Mapping OFF
Tone Mapping ON
Because of the following code https://github.com/jMonkeyEngine/jmonkeyengine/blob/aaabd104771019e1a627696a98f5de5794c3c4cc/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java#L166
assertions must be enabled in order to reproduce this crash.
@Ali-RS Please check whether assertions are enabled in your test environment.
I'm still able to reproduce this issue in "master" branch. With Linux, LWJGL v2.9.5, NVIDIA GeForce graphics, and Core 3.2 profile:
Feb 10, 2023 9:34:03 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.7.0-SNAPSHOT
* Branch: master
* Git Hash: aaabd10
* Build Date: 2023-02-10
Feb 10, 2023 9:34:04 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.5 context running on thread jME3 Main
* Graphics Adapter: null
* Driver Version: null
* Scaling Factor: 1
Feb 10, 2023 9:34:04 AM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: GeForce GT 545/PCIe/SSE2
* OpenGL Version: 3.2.0 NVIDIA 390.157
* GLSL Version: 1.50 NVIDIA via Cg compiler
* Profile: Core
Feb 10, 2023 9:34:04 AM 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
Feb 10, 2023 9:34:04 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
Feb 10, 2023 9:34:04 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Feb 10, 2023 9:34:04 AM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 4
== Tone Mapping Sample ==
SPACE: Toggle tone-mapping OFF or ON
Y: Increase white-point
H: Decrease white-point
Feb 10, 2023 9:34:04 AM com.jme3.material.Material checkTextureParamColorSpace
WARNING: The texture Textures/HdrTest/Memorial.hdr has linear color space, but the material parameter ColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Tone Mapping OFF
Tone Mapping ON
Feb 10, 2023 9:34:07 AM com.jme3.app.LegacyApplication handleError
SEVERE: An OpenGL error has occurred!
org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.checkGLError(LwjglAbstractDisplay.java:145)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:166)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:224)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:242)
at java.base/java.lang.Thread.run(Thread.java:833)
I also reproduced it with Compatibility profile.
To enable assertions, I added the following code to jme3-examples/build.gradle:
tasks.withType(JavaExec) { // Java runtime options:
enableAssertions true
}
Even with assertions enabled, I can not reproduce the crash.