Bug 5408 - Depth Test error?
Summary: Depth Test error?
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-05-30 04:03 UTC by Julien Vulliet
Modified: 2012-05-30 06:52 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Julien Vulliet 2012-05-30 04:03:02 UTC

I tried to port an application from Mono to Android into MonoTouch.

I have a simple 3d scene with depth enabled.

Here is the code I use:

And clearing depth to 1 when i start to draw my scene.

I works perfectly fine in Android, but when i load the same code in Monotouch depth test is never enabled.
Comment 1 Julien Vulliet 2012-05-30 06:52:28 UTC
Ok found solution, createframebuffer in iOS, unlike in Android, does not create
depth buffer initially, so this added in CreateFrameBuffer override does the work.

uint depthRenderBuffer = 0;
GL.GenRenderbuffers (1,ref depthRenderBuffer);
GL.BindRenderbuffer (All.Renderbuffer, depthRenderBuffer);
GL.RenderbufferStorage (All.Renderbuffer, All.DepthComponent16, Size.Width, Size.Height);
GL.FramebufferRenderbuffer (All.Framebuffer, All.DepthAttachment, All.Renderbuffer, depthRenderBuffer);