The fix for the g400 broke it for the g200.
So i tried around until the texenv.c's software output matched the
g200's
output except for GL_ADD.

Since i have no unmodified tree anymore ill copy right out of the
source.. :>


mgastate.c: mgaUpdateAlphaMode()
<snip>
   else {
      /* 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_modulated) since that'll effectively
       * do the modulation twice.
       */

       if(MGA_IS_G400(mmesa))
       {
          a |= AC_alphasel_fromtex;
       }else
       {
          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;
          }
      }
   }
<snip>

mgatex.c :
static void mgaUpdateTextureEnvG200( GLcontext *ctx )
{
   struct gl_texture_object *tObj = ctx->Texture.Unit[0].Current;
   mgaTextureObjectPtr t;

   if (!tObj || !tObj->DriverData)
      return;

   t = (mgaTextureObjectPtr)tObj->DriverData;

   t->setup.texctl2 &= ~TMC_decalblend_enable;

   switch (ctx->Texture.Unit[0].EnvMode) {
   case GL_REPLACE:
      t->setup.texctl &= ~TMC_tmodulate_enable;
      break;
   case GL_MODULATE:
      t->setup.texctl |= TMC_tmodulate_enable;
      break;
   case GL_DECAL:
      t->setup.texctl &= ~TMC_tmodulate_enable;
      t->setup.texctl2 |= TMC_decalblend_enable;
      break;
   case GL_BLEND:
      t->ctx->Fallback |= MGA_FALLBACK_TEXTURE;
      break;
   default:
      break;
   }
}


-- 
ralf willenbacher ([EMAIL PROTECTED])

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to