aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-26 09:30:29 +0200
committermarha <marha@users.sourceforge.net>2014-06-26 09:30:29 +0200
commitc30d5eefc96925b4bef781806c7a0114eca1b8e0 (patch)
tree420bb99ba463e5df728e71214ea6aaed0ad18fcb /mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
parentd435b20322433b335a4fc5693cce0399a3f27b2d (diff)
downloadvcxsrv-c30d5eefc96925b4bef781806c7a0114eca1b8e0.tar.gz
vcxsrv-c30d5eefc96925b4bef781806c7a0114eca1b8e0.tar.bz2
vcxsrv-c30d5eefc96925b4bef781806c7a0114eca1b8e0.zip
Opdated to openssl-1.0.1h
xkeyboard-config fontconfig libX11 libxcb xcb-proto mesa xserver git update 26 June 2014 xserver commit a3b44ad8db1fa2f3b81c1ff9498f31c5323edd37 libxcb commit 125135452a554e89e49448e2c1ee6658324e1095 libxcb/xcb-proto commit 84bfd909bc3774a459b11614cfebeaa584a1eb38 xkeyboard-config commit 39a226707b133ab5540c2d30176cb3857e74dcca libX11 commit a4679baaa18142576d42d423afe816447f08336c fontconfig commit 274f2181f294af2eff3e8db106ec8d7bab2d3ff1 mesa commit 9a8acafa47558cafeb37f80f4b30061ac1962c69
Diffstat (limited to 'mesalib/src/mesa/drivers/common/meta_generate_mipmap.c')
-rw-r--r--mesalib/src/mesa/drivers/common/meta_generate_mipmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
index d12806c3d..4b1718df9 100644
--- a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -43,6 +43,7 @@
#include "main/varray.h"
#include "main/viewport.h"
#include "drivers/common/meta.h"
+#include "program/prog_instruction.h"
/**
@@ -168,6 +169,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
GLenum faceTarget;
GLuint dstLevel;
GLuint samplerSave;
+ GLint swizzle[4];
+ GLboolean swizzleSaved = GL_FALSE;
if (fallback_required(ctx, target, texObj)) {
_mesa_generate_mipmap(ctx, target, texObj);
@@ -231,6 +234,13 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE);
+ if (texObj->_Swizzle != SWIZZLE_NOOP) {
+ static const GLint swizzleNoop[4] = { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA };
+ memcpy(swizzle, texObj->Swizzle, sizeof(swizzle));
+ swizzleSaved = GL_TRUE;
+ _mesa_TexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzleNoop);
+ }
+
/* Silence valgrind warnings about reading uninitialized stack. */
memset(verts, 0, sizeof(verts));
@@ -347,4 +357,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave);
if (genMipmapSave)
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave);
+ if (swizzleSaved)
+ _mesa_TexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
}