From 019a6fe3c2f5efe550d41f7262b8010d3cfa0aa0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 24 Jun 2019 22:05:47 +0200 Subject: iOS: EAGLLayer FBO w/ DEPTH buffer workaround 1 Notable bug as mentioned before: The FBO used and sharing the COLORBUFFER RENDERBUFFER memory resources with CAEAGLLayer to be displayed in the UIView seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24 or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation). This workaround re-binds the used color renderbuffer for EAGLLayer presentation at the end of the FBO drawable instantiation. FBO DEPTH buffer works now as demonstrated w/ GearsES2. We have to issue one more test now, using a demo using an FBO itself. --- src/nativewindow/native/ios/IOSmisc.m | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nativewindow') diff --git a/src/nativewindow/native/ios/IOSmisc.m b/src/nativewindow/native/ios/IOSmisc.m index 5826b9eef..49fe8325e 100644 --- a/src/nativewindow/native/ios/IOSmisc.m +++ b/src/nativewindow/native/ios/IOSmisc.m @@ -342,6 +342,9 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_ios_IOSUtil_CreateUIWindow0 CAEAGLUIView *uiView = [[CAEAGLUIView alloc] initWithFrame:boundsView]; CAEAGLLayer* l = (CAEAGLLayer*)[uiView layer]; [l setOpaque: YES]; + l.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: /* defaults */ + [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; + [myWindow addSubview: uiView]; -- cgit v1.2.3