ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void update_arrays ( GLcontext *  ctx) [static]

Update state dependent on vertex arrays.

Definition at line 68 of file state.c.

Referenced by _mesa_update_state_locked().

{
   GLuint i, min;

   /* find min of _MaxElement values for all enabled arrays */

   /* 0 */
   if (ctx->VertexProgram._Current
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) {
      min = ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS]._MaxElement;
   }
   else if (ctx->Array.ArrayObj->Vertex.Enabled) {
      min = ctx->Array.ArrayObj->Vertex._MaxElement;
   }
   else {
      /* can't draw anything without vertex positions! */
      min = 0;
   }

   /* 1 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_WEIGHT]._MaxElement);
   }
   /* no conventional vertex weight array */

   /* 2 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL]._MaxElement);
   }
   else if (ctx->Array.ArrayObj->Normal.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->Normal._MaxElement);
   }

   /* 3 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0]._MaxElement);
   }
   else if (ctx->Array.ArrayObj->Color.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->Color._MaxElement);
   }

   /* 4 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1]._MaxElement);
   }
   else if (ctx->Array.ArrayObj->SecondaryColor.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->SecondaryColor._MaxElement);
   }

   /* 5 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG]._MaxElement);
   }
   else if (ctx->Array.ArrayObj->FogCoord.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->FogCoord._MaxElement);
   }

   /* 6 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX]._MaxElement);
   }
   else if (ctx->Array.ArrayObj->Index.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->Index._MaxElement);
   }


   /* 7 */
   if (ctx->VertexProgram._Enabled
       && ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG]._MaxElement);
   }

   /* 8..15 */
   for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) {
      if (ctx->VertexProgram._Enabled
          && ctx->Array.ArrayObj->VertexAttrib[i].Enabled) {
         min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement);
      }
      else if (i - VERT_ATTRIB_TEX0 < ctx->Const.MaxTextureCoordUnits
               && ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0].Enabled) {
         min = MIN2(min, ctx->Array.ArrayObj->TexCoord[i - VERT_ATTRIB_TEX0]._MaxElement);
      }
   }

   /* 16..31 */
   if (ctx->VertexProgram._Current) {
      for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
         if (ctx->Array.ArrayObj->VertexAttrib[i].Enabled) {
            min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement);
         }
      }
   }

   if (ctx->Array.ArrayObj->EdgeFlag.Enabled) {
      min = MIN2(min, ctx->Array.ArrayObj->EdgeFlag._MaxElement);
   }

   /* _MaxElement is one past the last legal array element */
   ctx->Array._MaxElement = min;
}

Generated on Sun May 27 2012 04:58:32 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.