Blitting inside backbuffer on nVidia (Solved)

Its not a bug, its a feature :slight_smile: My framebuffer was multisampled (enforced through control panel), so the INVALID_OPERATION is to be expected according to the EXT_framebuffer_multisample specs.


I ask you to confirm a bug in the current nVidia drivers, regarding glBlitFramebufferEXT.

I tried to blit one region of the backbuffer to another. Source and destination region don’t overlap. The mask is GL_COLOR_BUFFER_BIT, the filter is GL_NEAREST. The destination region is larger than the source, so a magnification is happening. Framebuffer 0 (the window) is bound to both, READ and DRAW framebuffer. glReadBuffer() and glDrawBuffer() are both set to GL_BACK. The framebuffer status, just before the blit happens, returns “complete”.

The bug causes nothing to be drawn and throws GL_INVALID_OPERATION.

The very same code works on ATI as expected.

Another bug, not related to the one above, is, that glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT) and glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING_EXT) both return wrong values.

Tested on GF8800GTS, WinXP64, Forceware 169.21

Anyway I am not sure if it is allowed to blit from and to the same buffer, even if there is no overlap ?

If the source and destination buffers are identical, and the
source and destination rectangles overlap, the result of the blit
operation is undefined.

This is from the specs and implies, that the result is only undefinied in the case when read and draw framebuffers are the same and the regions overlap. All other cases seem to be allowed (more exceptions are defined in EXT_framebuffer_multisample, though).

Exactly what part of the spec?



Furthermore, if SAMPLE_BUFFERS for either the read framebuffer or
draw framebuffer is greater than zero, no copy is performed and an
INVALID_OPERATION error is generated if the dimensions of the source
and destination rectangles provided to BlitFramebuffer are not
identical, or…


If either the draw or read framebuffer is framebuffer complete and
has a value of SAMPLE_BUFFERS that is greater than zero, then the
error INVALID_OPERATION is generated if BlitFramebufferEXT is called
and the specified source and destination dimensions are not

This sentence implies, that whenever any multisampled buffer is involved while blitting, no stretching whatsoever is allowed.

I wonder, why it is disallowed, even if the source is not mulitsampled. What are the technical reasons for this?

Right. While going over the spec I forgot that you were also magnifying the source rectangle.

I guess that, in order for it to be correct, you would also need spatial distribution information of the different samples…