glBlitFramebufferEXT with out-of-bounds src rect

What happens, if the source rectangle exceeds the border of the read buffer, but the destination rectangle does not? What will get copied for the undefined regions? And how is the linear filter defined for samples that lie between valid source pixels and invalid ones?

I tried to find something about that in the specs, but found nothing :frowning: It is not specified what “valid” coordinates are.

The result of sourcing an invalid region is undefined. The only guarantee is that this operation should not cause a crash.

Likewise, if you filter from the boundary between a valid and invalid region, the result is undefined because you cannot predict what values will come from the invalid region.

Just don’t do it. :slight_smile:

glCopyPixels says “Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined.”

It would be best if the blit spec explicitly said something similar.

More generally the pixel ownership test in the OpenGL specs chapter 4.1.1 applies.

Considering the part said about framebuffer only:

4.1.1 Pixel Ownership Test
The first test is to determine if the pixel at location (xw, yw) in the framebuffer is currently owned by the GL (more precisely, by this GL context). If it is not, the window system decides the fate the incoming fragment. Possible results are that the fragment is discarded or that some subset of the subsequent per-fragment operations are applied to the fragment. This test allows the window system to control the GL’s behavior, for instance, when a GL window is obscured.

Read: Results of any operation where the pixel ownership test failed are undefined.