Posted by
Sven Gothel on
Sep 29, 2014; 6:56pm
URL: https://forum.jogamp.org/Jogl-Using-Wrong-Generic-Graphics-Adapter-tp4033216p4033242.html
On 09/29/2014 03:41 PM, sfriend [via jogamp] wrote:
> I get the same problem without disable.openarbcontext , originally I thought
> it was an ARBContext Creation problem, however the create context ARB was
> failing due to this generic adapter not supporting the capabilities. See below
> for a log with the ARB create failure. This one also has
> debug.GraphicsConfiguration enabled. Strange thing with this case is every
> time it fails, I see setPixelFormat (post): hdc 0xffffffffa3010735, 32 -> 2,
> like the pixel format is already set when it should be a new window (glcanvas).
>
> This problem is killing me , because I can't seem to recreate it in a smaller
> application and sometimes it takes me 1/2 hour to recreate it. Other times
> happens immediately.
>
> Thanks for any ideas
Oh, trying to get an idea here.
+++
Question: Why don't I see GLProfile initialization here ?
I.e. the probing of available OpenGL profiles using the shared-resource?
- Have you cut that from the log files ?
- Do you use a 'vanilla' JOGL version ?
Can you reproduce w/ full logs ?
+++
> I see setPixelFormat (post): hdc 0xffffffffa3010735, 32 -> 2,
> like the pixel format is already set when it should be a new window (glcanvas).
Indeed this seems to be fishy,
i.e. that HDC 0xffffffffa3010735 is being used from the
shared drawable (1) and later for finishing the drawable via update (2).
(1) Preselection of Config
LOG#802: updateGraphicsConfiguration(using shared): hdc 0xffffffffa3010735
user chosen caps GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]
updateGraphicsConfigurationARB: hdc 0xffffffffa3010735, pfdIDCount(hdc) 107, capsChosen GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]], WINDOW
isOpaque true (translucency requested: false, compositioning enabled: true)
extHDC true, chooser true, pformatsNum -1
wglChoosePixelFormatARB: NumFormats (wglChoosePixelFormatARB) accelMode 0x2027: 20
..
LOG#849: updateGraphicsConfigurationARB: Used wglChoosePixelFormatARB to recommend pixel format 2, idx 0, GLCaps[wgl vid 2 arb: rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 24/8/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at javax.media.opengl.DefaultGLCapabilitiesChooser.chooseCapabilities(DefaultGLCapabilitiesChooser.java:125)
at jogamp.opengl.GLGraphicsConfigurationFactory.chooseCapabilities(GLGraphicsConfigurationFactory.java:65)
at jogamp.opengl.windows.wgl.WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfigurationARB(WindowsWGLGraphicsConfigurationFactory.java:436)
at jogamp.opengl.windows.wgl.WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(WindowsWGLGraphicsConfigurationFactory.java:302)
at jogamp.opengl.windows.wgl.WindowsWGLGraphicsConfigurationFactory.preselectGraphicsConfiguration(WindowsWGLGraphicsConfigurationFactory.java:271)
at jogamp.opengl.windows.wgl.WindowsWGLGraphicsConfiguration.preselectGraphicsConfiguration(WindowsWGLGraphicsConfiguration.java:155)
at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:129)
at javax.media.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:422)
at javax.media.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1421)
at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:630)
This is the preselection path 'preselectGraphicsConfiguration'
of the gfx-config for Windows,
i.e. the native surface is not yet available - but we attempt to match
the requested caps based on the shared drawable's (HDC) capabilities.
Note, the shared drawable's HDC is 0xffffffffa3010735 here,
and we really shall not use this shared HDC but our own!
What we really miss in the log files is something like:
'setPixelFormat (post): hdc 0xffffffffa3010735, 0 -> 32, set: true'
...
(2) Final selection of Config
LOG#1048: setPixelFormat (post): hdc 0xffffffffa3010735, 32 -> 2, set: false
AWT-EventQueue-0: WindowsWGLDrawable.setRealized(true): WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 0], pfdID 2, ARB-Choosen true,
requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
chosen GLCaps[wgl vid 2 arb: rgba 8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms 24/8/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]]
AWT-EventQueue-0: Realized Drawable: isRealized true, WindowsOnscreenWGLDrawable[Realized true,
...
LOG#1085: JOGL-GLWorkerThread- - WindowWGLContext.createContextARBImpl: 4.4 (Compat profile, arb, ES2 compat, ES3 compat, FBO, hardware) - @creation, handle 0xffffffffa3010735, share 0x20000, direct true, wglCreateContextAttribsARB: 0x5d2bb0f0
...
Here we see that the HDC of the shared config 0xffffffffa3010735
is still being used, which finally ends up to select the very restricted context.
Question is, why does the JAWT NativeSurface of the new GLCanvas use the same HDC
as the shared-drawable (for probing) ?
~Sven