Description
Julien Gouesse
2014-09-23 10:14:06 CEST
Created attachment 640 [details]
crash logs
This demo works: http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-cube.html The others only display nothing. This demo works too: http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-angelesgl2es1.html This demos work: http://jogamp.org/deployment/jogamp-current/jogl-demos/applet-gears.html http://jogamp.org/deployment/jogamp-current/jogl-demos/jogl-newt-applet-runner-gears.html but not this one: http://jogamp.org/deployment/jogamp-next/jogl-applet-runner-newt-gears-normal-napplet.html These demos work: http://jogamp.org/deployment/jogamp-next/jogl-demos/Gears.jnlp http://jogamp.org/deployment/jogamp-current/jogl-demos/Gears.jnlp I'm going to test pbuffers. Created attachment 641 [details]
Stacktrace when running a simple Java3D example using a JCanvas
Created attachment 642 [details]
Source code of the simple Java3D example using a JCanvas
Created attachment 643 [details]
Full debug logs when trying to create a JCanvas3D
This valid capabilities object: GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL2/GL2.hw], on-scr[fbo, pbuffer]] becomes: GLCaps[rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[pbuffer]]] whereas this hardware doesn't support pbuffers for offscreen rendering. It's a JOGL bug, a few unit tests fail: [junit] Testcase: test01_aa0 took 1,591 sec [junit] Caused an ERROR [junit] javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] java.lang.RuntimeException: javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:98) [junit] at javax.media.opengl.awt.GLCanvas.setupPrint(GLCanvas.java:840) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context$1.run(AWTPrintLifecycle.java:154) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:130) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:128) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:172) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:125) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintImpl(TiledPrintingAWTBase.java:218) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAutoImpl(TiledPrintingAWTBase.java:166) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAuto(TiledPrintingAWTBase.java:126) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.runTestGL(TestTiledPrintingGearsAWT.java:181) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.test01_aa0(TestTiledPrintingGearsAWT.java:244) [junit] Caused by: javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] at jogamp.opengl.windows.wgl.WindowsPbufferWGLDrawable.createPbuffer(WindowsPbufferWGLDrawable.java:159) [junit] at jogamp.opengl.windows.wgl.WindowsPbufferWGLDrawable.setRealizedImpl(WindowsPbufferWGLDrawable.java:75) [junit] at jogamp.opengl.GLDrawableImpl.setRealized(GLDrawableImpl.java:196) [junit] at jogamp.opengl.GLDrawableFactoryImpl.createOffscreenAutoDrawable(GLDrawableFactoryImpl.java:278) [junit] at javax.media.opengl.awt.GLCanvas$5.run(GLCanvas.java:896) [junit] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301) [junit] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744) [junit] at java.awt.EventQueue.access$400(EventQueue.java:97) [junit] at java.awt.EventQueue$3.run(EventQueue.java:697) [junit] at java.awt.EventQueue$3.run(EventQueue.java:691) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [junit] at java.awt.EventQueue.dispatchEvent(EventQueue.java:714) [junit] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [junit] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [junit] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [junit] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [junit] Testcase: test02_aa8 took 0,374 sec [junit] Caused an ERROR [junit] javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] java.lang.RuntimeException: javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:98) [junit] at javax.media.opengl.awt.GLCanvas.setupPrint(GLCanvas.java:840) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context$1.run(AWTPrintLifecycle.java:154) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:130) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:128) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:172) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:125) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintImpl(TiledPrintingAWTBase.java:218) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAutoImpl(TiledPrintingAWTBase.java:166) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAuto(TiledPrintingAWTBase.java:126) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.runTestGL(TestTiledPrintingGearsAWT.java:181) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.test02_aa8(TestTiledPrintingGearsAWT.java:252) [junit] Caused by: javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format [junit] at jogamp.opengl.windows.wgl.WindowsPbufferWGLDrawable.createPbuffer(WindowsPbufferWGLDrawable.java:159) [junit] at jogamp.opengl.windows.wgl.WindowsPbufferWGLDrawable.setRealizedImpl(WindowsPbufferWGLDrawable.java:75) [junit] at jogamp.opengl.GLDrawableImpl.setRealized(GLDrawableImpl.java:196) [junit] at jogamp.opengl.GLDrawableFactoryImpl.createOffscreenAutoDrawable(GLDrawableFactoryImpl.java:278) [junit] at javax.media.opengl.awt.GLCanvas$5.run(GLCanvas.java:896) [junit] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301) [junit] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744) [junit] at java.awt.EventQueue.access$400(EventQueue.java:97) [junit] at java.awt.EventQueue$3.run(EventQueue.java:697) [junit] at java.awt.EventQueue$3.run(EventQueue.java:691) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [junit] at java.awt.EventQueue.dispatchEvent(EventQueue.java:714) [junit] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [junit] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [junit] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [junit] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) I could need the debug log file w/ old JOGL .. working (I mentioned it earlier). This would help me finding the regression. Julien added via chat: +++ There is no trivial way of fixing this bug, the "fixed" capabilities object is used here: https://github.com/sgothel/jogl/blob/master/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java#L306 I would prefer using the "best" real capabilities object +++ Setting pbufferAvailable to false in fixOffscreenGLCapabilities doesn't solve the problem: Testcase: test01_aa0 took 0,531 sec [junit] Caused an ERROR [junit] javax.media.opengl.GLException: Error making context 0x10001 current on Thread AWT-EventQueue-0, drawableWrite 0x17010f91, drawableRead 0x17010f91, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x7b546212, handle 0x10001, isShared false, jogamp.opengl.gl4.GL4bcImpl@345b766e, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x17010f91, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x17010f91 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <78b64fef, 7bd383>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] java.lang.RuntimeException: javax.media.opengl.GLException: Error making context 0x10001 current on Thread AWT-EventQueue-0, drawableWrite 0x17010f91, drawableRead 0x17010f91, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x7b546212, handle 0x10001, isShared false, jogamp.opengl.gl4.GL4bcImpl@345b766e, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x17010f91, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x17010f91 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <78b64fef, 7bd383>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:98) [junit] at javax.media.opengl.awt.GLCanvas.setupPrint(GLCanvas.java:840) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context$1.run(AWTPrintLifecycle.java:154) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:130) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:128) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:172) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:125) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintImpl(TiledPrintingAWTBase.java:218) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAutoImpl(TiledPrintingAWTBase.java:166) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAuto(TiledPrintingAWTBase.java:126) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.runTestGL(TestTiledPrintingGearsAWT.java:181) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.test01_aa0(TestTiledPrintingGearsAWT.java:244) [junit] Caused by: javax.media.opengl.GLException: Error making context 0x10001 current on Thread AWT-EventQueue-0, drawableWrite 0x17010f91, drawableRead 0x17010f91, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x7b546212, handle 0x10001, isShared false, jogamp.opengl.gl4.GL4bcImpl@345b766e, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x17010f91, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x17010f91 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <78b64fef, 7bd383>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] at jogamp.opengl.windows.wgl.WindowsWGLContext.makeCurrentImpl(WindowsWGLContext.java:409) [junit] at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:780) [junit] at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:592) [junit] at jogamp.opengl.GLContextImpl.setGLDrawable(GLContextImpl.java:269) [junit] at jogamp.opengl.GLDrawableHelper.switchContext(GLDrawableHelper.java:252) [junit] at jogamp.opengl.GLAutoDrawableBase.setContext(GLAutoDrawableBase.java:507) [junit] at com.jogamp.opengl.GLEventListenerState.moveTo(GLEventListenerState.java:487) [junit] at com.jogamp.opengl.util.GLDrawableUtil.swapGLContextAndAllGLEventListener(GLDrawableUtil.java:235) [junit] at javax.media.opengl.awt.GLCanvas$5.run(GLCanvas.java:899) [junit] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301) [junit] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744) [junit] at java.awt.EventQueue.access$400(EventQueue.java:97) [junit] at java.awt.EventQueue$3.run(EventQueue.java:697) [junit] at java.awt.EventQueue$3.run(EventQueue.java:691) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [junit] at java.awt.EventQueue.dispatchEvent(EventQueue.java:714) [junit] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [junit] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [junit] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [junit] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [junit] Testcase: test02_aa8 took 0,359 sec [junit] Caused an ERROR [junit] javax.media.opengl.GLException: Error making context 0x10003 current on Thread AWT-EventQueue-0, drawableWrite 0x4a010fa2, drawableRead 0x4a010fa2, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x3b1438af, handle 0x10003, isShared false, jogamp.opengl.gl4.GL4bcImpl@457a8583, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x4a010fa2, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x4a010fa2 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <6a56b2b5, 701d2e10>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] java.lang.RuntimeException: javax.media.opengl.GLException: Error making context 0x10003 current on Thread AWT-EventQueue-0, drawableWrite 0x4a010fa2, drawableRead 0x4a010fa2, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x3b1438af, handle 0x10003, isShared false, jogamp.opengl.gl4.GL4bcImpl@457a8583, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x4a010fa2, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x4a010fa2 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <6a56b2b5, 701d2e10>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:98) [junit] at javax.media.opengl.awt.GLCanvas.setupPrint(GLCanvas.java:840) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context$1.run(AWTPrintLifecycle.java:154) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:130) [junit] at jogamp.nativewindow.awt.AWTMisc.performAction(AWTMisc.java:128) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:172) [junit] at com.jogamp.nativewindow.awt.AWTPrintLifecycle$Context.setupPrint(AWTPrintLifecycle.java:125) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintImpl(TiledPrintingAWTBase.java:218) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAutoImpl(TiledPrintingAWTBase.java:166) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TiledPrintingAWTBase.doPrintAuto(TiledPrintingAWTBase.java:126) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.runTestGL(TestTiledPrintingGearsAWT.java:181) [junit] at com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT.test02_aa8(TestTiledPrintingGearsAWT.java:252) [junit] Caused by: javax.media.opengl.GLException: Error making context 0x10003 current on Thread AWT-EventQueue-0, drawableWrite 0x4a010fa2, drawableRead 0x4a010fa2, werr: 0, WindowsWGLContext [Version 1.4 (Compat profile, hardware) - 1.4.0 - Build 8.14.10.1930 [GL 1.4.0, vendor 8.14.10 (- Build 8.14.10.1930)], options 0x2, this 0x3b1438af, handle 0x10003, isShared false, jogamp.opengl.gl4.GL4bcImpl@457a8583, [junit] quirks: [NoDoubleBufferedBitmap], [junit] Drawable: WindowsBitmapWGLDrawable[Realized true, [junit] Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@55daaa71, [junit] Handle 0x4a010fa2, [junit] Surface WrappedSurface[ displayHandle 0x0 [junit] , surfaceHandle 0x4a010fa2 [junit] , size 1024x1024 [junit] , UOB[ OWNS_DEVICE ] [junit] , WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 20, ARB-Choosen false, [junit] requested GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]], [junit] chosen GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]]] [junit] , surfaceLock <6a56b2b5, 701d2e10>[count 3, qsz 0, owner <AWT-EventQueue-0>] [junit] , UpstreamSurfaceHookMutableSize[pixel 1024x1024] [junit] , upstreamSurface false ]]] [junit] at jogamp.opengl.windows.wgl.WindowsWGLContext.makeCurrentImpl(WindowsWGLContext.java:409) [junit] at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:780) [junit] at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:592) [junit] at jogamp.opengl.GLContextImpl.setGLDrawable(GLContextImpl.java:269) [junit] at jogamp.opengl.GLDrawableHelper.switchContext(GLDrawableHelper.java:252) [junit] at jogamp.opengl.GLAutoDrawableBase.setContext(GLAutoDrawableBase.java:507) [junit] at com.jogamp.opengl.GLEventListenerState.moveTo(GLEventListenerState.java:487) [junit] at com.jogamp.opengl.util.GLDrawableUtil.swapGLContextAndAllGLEventListener(GLDrawableUtil.java:235) [junit] at javax.media.opengl.awt.GLCanvas$5.run(GLCanvas.java:899) [junit] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301) [junit] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744) [junit] at java.awt.EventQueue.access$400(EventQueue.java:97) [junit] at java.awt.EventQueue$3.run(EventQueue.java:697) [junit] at java.awt.EventQueue$3.run(EventQueue.java:691) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) [junit] at java.awt.EventQueue.dispatchEvent(EventQueue.java:714) [junit] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [junit] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [junit] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [junit] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [junit] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [junit] Test com.jogamp.opengl.test.junit.jogl.tile.TestTiledPrintingGearsAWT FAILED Created attachment 644 [details]
debug logs with Java3D 1.6.0 pre11 + JOGL 2.1.5
Created attachment 645 [details]
debug logs with Java3D 1.6.0 pre9 + JOGL 2.1.5
It was already broken in JOGL 2.1.5 even when I use it with Java3D 1.6.0 pre9. Created attachment 646 [details]
pbuffers unit tests
Pbuffers seem to work according to the unit test com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT. I've just tested com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT but with caps2.setBitmap(true) in order to test the bitmaps, it works: [junit] Testsuite: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT [junit] Thread-1 - SISock: localhost/127.0.0.1:59999 - started [junit] SLOCK [T main @ 1411980446565 ms +++ localhost/127.0.0.1:59999 - Locked within 1029 ms, 1 attempts [junit] ++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test11OffscreenWindowPixmap [junit] Thread[main,5,main] RedSquareES1.init ... [junit] RedSquareES1 init on Thread[main,5,main] [junit] Chosen GLCapabilities: GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]] [junit] INIT GL IS: jogamp.opengl.gl4.GL4bcImpl [junit] Swap Interval -1 [junit] GL Profile GLProfile[GL2ES1/GL2.hw] [junit] GL Version 1.1 (Compat profile, software) - 1.1.0 [GL 1.1.0, vendor 0.0.0 (n/a)] [junit] Quirks [NoDoubleBufferedBitmap] [junit] Impl. class jogamp.opengl.gl4.GL4bcImpl [junit] GL_VENDOR Microsoft Corporation [junit] GL_RENDERER GDI Generic [junit] GL_VERSION 1.1.0 [junit] GLSL false, has-compiler-func: false [junit] GL FBO: basic false, full false [junit] GL_EXTENSIONS 3 [junit] GLX_EXTENSIONS 0 [junit] ----------------------------------------------------------------------------------------------------- [junit] Thread[main,5,main] RedSquareES1.init FIN [junit] Thread[main,5,main] RedSquareES1.reshape 0/0 640x480 of 640x480, swapInterval 1, drawable 0x48010dcd, tileRendererInUse null [junit] Thread[main,5,main] RedSquareES1.reshape FIN [junit] Thread[main-Display-.windows_nil-1-EDT-1,5,main] RedSquareES1.dispose ... [junit] Thread[main-Display-.windows_nil-1-EDT-1,5,main] RedSquareES1.dispose FIN [junit] ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test11OffscreenWindowPixmap [junit] ++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test14OffscreenSnapshotWithDemoPixmap [junit] Thread[main,5,main] RedSquareES1.init ... [junit] RedSquareES1 init on Thread[main,5,main] [junit] Chosen GLCapabilities: GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]] [junit] INIT GL IS: jogamp.opengl.gl4.GL4bcImpl [junit] Swap Interval -1 [junit] GL Profile GLProfile[GL2ES1/GL2.hw] [junit] GL Version 1.1 (Compat profile, software) - 1.1.0 [GL 1.1.0, vendor 0.0.0 (n/a)] [junit] Quirks [NoDoubleBufferedBitmap] [junit] Impl. class jogamp.opengl.gl4.GL4bcImpl [junit] GL_VENDOR Microsoft Corporation [junit] GL_RENDERER GDI Generic [junit] GL_VERSION 1.1.0 [junit] GLSL false, has-compiler-func: false [junit] GL FBO: basic false, full false [junit] GL_EXTENSIONS 3 [junit] GLX_EXTENSIONS 0 [junit] ----------------------------------------------------------------------------------------------------- [junit] Thread[main,5,main] RedSquareES1.init FIN [junit] Thread[main,5,main] RedSquareES1.reshape 0/0 640x480 of 640x480, swapInterval 1, drawable 0x47010e14, tileRendererInUse null [junit] Thread[main,5,main] RedSquareES1.reshape FIN [junit] Thread[main-Display-.windows_nil-1-EDT-3,5,main] RedSquareES1.dispose ... [junit] Thread[main-Display-.windows_nil-1-EDT-3,5,main] RedSquareES1.dispose FIN [junit] ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test14OffscreenSnapshotWithDemoPixmap [junit] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6,489 sec [junit] ------------- Standard Error ----------------- [junit] Thread-1 - SISock: localhost/127.0.0.1:59999 - started [junit] SLOCK [T main @ 1411980446565 ms +++ localhost/127.0.0.1:59999 - Locked within 1029 ms, 1 attempts [junit] ++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test11OffscreenWindowPixmap [junit] Thread[main,5,main] RedSquareES1.init ... [junit] RedSquareES1 init on Thread[main,5,main] [junit] Chosen GLCapabilities: GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]] [junit] INIT GL IS: jogamp.opengl.gl4.GL4bcImpl [junit] Swap Interval -1 [junit] GL Profile GLProfile[GL2ES1/GL2.hw] [junit] GL Version 1.1 (Compat profile, software) - 1.1.0 [GL 1.1.0, vendor 0.0.0 (n/a)] [junit] Quirks [NoDoubleBufferedBitmap] [junit] Impl. class jogamp.opengl.gl4.GL4bcImpl [junit] GL_VENDOR Microsoft Corporation [junit] GL_RENDERER GDI Generic [junit] GL_VERSION 1.1.0 [junit] GLSL false, has-compiler-func: false [junit] GL FBO: basic false, full false [junit] GL_EXTENSIONS 3 [junit] GLX_EXTENSIONS 0 [junit] ----------------------------------------------------------------------------------------------------- [junit] Thread[main,5,main] RedSquareES1.init FIN [junit] Thread[main,5,main] RedSquareES1.reshape 0/0 640x480 of 640x480, swapInterval 1, drawable 0x48010dcd, tileRendererInUse null [junit] Thread[main,5,main] RedSquareES1.reshape FIN [junit] Thread[main-Display-.windows_nil-1-EDT-1,5,main] RedSquareES1.dispose ... [junit] Thread[main-Display-.windows_nil-1-EDT-1,5,main] RedSquareES1.dispose FIN [junit] ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test11OffscreenWindowPixmap [junit] ++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test14OffscreenSnapshotWithDemoPixmap [junit] Thread[main,5,main] RedSquareES1.init ... [junit] RedSquareES1 init on Thread[main,5,main] [junit] Chosen GLCapabilities: GLCaps[wgl vid 20 gdi: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/0, dp/st/ms 16/8/0, one, mono , sw, GLProfile[GL2/GL2.hw], offscr[bitmap]] [junit] INIT GL IS: jogamp.opengl.gl4.GL4bcImpl [junit] Swap Interval -1 [junit] GL Profile GLProfile[GL2ES1/GL2.hw] [junit] GL Version 1.1 (Compat profile, software) - 1.1.0 [GL 1.1.0, vendor 0.0.0 (n/a)] [junit] Quirks [NoDoubleBufferedBitmap] [junit] Impl. class jogamp.opengl.gl4.GL4bcImpl [junit] GL_VENDOR Microsoft Corporation [junit] GL_RENDERER GDI Generic [junit] GL_VERSION 1.1.0 [junit] GLSL false, has-compiler-func: false [junit] GL FBO: basic false, full false [junit] GL_EXTENSIONS 3 [junit] GLX_EXTENSIONS 0 [junit] ----------------------------------------------------------------------------------------------------- [junit] Thread[main,5,main] RedSquareES1.init FIN [junit] Thread[main,5,main] RedSquareES1.reshape 0/0 640x480 of 640x480, swapInterval 1, drawable 0x47010e14, tileRendererInUse null [junit] Thread[main,5,main] RedSquareES1.reshape FIN [junit] Thread[main-Display-.windows_nil-1-EDT-3,5,main] RedSquareES1.dispose ... [junit] Thread[main-Display-.windows_nil-1-EDT-3,5,main] RedSquareES1.dispose FIN [junit] ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT - test14OffscreenSnapshotWithDemoPixmap [junit] SLOCK [T main @ 1411980451916 ms --- localhost/127.0.0.1:59999 - Unlock ok within 0 ms [junit] ------------- ---------------- --------------- [junit] Testcase: test11OffscreenWindowPixmap took 3,432 sec [junit] Testcase: test14OffscreenSnapshotWithDemoPixmap took 1,825 sec [junit] SLOCK [T main @ 1411980451916 ms --- localhost/127.0.0.1:59999 - Unlock ok within 0 ms The creation of a pbuffer works with this capabilities object: GLCaps[wgl vid 3 arb: rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2ES1/GL2.hw], offscr[pbuffer]] The creation of a pbuffer fails with this capabilities object: GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, one, mono , hw, GLProfile[GL2/GL2.hw], offscr[pbuffer]] There are 2 differences with the previous one: - accum bits - ES1 support Created attachment 647 [details]
Debug logs of the simple Java3D example using a JCanvas3D but with a small hack in JOGL
Setting the accum bits to zero in fixOffscreenGLCapabilities allows to make Java3D work anew :) Created attachment 648 [details]
TestTiledPrintingGearsAWT full logs
Created attachment 649 [details]
TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT logs
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index f81d2f2..2c29885 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -341,8 +341,24 @@ */ public static final int BuggyColorRenderbuffer = 18; + /** + * Some Intel drivers under Windows wrongly claims to support pbuffers + * with accumulation buffers. Then, the creation of a pbuffer fails: + * javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format + * <p> + * Appears on: + * <ul> + * <li>GL_VENDOR Intel</li> + * <li>GL_RENDERER Intel Bear Lake B</li> + * <li>GL_VERSION 1.4.0 - Build 8.14.10.1930</li> + * </ul> + * + * </p> + */ + public static final int NoPBufferWithAccum = 19; + /** Number of quirks known. */ - public static final int COUNT = 19; + public static final int COUNT = 20; private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval", "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard", @@ -350,7 +366,7 @@ "NeedCurrCtx4ARBPixFmtQueries", "NeedCurrCtx4ARBCreateContext", "NoFullFBOSupport", "GLSLNonCompliant", "GL4NeedsGL3Request", "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly", - "NoMultiSamplingBuffers", "BuggyColorRenderbuffer" + "NoMultiSamplingBuffers", "BuggyColorRenderbuffer", "NoPBufferWithAccum" }; private static final IdentityHashMap<String, GLRendererQuirks> stickyDeviceQuirks = new IdentityHashMap<String, GLRendererQuirks>(); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 01478a4..f1dee79 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1841,6 +1841,13 @@ quirks.addQuirk( quirk ); } } + if (glVendor.equals("Intel") && glRenderer.equals("Intel Bear Lake B")) { + final int quirk = GLRendererQuirks.NoPBufferWithAccum; + if(DEBUG) { + System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", [Vendor "+glVendor+" and Renderer "+glRenderer+"]"); + } + quirks.addQuirk( quirk ); + } } else if( Platform.OSType.ANDROID == Platform.getOSType() ) { // // ANDROID diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java index 465b5f5..cd82a70 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -50,6 +50,7 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.nativewindow.MutableGraphicsConfiguration; +import com.jogamp.opengl.GLRendererQuirks; import jogamp.nativewindow.windows.DWM_BLURBEHIND; import jogamp.nativewindow.windows.GDI; @@ -107,7 +108,7 @@ if(hasARB) { caps = wglARBPFID2GLCapabilities(sharedResource, device, glp, hdc, pfdID, GLGraphicsConfigurationUtil.ALL_BITS); } else { - caps = PFD2GLCapabilities(device, glp, hdc, pfdID, GLGraphicsConfigurationUtil.ALL_BITS); + caps = PFD2GLCapabilities(sharedResource, device, glp, hdc, pfdID, GLGraphicsConfigurationUtil.ALL_BITS); } if(null==caps) { throw new GLException("Couldn't choose Capabilities by: HDC 0x"+Long.toHexString(hdc)+ @@ -318,7 +319,7 @@ throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format " + pfdID + " of device context " + toHexString(hdc) + ", werr " + GDI.GetLastError()); } - return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits); + return AttribList2GLCapabilities(sharedResource, device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits); } static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, @@ -385,7 +386,7 @@ for(int i = 0; i<numFormats; i++) { if ( pfdIDs[i] >= 1 && ((WindowsWGLContext)sharedResource.getContext()).getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdIDs[i], 0, niattribs, iattributes, iresults) ) { - final GLCapabilitiesImmutable caps = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, winattrbits); + final GLCapabilitiesImmutable caps = AttribList2GLCapabilities(sharedResource, device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, winattrbits); if(null != caps) { bucket.add(caps); if(DEBUG) { @@ -396,7 +397,7 @@ break; } } else if(DEBUG) { - final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS); + final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(sharedResource, device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS); System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString()); } } else if (DEBUG) { @@ -476,10 +477,10 @@ } iattributes.put(niattribs++, WGLExt.WGL_DEPTH_BITS_ARB); iattributes.put(niattribs++, caps.getDepthBits()); - if (caps.getAccumRedBits() > 0 || + if (!caps.isPBuffer() && (caps.getAccumRedBits() > 0 || caps.getAccumGreenBits() > 0 || caps.getAccumBlueBits() > 0 || - caps.getAccumAlphaBits() > 0) { + caps.getAccumAlphaBits() > 0)) { iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BITS_ARB); iattributes.put(niattribs++, ( caps.getAccumRedBits() + caps.getAccumGreenBits() + @@ -537,7 +538,8 @@ return val; } - static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device, + static WGLGLCapabilities AttribList2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource, + final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final IntBuffer iattribs, final int niattribs, final IntBuffer iresults, final int winattrmask) { final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults); @@ -555,6 +557,9 @@ return null; } // non displayable requested (pbuffer) + } + if (/*(drawableTypeBits & GLGraphicsConfigurationUtil.PBUFFER_BIT) != 0 &&*/ /*sharedResource.getRendererQuirks().exist( GLRendererQuirks.NoPBufferWithAccum ) && */(pfd.getCAccumBits() != 0 || pfd.getCAccumRedBits() != 0 || pfd.getCAccumBlueBits() != 0 || pfd.getCAccumGreenBits() != 0)) { + return null; } final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp); res.setValuesByARB(iattribs, niattribs, iresults); @@ -593,7 +598,7 @@ return val; } - static WGLGLCapabilities PFD2GLCapabilities(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) { + static WGLGLCapabilities PFD2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) { final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID); if(null == pfd) { return null; @@ -620,6 +625,14 @@ return null; } } + //if( ( GLGraphicsConfigurationUtil.PBUFFER_BIT & drawableTypeBits ) != 0 ) { + if (/*sharedResource.getRendererQuirks().exist( GLRendererQuirks.NoPBufferWithAccum ) &&*/ (pfd.getCAccumBits() != 0 || pfd.getCAccumRedBits() != 0 || pfd.getCAccumBlueBits() != 0 || pfd.getCAccumGreenBits() != 0)) { + if(DEBUG) { + System.err.println("Drop [accum bits PBUFFER]: " + WGLGLCapabilities.PFD2String(pfd, pfdID)); + } + return null; + } + //} final WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp); res.setValuesByGDI(); @@ -680,6 +693,7 @@ pfd.setCGreenBits((byte) caps.getGreenBits()); pfd.setCBlueBits ((byte) caps.getBlueBits()); pfd.setCAlphaBits((byte) caps.getAlphaBits()); + if( !caps.isPBuffer() ) { final int accumDepth = (caps.getAccumRedBits() + caps.getAccumGreenBits() + caps.getAccumBlueBits()); @@ -688,6 +702,7 @@ pfd.setCAccumGreenBits((byte) caps.getAccumGreenBits()); pfd.setCAccumBlueBits ((byte) caps.getAccumBlueBits()); pfd.setCAccumAlphaBits((byte) caps.getAccumAlphaBits()); + } pfd.setCDepthBits((byte) caps.getDepthBits()); pfd.setCStencilBits((byte) caps.getStencilBits()); pfd.setILayerType((byte) GDI.PFD_MAIN_PLANE); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index ea92b38..310ed8c 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -144,7 +144,7 @@ availableCaps = WindowsWGLGraphicsConfigurationFactory.getAvailableGLCapabilitiesARB(sharedResource, sharedResource.getDevice(), glp, hdc); } final boolean hasARBCaps = null != availableCaps && !availableCaps.isEmpty() ; - final List<GLCapabilitiesImmutable> availableCapsGDI = getAvailableGLCapabilitiesGDI(device, glp, hdc, hasARBCaps); + final List<GLCapabilitiesImmutable> availableCapsGDI = getAvailableGLCapabilitiesGDI(sharedResource, device, glp, hdc, hasARBCaps); if( !hasARBCaps ) { availableCaps = availableCapsGDI; } else { @@ -171,12 +171,12 @@ GLGraphicsConfigurationUtil.ALL_BITS & ~GLGraphicsConfigurationUtil.BITMAP_BIT, false); // w/o BITMAP } - private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc, final boolean bitmapOnly) { + private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc, final boolean bitmapOnly) { final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc); final int numFormats = pformats.length; final List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats); for (int i = 0; i < numFormats; i++) { - final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i], + final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(sharedResource, device, glProfile, hdc, pformats[i], bitmapOnly ? GLGraphicsConfigurationUtil.BITMAP_BIT : GLGraphicsConfigurationUtil.ALL_BITS ); if(null != caps) { bucket.add(caps); @@ -302,7 +302,7 @@ done = updateGraphicsConfigurationARB((WindowsWGLDrawableFactory)factory, config, chooser, hdc, extHDC, pfdIDs); } if( !done ) { - updateGraphicsConfigurationGDI(config, chooser, hdc, extHDC, pfdIDs); + updateGraphicsConfigurationGDI((WindowsWGLDrawableFactory)factory, config, chooser, hdc, extHDC, pfdIDs); } } finally { if (null != sharedContext) { @@ -462,7 +462,7 @@ return true; } - private static boolean updateGraphicsConfigurationGDI(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser, final long hdc, + private static boolean updateGraphicsConfigurationGDI(final WindowsWGLDrawableFactory factory, final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser, final long hdc, final boolean extHDC, int[] pformats) { final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities(); if( !capsChosen.isOnscreen() && capsChosen.isPBuffer() ) { @@ -471,6 +471,7 @@ } return false; } + // final boolean onscreen = capsChosen.isOnscreen(); // final boolean useFBO = capsChosen.isFBO(); final GLProfile glProfile = capsChosen.getGLProfile(); @@ -483,6 +484,15 @@ } final AbstractGraphicsDevice device = config.getScreen().getDevice(); + //FIXME should NOT be null + final WindowsWGLDrawableFactory.SharedResource sharedResource = null;//factory.getOrCreateSharedResourceImpl(device); + + /*if (null == sharedResource) { + if (DEBUG) { + System.err.println("updateGraphicsConfigurationGDI: SharedResource is null: "+device); + } + return false; + }*/ WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps boolean pixelFormatSet = false; // indicates a preset PFD ID [caps] final int presetPFDID = extHDC ? -1 : WGLUtil.GetPixelFormat(hdc) ; @@ -496,7 +506,7 @@ + ", pixelformat " + presetPFDID); } pixelFormatSet = true; - pixelFormatCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, presetPFDID, winattrmask); + pixelFormatCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(sharedResource, device, glProfile, hdc, presetPFDID, winattrmask); if(null == pixelFormatCaps) { throw new GLException("Could not map PFD2GLCaps w/ already chosen pfdID "+presetPFDID); } @@ -520,7 +530,7 @@ for (chosenIdx = pformats.length - 1 ; 0 <= chosenIdx && chosenPFDID != pformats[chosenIdx]; chosenIdx--) { /* nop */ } if( 0 <= chosenIdx ) { if( _skipCapsChooser ) { - final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, chosenPFDID, winattrmask); + final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(sharedResource, device, glProfile, hdc, chosenPFDID, winattrmask); availableCaps.add(caps); recommendedIndex = 0; skipCapsChooser = true; @@ -533,7 +543,7 @@ } else { if(DEBUG) { final GLCapabilitiesImmutable reqPFDCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, pfd, chosenPFDID); - final GLCapabilitiesImmutable chosenCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, chosenPFDID, winattrmask); + final GLCapabilitiesImmutable chosenCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(sharedResource, device, glProfile, hdc, chosenPFDID, winattrmask); System.err.println("Chosen PFDID "+chosenPFDID+" (idx "+chosenIdx+"), but not found in available caps (use given pfdIDs "+givenPFormats+", reqPFDCaps "+reqPFDCaps+", chosenCaps: "+chosenCaps); } chosenPFDID = 0; // not found in pformats -> clear @@ -549,7 +559,7 @@ if( !skipCapsChooser ) { for (int i = 0; i < pformats.length; i++) { final int pfdid = pformats[i]; - final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pfdid, winattrmask); + final WGLGLCapabilities caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(sharedResource, device, glProfile, hdc, pfdid, winattrmask); if(null != caps) { availableCaps.add(caps); if(DEBUG) { @@ -587,7 +597,7 @@ pixelFormatCaps = (WGLGLCapabilities) availableCaps.get(chosenIndex); if (DEBUG) { System.err.println("chosen pfdID (GDI): recommendedIndex "+recommendedIndex+" -> chosenIndex "+ chosenIndex + ", skipCapsChooser "+skipCapsChooser+", caps " + pixelFormatCaps + - " (" + WGLGLCapabilities.PFD2String(pixelFormatCaps.getPFD(), pixelFormatCaps.getPFDID()) +")"); + " (" +/* WGLGLCapabilities.PFD2String(pixelFormatCaps.getPFD(), pixelFormatCaps.getPFDID()) +*/")"); } } Created attachment 650 [details]
patch (part 1), with the changes in GLRendererQuirks and GLContextImpl
4813455dc413fb37da28ed4845fb6f22c65629f4 Add Fallback in AWTPrintLifecycle.setupPrint(): Use Onscreen GLAD if Offscreen-GLAD Realization throws an Exception (Stability) - GLDrawableFactoryImpl: createOffscreenDrawable(..) and createDummyAutoDrawable(..) Temporary catch exception during setRealized(true) of newly created GLDrawable, to unrealize the instance before propagating the exception. This handling removes a memory leak in case the exception of this method is handled and application continues to operate, e.g. as in AWTPrintLifecycle.setupPrint(). The underlying drawable gets unrealized, since it's setRealized(boolean) implementation toggles its realize-state before delegating the realize-operation. Hence this is functional. - AWTPrintLifecycle.setupPrint() Stability Catch exception thrown by factory.createOffscreenAutoDrawable(..)'s setRealize(true) to continue operation w/ onscreen GLAD. (In reply to comment #27) > 4813455dc413fb37da28ed4845fb6f22c65629f4 > > Add Fallback in AWTPrintLifecycle.setupPrint(): > Use Onscreen GLAD if Offscreen-GLAD Realization throws an Exception > (Stability) > > - GLDrawableFactoryImpl: createOffscreenDrawable(..) and > createDummyAutoDrawable(..) > Temporary catch exception during setRealized(true) of newly created > GLDrawable, > to unrealize the instance before propagating the exception. > > This handling removes a memory leak in case the exception of this method > is handled > and application continues to operate, e.g. as in > AWTPrintLifecycle.setupPrint(). > > The underlying drawable gets unrealized, since it's setRealized(boolean) > implementation toggles its realize-state before delegating the > realize-operation. > Hence this is functional. > > - AWTPrintLifecycle.setupPrint() Stability > Catch exception thrown by factory.createOffscreenAutoDrawable(..)'s > setRealize(true) > to continue operation w/ onscreen GLAD. I'll give it a try tomorrow. Thanks. (In reply to comment #27) > 4813455dc413fb37da28ed4845fb6f22c65629f4 Part of Bug 1082 .. which gets into b22x. The quirk will only get into 2.3.0 since it may cause a regression due to complications and it is not that necessary to have 2.2.3 working. (In reply to comment #29) > (In reply to comment #27) > > 4813455dc413fb37da28ed4845fb6f22c65629f4 > > Part of Bug 1082 .. which gets into b22x. > > The quirk will only get into 2.3.0 since it > may cause a regression due to complications > and it is not that necessary to have 2.2.3 working. Ok I'll build JOGL by myself in the meantime. (In reply to comment #26) > Created attachment 650 [details] > patch (part 1), with the changes in GLRendererQuirks and GLContextImpl Pls provide the fix against current tip of master branch and if possible as a git patch/pull-req. Thank you. Created attachment 651 [details]
Full patch, working :)
Created attachment 652 [details]
Full patch, working :)
(In reply to comment #33) > Created attachment 652 [details] > Full patch, working :) I understand that you prepare a patch for current master tip using git. I would think that the quirk shall be applied while producing the GLCapabilities from ARB/PFD - not the other way around, i.e. producing the ARB/PFD bits for selection .. hmm. 99f91f8b28d42cdf341533736e878056bcae4708 Julien's patch: Adding GLRendererQuirks.NoPBufferWithAccum and avod setting accum bits in GLCapabilities2AttribList if quirk set. 1b5c2dbc9204a85eb63cea952b289f5012690f35 Accum buffer allowed if !usePBuffer; Avoid NPE. Created attachment 654 [details]
Some logs when blacklisting some capabilities objects with accum bits set
When I skip the capabilities objects with any accumulation buffer bit set to a non zero value, an exception is thrown during the realization of the drawable (pbuffer): https://jogamp.org/bugzilla/attachment.cgi?id=654 As you can see, there is no bit set for the accumulation buffer before calling wglChoosePixelFormatARB: [junit] main-Display-.windows_nil-1-EDT-1: Pbuffer chosenCaps: GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL2ES1/GL2.hw], offscr[pbuffer]] After calling wglChoosePixelFormatARB, several capabilities objects matching with the chosen pixel formats have some bits set for the accumulation buffer: [junit] 2 suitable pixel formats found [junit] pixel format 4 (index 0): GLCaps[wgl vid 4 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL2ES1/GL2.hw], offscr[pbuffer]] [junit] pixel format 6 (index 1): GLCaps[wgl vid 6 arb: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/8/0, dbl, mono , hw, GLProfile[GL2ES1/GL2.hw], offscr[pbuffer]] Skipping some "faulty" capabilities objects doesn't solve anything even though it seemed to be a smarter solution, ths exception is thrown: java.lang.RuntimeException: javax.media.opengl.GLException: pbuffer creation error: unable to re-query chosen PFD ID: 4, hdc 0xffffffffa3010eb9 In my humble opinion, the current fix is enough as it doesn't impact a lot of code, it's located within GLCapabilities2AttribList which is called only twice and always before calling wglChoosePixelFormatARB (which is "responsible" for this bug). Some logs should be ajusted but it goes beyond the scope of this bug report. The quirks are only sticky on this device: Quirks sticky on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]]: [] but when I check the quirks in PFD2GLCapabilities, I get this: Quirks: [] on device WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]] There is no sticky quirk in both cases but there are some quirks for the shared resource passed to GLCapabilities2AttribList. I don't understand what is wrong: [junit] Quirks local.0: [NoDoubleBufferedBitmap, NoPBufferWithAccum] [junit] Quirks local.X: [NoDoubleBufferedBitmap, NoPBufferWithAccum] [junit] Quirks sticky on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]]: [] I can't use GLRendererQuirks.existStickyDeviceQuirk(device, GLRendererQuirks.NoPBufferWithAccum). This code in GLContextImpl only adds some quirks into the default device, not into the current device "adevice": // Merge sticky quirks, thread safe due to single threaded initialization! GLRendererQuirks.pushStickyDeviceQuirks(adevice, quirks); final AbstractGraphicsDevice factoryDefaultDevice = factory.getDefaultDevice(); if( !GLRendererQuirks.areSameStickyDevice(factoryDefaultDevice, adevice) ) { GLRendererQuirks.pushStickyDeviceQuirks(factoryDefaultDevice, quirks); } The first line copies the sticky device quirks into "quirks", it doesn't set the quirks of "adevice". Created attachment 655 [details]
Patch of my attempt based on caps blacklisting (skipping)
(In reply to comment #39) > This code in GLContextImpl only adds some quirks into the default device, > not into the current device "adevice": Actually, only the context has some quirks and as the shared resource uses it internally, it works. commit 4b044d4de5272d45ec9b0b7b12ed40fa806d36e1: - Uses System.err instead of System.out in order to drive the debug logs more consistent, - adds a method to convert an attribute list into a capabilities object with no check in order to display some information about skipped capabilities objects and - fixes a NullPointerException when skipping a capabilities object Note: Your git config is 'odd': author unknown <gouessej@orange.fr> If you are happy with current state (I am), please close the bug. (In reply to comment #42) > Note: Your git config is 'odd': > author unknown <gouessej@orange.fr> > I forgot to set user.name to "Julien Gouesse" on one machine but my email address is explicit enough :) I fixed it but I chose not to amend the commit. > If you are happy with current state (I am), > please close the bug. I'm happy with the current state and you fixed the regression I introduced (because all machines I use need at least one quirk, I didn't see that one :s). When wglChoosePixelFormatARB picks a pixel format that you'd like to skip despite the parameters in input, skipping some capabilities objects is useless. This is the case for this bug whereas it isn't the case for the color bits (see PFD2GLCapabilities). Thank you for your help. |