summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/mga/mgastate.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/mga/mgastate.c')
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgastate.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index 203a92f27..926548a7d 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
@@ -24,7 +24,7 @@
* Authors:
* Keith Whitwell <keithw@valinux.com>
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.9 2001/04/10 16:07:51 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.10.2.1 2001/05/31 08:31:23 alanh Exp $ */
#include <stdio.h>
@@ -391,20 +391,34 @@ static void mgaUpdateAlphaMode(GLcontext *ctx)
int a = 0;
/* determine source of alpha for blending and testing */
- if ( !ctx->Texture.ReallyEnabled )
+ if ( !ctx->Texture.ReallyEnabled ) {
a |= AC_alphasel_diffused;
+ }
else {
- switch (ctx->Texture.Unit[0].EnvMode) {
- case GL_DECAL:
- case GL_REPLACE:
- a |= AC_alphasel_fromtex;
- break;
- case GL_BLEND:
- case GL_MODULATE:
- a |= AC_alphasel_modulated;
- break;
- default:
- break;
+ /* G400: Regardless of texture env mode, we use the alpha from the
+ * texture unit (AC_alphasel_fromtex) since it will have already
+ * been modulated by the incoming fragment color, if needed.
+ * We don't want (AC_alphasel_modulate) since that'll effectively
+ * do the modulation twice.
+ */
+ if (MGA_IS_G400(mmesa)) {
+ a |= AC_alphasel_fromtex;
+ }
+ else {
+ /* G200 */
+ switch (ctx->Texture.Unit[0].EnvMode) {
+ case GL_DECAL:
+ a |= AC_alphasel_diffused;
+ case GL_REPLACE:
+ a |= AC_alphasel_fromtex;
+ break;
+ case GL_BLEND:
+ case GL_MODULATE:
+ a |= AC_alphasel_modulated;
+ break;
+ default:
+ break;
+ }
}
}