aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-05 17:49:05 +0200
committerSven Gothel <[email protected]>2012-10-05 17:49:05 +0200
commited7d5f2e3fc696d47b10c8d62a071643bf385588 (patch)
treece34d7a68ab0da66a183c4dc21efb2515651569c /src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
parentf541f349bdb99fbb4a00f1b81c9d4a60545cdb7e (diff)
FBO/Offscreen: Use most simple GLCapabilities for GLFBODrawableImpl's underlying dummy surface/drawable
If stencil or MSAA has been selected, the underlying dummy drawable doesn't need to have this configuration, i.e. doesn't need to waste the resources. - Creation of the dummy surface/drawable uses a simple GLCapabilities - Requested FBO GLCapabilities is being passes down to the dummy drawable - GLFBODrawableImpl ctor leaves caps untouched - GLFBODrawableImpl.initialize(boolean realize) - realize == true: using the requested FBO caps and setting it in the parent dummy drawable - realize == false: restore the original caps of dummy drawable
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index deb187372..9aa6ce3cc 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -49,6 +49,7 @@ import javax.media.nativewindow.OffscreenLayerSurface;
import javax.media.nativewindow.ProxySurface;
import javax.media.nativewindow.MutableSurface;
import javax.media.nativewindow.UpstreamSurfaceHook;
+import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesChooser;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLContext;
@@ -187,8 +188,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
throw new IllegalArgumentException("Passed NativeSurface must implement MutableSurface for offscreen: "+target);
}
if( chosenCaps.isFBO() && isFBOAvailable ) {
- // need to hook-up a native dummy surface since source may not have
- final ProxySurface dummySurface = createDummySurfaceImpl(adevice, false, chosenCaps, (GLCapabilitiesImmutable)config.getRequestedCapabilities(), null, 64, 64);
+ // need to hook-up a native dummy surface since source may not have & use minimum GLCapabilities for it w/ same profile
+ final ProxySurface dummySurface = createDummySurfaceImpl(adevice, false, new GLCapabilities(chosenCaps.getGLProfile()), (GLCapabilitiesImmutable)config.getRequestedCapabilities(), null, 64, 64);
dummySurface.setUpstreamSurfaceHook(new DelegatedUpstreamSurfaceHookWithSurfaceSize(dummySurface.getUpstreamSurfaceHook(), target));
result = createFBODrawableImpl(dummySurface, chosenCaps, 0);
} else {
@@ -299,8 +300,9 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if( capsChosen.isFBO() ) {
device.lock();
try {
- final ProxySurface dummySurface = createDummySurfaceImpl(device, true, capsChosen, capsRequested, null, width, height);
- final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
+ // Use minimum GLCapabilities for the dummy surface w/ same profile
+ final ProxySurface dummySurface = createDummySurfaceImpl(device, true, new GLCapabilities(capsChosen.getGLProfile()), capsRequested, null, width, height);
+ final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
return new GLFBODrawableImpl.ResizeableImpl(this, dummyDrawable, dummySurface, capsChosen, 0);
} finally {
device.unlock();