PDA

View Full Version : Blitting inside backbuffer on nVidia (Solved)



skynet
01-17-2008, 02:46 AM
Its not a bug, its a feature :-) My framebuffer was multisampled (enforced through control panel), so the INVALID_OPERATION is to be expected according to the EXT_framebuffer_multisample specs.



Hello,

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

ZbuffeR
01-17-2008, 04:44 AM
Anyway I am not sure if it is allowed to blit from and to the same buffer, even if there is no overlap ?

skynet
01-17-2008, 05:04 AM
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).

-NiCo-
01-17-2008, 05:43 AM
Its not a bug, its a feature :-) My framebuffer was multisampled (enforced through control panel), so the INVALID_OPERATION is to be expected according to the EXT_framebuffer_multisample specs.

Exactly what part of the spec?

Cheers,
N.

skynet
01-17-2008, 06:50 AM
EXT_framebuffer_multisample




...

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...


Errors:

...

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
identical.

...


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?

-NiCo-
01-17-2008, 06:58 AM
Right. While going over the spec I forgot that you were also magnifying the source rectangle.



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?

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

N.