ARB_framebuffer specs say:
If SAMPLE_BUFFERS for the read framebuffer is zero and
SAMPLE_BUFFERS for the draw framebuffer is greater than zero, the value of the source sample is replicated in each of the destination samples.
Suppose you draw a red triangle into a non-MSAA fbo. Afterwards you blit the color- AND depthbuffer of it into a 4xMSAA fbo. Now draw the exact same triangle in green color on top of it (into the MSAA FBO). What would you expect?
I expect to see either a green or red triangle, or maybe red/green zfighting artifacts.
What do I get instead? A brownish mixture of both triangles!
It seems, while doing the blit, the depthvalues are not properly replicated into the destination depthbuffer. When the second triangle gets rendered, the depthtest for the second triangle sometimes failes, sometimes succeeds which results in a mixture of both triangles when the FBO gets finally resolved and displayed. What makes me wonder is, that both, nVidia and ATI fail the same way Or am I missing something?
During the whole operation no blending, alphatesting, stenciltesting or SAMPLE_TO_ALPHA_COVERAGE is active.
Can anyone comment on this?