While working with glBlitFramebuffer I saw that it doesn't resolve the depth samples, as in calling a glBlitFramebuffer with a read FBO with a depth renderbuffer with samples = 4 never makes any writes into my depth texture.
Then I read this part of the OpenGL ES 3.0 spec that says :
"If the value of SAMPLE_BUFFERS for the read framebuffer is one and the value
of SAMPLE_BUFFERS for the draw framebuffer is zero, the samples corresponding
to each pixel location in the source are converted to a single sample before being
written to the destination. The filter parameter is ignored.. If the source formats are depth values, sample values are resolved in an implementationdependent
manner where the result will be between the minimum and maximum depth values in the pixel."
This explicitly says that the depth must be resolved to be between the minimum and maximum of all the samples for a pixel. This must mean that the depth should be resolved in some way and I should have a resolved depth texture, yet I don't.
Need to get a bit more information...
1) Can you provide some psuedocode showing the calls you are making to set up the FBO and renderbuffers, doing the attachment, and drawing?
2) Have you checked for completeness?
3) Is nothing being written to the depth texture? Is there any glerror generated?
4) Which hardware/driver are you experiencing the problem on?
5) As per: https://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml
If SAMPLE_BUFFERS for the read framebuffer is greater than zero and SAMPLE_BUFFERS for the draw framebuffer is zero, the samples corresponding to each pixel location in the source are converted to a single sample before being written to the destination.
thanks..
Actually, after working on a lot more things I came to discover a way to make it work.
I just discovered yesterday that sized depth textures (GL_DEPTH_COMPONENT16/24/32) need to have GL_NEAREST for the filtering parameters.
Now, the thing is that if you use GL_DEPTH_COMPONENT32 it seems to resolve the depth buffer if you filtering with GL_NEAREST but the resolved color buffer doesn't appear to be antialiased, it looks exactly as if you rendered without multisampling . And I just tried using GL_DEPTH_COMPONENT24 for the heck of it and that resolves depth as well as color ! I was previously just using the GLES2 GL_DEPTH_COMPONENT for internalformat because I didn't knew about needing to set GL_NEAREST for all filters.