diff options
author | Sven Gothel <sgothel@jausoft.com> | 2019-09-07 02:20:55 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2019-09-07 02:20:55 +0200 |
commit | 56a9f30fde429663514c6d5c810af2c43cb7ebf3 (patch) | |
tree | 0191fde8771314004642d85b2d5736d50d0200fe /src/jogl/classes/jogamp/opengl/windows/wgl | |
parent | 2ab629205c88978891271dd51cfa2a1669a6eec2 (diff) |
Bug 1391 Bug 1392: Implement GLRendererQuirks DontChooseFBConfigBestMatch and No10BitColorCompOffscreen
Further enhance unit tests TestGLProfile03NEWTOffscreen,
i.e. test all meta profile types on all offscreen drawable types (fbo, pbuffer and bitmap).
Align unit test name numbers of TestGLProfile01NEWT to TestGLProfile03NEWTOffscreen.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | 8 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java | 30 |
2 files changed, 31 insertions, 7 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java index 4ffe6e7d1..a54584964 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -375,10 +375,10 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio return pformats; } - static List <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource, - final AbstractGraphicsDevice device, final GLProfile glp, - final long hdc, final int[] pfdIDs, final int winattrbits, - final boolean onlyFirstValid) { + static ArrayList <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource, + final AbstractGraphicsDevice device, final GLProfile glp, + final long hdc, final int[] pfdIDs, final int winattrbits, + final boolean onlyFirstValid) { if (!sharedResource.hasARBPixelFormat()) { return null; } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 99268f13f..c365e8734 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -37,6 +37,7 @@ import com.jogamp.nativewindow.AbstractGraphicsConfiguration; import com.jogamp.nativewindow.AbstractGraphicsDevice; import com.jogamp.nativewindow.AbstractGraphicsScreen; import com.jogamp.nativewindow.CapabilitiesChooser; +import com.jogamp.nativewindow.CapabilitiesFilter; import com.jogamp.nativewindow.DefaultGraphicsScreen; import com.jogamp.nativewindow.GraphicsConfigurationFactory; import com.jogamp.nativewindow.CapabilitiesImmutable; @@ -46,6 +47,7 @@ import com.jogamp.nativewindow.ProxySurface; import com.jogamp.nativewindow.VisualIDHolder; import com.jogamp.opengl.GLCapabilitiesImmutable; import com.jogamp.opengl.GLCapabilitiesChooser; +import com.jogamp.opengl.GLCapabilitiesFilter; import com.jogamp.opengl.GLContext; import com.jogamp.opengl.GLDrawableFactory; import com.jogamp.opengl.GLException; @@ -354,6 +356,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat final int winattrbits = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen) & ~GLGraphicsConfigurationUtil.BITMAP_BIT; // w/o BITMAP final GLProfile glProfile = capsChosen.getGLProfile(); + final GLRendererQuirks glrq = factory.getRendererQuirks(device, glProfile); + final boolean isPBufferOrBitmap = capsChosen.isBitmap() || capsChosen.isPBuffer(); + final boolean dontChooseFBConfigBestMatch = GLRendererQuirks.exist(glrq, GLRendererQuirks.DontChooseFBConfigBestMatch) || + ( isPBufferOrBitmap && GLRendererQuirks.exist(glrq, GLRendererQuirks.No10BitColorCompOffscreen) ); + final boolean useRecommendedIndex = !dontChooseFBConfigBestMatch && capsChosen.isBackgroundOpaque(); final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc); @@ -409,7 +416,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat hdc, iattributes, accelerationMode, fattributes); } if (null != pformats) { - recommendedIndex = 0; + if( useRecommendedIndex ) { + recommendedIndex = 0; + } } else { if(DEBUG) { System.err.println("updateGraphicsConfigurationARB: wglChoosePixelFormatARB failed with: "+capsChosen); @@ -429,9 +438,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat return false; } } - final boolean skipCapsChooser = 0 <= recommendedIndex && null == chooser && capsChosen.isBackgroundOpaque(); // fast path: skip choosing if using recommended idx and null chooser is used and if not translucent + final boolean skipCapsChooser = 0 <= recommendedIndex && null == chooser && useRecommendedIndex; - final List<GLCapabilitiesImmutable> availableCaps = + final ArrayList<GLCapabilitiesImmutable> availableCaps = WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats, winattrbits, skipCapsChooser /* onlyFirstValid */); @@ -451,6 +460,21 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat pformats[recommendedIndex] + ", idx " + recommendedIndex +", "+availableCaps.get(recommendedIndex)); } } + if(DEBUG) { + System.err.println("updateGraphicsConfigurationARB: got configs: "+availableCaps.size()); + for(int i=0; i<availableCaps.size(); i++) { + System.err.println(i+": "+availableCaps.get(i)); + } + } + if( !skipCapsChooser && isPBufferOrBitmap && GLRendererQuirks.exist(glrq, GLRendererQuirks.No10BitColorCompOffscreen) ) { + CapabilitiesFilter.removeMoreColorComps(availableCaps, 8); + if(DEBUG) { + System.err.println("updateGraphicsConfigurationARB: filtered configs: "+availableCaps.size()); + for(int i=0; i<availableCaps.size(); i++) { + System.err.println(i+": "+availableCaps.get(i)); + } + } + } final int chosenIndex; if( skipCapsChooser ) { |