Michael wrote:
> 
> On Tue, Mar 12, 2002 at 04:53:43PM -0800, Keith Packard wrote:
> > On the radeon card, I'm also seeing problems with
> > other texturing -- translucency isn't working (translucent objects appear
> > opaque)
> 
> Thanks for the report. I'd seen that (in a different program) and
> forgotten about it.
> 
> (A temp workaround is export RADEON_NO_VTXFMT=1)
> 
> At least 3 things here
> 
> a) _FPALPHA is never set, so it never sends alpha to the card.
> Trivial fix (I think) to check ctx->Color.AlphaEnabled in
> choose_vertex_format and set it appropriately?
> 
> b) ~/glut/demos/contrib/steam which has a toggle for transparent
> reveals a subtler issue with CHOOSE_COLOR.
> 
> A typical path will go
> 
> neutral_Color<xx> -> choose_Color<xx> -> radeon_<codegen or 'c' version>
> At some stage  _mesa_restore_exec_vtxfmt will replace the neutral_Color<xx> because
> we aren't saving the second clobber in Swapped.
> 
> But CHOOSE_COLOR conditionally calls _mesa_install_exec_vtxfmt itself,
> which does the above restore, so whereas typically we clobber a
> TnlModule.Swapped function, it's possible for CHOOSE_COLOR to
> restore neutral_xx just prior to us clobbering it and we're stuck
> forever with SwapCount 0 and (in this case) radeon_Color4f_3f, even when the
> vertex_format changes and we want radeon_Color4f_4f.
> 
> Could add a restore bool param to _mesa_install_exec_vtxfmt or a
> new norestore version of the function?

Something like this might also work (re-loop through neutral to get another
opportunity to swap something in).  I haven't tested this:


#define CHOOSE_COLOR(FN, FNTYPE, NR, MASK, ACTIVE, ARGS1, ARGS2 )       \
static void choose_##FN ARGS1                                           \
{                                                                       \
   int key = vb.rmesa->vertex_format & (MASK|ACTIVE);                   \
   struct dynfn *dfn;                                                   \
   GLcontext *ctx = vb.context;                                         \
                                                                        \
   if (vb.rmesa->vertex_format & ACTIVE_PKCOLOR) {                      \
      ctx->Exec->FN = radeon_##FN##_ub;                                 \
   }                                                                    \
   else if ((vb.rmesa->vertex_format &                                  \
            (ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) {       \
                                                                        \
      if (vb.installed_color_3f_sz != NR) {                             \
         vb.installed_color_3f_sz = NR;                                 \
         if (NR == 3) ctx->Current.Color[3] = 1.0;                      \
         radeon_copy_to_current( ctx );                                 \
         _mesa_install_exec_vtxfmt( ctx, &vb.vtxfmt );                  \
         ctx->Exec->FN ARGS2;                                           \
         return;                                                        \
      }                                                                 \
                                                                        \
      ctx->Exec->FN = radeon_##FN##_3f;                                 \
   }                                                                    \
   else {                                                               \
      ctx->Exec->FN = radeon_##FN##_4f;                                 \
   }                                                                    \
                                                                        \
                                                                        \
   dfn = lookup( &vb.dfn_cache.FN, key );                               \
   if (!dfn) dfn = vb.codegen.FN( &vb, key );                           \
                                                                        \
   if (!dfn) {                                                          \
      if (RADEON_DEBUG & DEBUG_CODEGEN)                                 \
         fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ );     \
      ctx->Exec->FN = (FNTYPE)dfn->code;                                \
   }                                                                    \
   else if (RADEON_DEBUG & DEBUG_CODEGEN)                               \
         fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ );         \
                                                                        \
   ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;                       \
   ctx->Exec->FN ARGS2;                                                 \
}


Keith

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

Reply via email to