aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-29 09:05:13 +0100
committermarha <marha@users.sourceforge.net>2012-11-29 09:05:49 +0100
commit0831039c0d449a3b5874c12ee365a8d5d2be7b8c (patch)
tree4edb707b79145f619fefc18c2359659ca660612f /mesalib/src/mesa/main/fbobject.c
parent6bc629065956c81d836bbdb12f5f580d8a3db8e5 (diff)
parentd2d73da59e64acdc4718e4e6790a69d967bee875 (diff)
downloadvcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.tar.gz
vcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.tar.bz2
vcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig xserver mesa git update 29 nov 2012 Conflicts: xorg-server/dix/dispatch.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/winclipboardxevents.c xorg-server/hw/xwin/winengine.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/winglobals.c xorg-server/hw/xwin/winkeybd.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/hw/xwin/winwindow.h xorg-server/os/osinit.c xorg-server/os/utils.c
Diffstat (limited to 'mesalib/src/mesa/main/fbobject.c')
-rw-r--r--mesalib/src/mesa/main/fbobject.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 223aef18d..891ec5dce 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -2799,11 +2799,41 @@ get_nongeneric_internalformat(GLenum format)
}
+static GLenum
+get_linear_internalformat(GLenum format)
+{
+ switch (format) {
+ case GL_SRGB:
+ return GL_RGB;
+
+ case GL_SRGB_ALPHA:
+ return GL_RGBA;
+
+ case GL_SRGB8:
+ return GL_RGB8;
+
+ case GL_SRGB8_ALPHA8:
+ return GL_RGBA8;
+
+ case GL_SLUMINANCE:
+ return GL_LUMINANCE8;
+
+ case GL_SLUMINANCE_ALPHA:
+ return GL_LUMINANCE8_ALPHA8;
+
+ default:
+ return format;
+ }
+}
+
+
static GLboolean
compatible_resolve_formats(const struct gl_renderbuffer *colorReadRb,
const struct gl_renderbuffer *colorDrawRb)
{
- /* The simple case where we know the backing formats are the same.
+ GLenum readFormat, drawFormat;
+
+ /* The simple case where we know the backing Mesa formats are the same.
*/
if (_mesa_get_srgb_format_linear(colorReadRb->Format) ==
_mesa_get_srgb_format_linear(colorDrawRb->Format)) {
@@ -2817,9 +2847,15 @@ compatible_resolve_formats(const struct gl_renderbuffer *colorReadRb,
* textures and get two entirely different Mesa formats like RGBA8888 and
* ARGB8888. Drivers behaving like that should be able to cope with
* non-matching formats by themselves, because it's not the user's fault.
+ *
+ * Blits between linear and sRGB formats are also allowed.
*/
- if (get_nongeneric_internalformat(colorReadRb->InternalFormat) ==
- get_nongeneric_internalformat(colorDrawRb->InternalFormat)) {
+ readFormat = get_nongeneric_internalformat(colorReadRb->InternalFormat);
+ drawFormat = get_nongeneric_internalformat(colorDrawRb->InternalFormat);
+ readFormat = get_linear_internalformat(readFormat);
+ drawFormat = get_linear_internalformat(drawFormat);
+
+ if (readFormat == drawFormat) {
return GL_TRUE;
}