I had had pretty nasty problems with my app and the CVS-MESA,
basically CVA stuff was "OK" and the non CVA stuff was "FUBAR"

Anyways I was running VTUNE agains my app and noticed that
texture coordinate generation was taking too much time.


So...

I was enabling environment mapping with:
  glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
  glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
  glEnable(GL_TEXTURE_GEN_S);
  glEnable(GL_TEXTURE_GEN_T);

and disabling it with:
  glDisable(GL_TEXTURE_GEN_S);
  glDisable(GL_TEXTURE_GEN_T);

(please tell me if this is not ok)


Disabling texture coord generation was not working!!

The tex_gen state is stored in several
fields in the context state, so I am not
100 % sure if this is correct but...

In texture.c around line 190 I moved
texUnit->GenFlags = 0 from inside of the the
TexGenEnabled condition to the outside of the condition.
(Otherwise when the TexGenEnabled became zero
GenFlags were "stuck" to their previous value)


Here is the CVS diff for the change:
Index: texture.c
===================================================================
RCS file: /cvs/mesa3d/src/texture.c,v
retrieving revision 3.29
diff -r3.29 texture.c
187a188,189
>    texUnit->GenFlags = 0;
> 
191d192
<       texUnit->GenFlags = 0;


And resulting code is:


      texUnit->ReallyEnabled = 0;
      texUnit->Current = NULL;
      texUnit->CurrentDimension = 0;
      return;
   }

   texUnit->GenFlags = 0;

   if (texUnit->TexGenEnabled) 
   {
      GLuint sz = 0;

      if (texUnit->TexGenEnabled&S_BIT) sz=1,
texUnit->GenFlags|=texUnit->GenBitS;
      if (texUnit->TexGenEnabled&T_BIT) sz=2,
texUnit->GenFlags|=texUnit->GenBitT;
      if (texUnit->TexGenEnabled&Q_BIT) sz=3,
texUnit->GenFlags|=texUnit->GenBitQ;
      if (texUnit->TexGenEnabled&R_BIT) sz=4,
texUnit->GenFlags|=texUnit->GenBitR;

I request that this fix or something with similar effect is installed
in the CVS tree. This single problem was responsible of majority of my
problems with my application.(large portion of the rest is propably
related
to the CVA color merge problem which has been reported here)


                        Eero


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to