OSDN Git Service

mesa/msaa: Allow X and Y flips in multisampled blits.
authorPaul Berry <stereotype441@gmail.com>
Wed, 5 Sep 2012 23:07:16 +0000 (16:07 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 11 Sep 2012 22:50:55 +0000 (15:50 -0700)
commit5d5f0f349135786cdd76b6004f38b12e50d7f8f9
tree43a887ace149009a5bc7ba0ef4ef86d94b33482b
parent843ac06ad27fe25293a32a991156ee364ef23cf1
mesa/msaa: Allow X and Y flips in multisampled blits.

From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":

    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 the formats of the read and draw framebuffers
    are not identical.

It is not clear from the spec whether "dimensions" should mean both
sign and magnitude, or just magnitude.

Previously, Mesa interpreted "dimensions" as meaning both sign and
magnitude, so any multisampled blit that attempted to flip the image
in the X and/or Y direction would fail.

However, Y flips are likely to be commonplace in OpenGL applications
that have been ported from DirectX applications, as a result of the
fact that DirectX and OpenGL differ in their orientation of the Y
axis.  Furthermore, at least one commercial driver (nVidia) permits Y
filps, and L4D2 relies on them being permitted.  So it seems prudent
for Mesa to permit them.

This patch changes Mesa to allow both X and Y flips, since there is no
language in the spec to indicate that X and Y flips should be treated
differently.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/fbobject.c