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 make_state_key ( GLcontext *  ctx,
struct state_key key 
) [static]

Definition at line 182 of file ffvertex_prog.c.

Referenced by _mesa_get_fixed_func_vertex_program().

{
   const struct gl_fragment_program *fp;
   GLuint i;

   memset(key, 0, sizeof(struct state_key));
   fp = ctx->FragmentProgram._Current;

   /* This now relies on texenvprogram.c being active:
    */
   assert(fp);

   key->need_eye_coords = ctx->_NeedEyeCoords;

   key->fragprog_inputs_read = fp->Base.InputsRead;

   if (ctx->RenderMode == GL_FEEDBACK) {
      /* make sure the vertprog emits color and tex0 */
      key->fragprog_inputs_read |= (FRAG_BIT_COL0 | FRAG_BIT_TEX0);
   }

   key->separate_specular = (ctx->Light.Model.ColorControl ==
                 GL_SEPARATE_SPECULAR_COLOR);

   if (ctx->Light.Enabled) {
      key->light_global_enabled = 1;

      if (ctx->Light.Model.LocalViewer)
     key->light_local_viewer = 1;

      if (ctx->Light.Model.TwoSide)
     key->light_twoside = 1;

      if (ctx->Light.ColorMaterialEnabled) {
     key->light_color_material = 1;
     key->light_color_material_mask = ctx->Light.ColorMaterialBitmask;
      }

      key->light_material_mask = tnl_get_per_vertex_materials(ctx);

      for (i = 0; i < MAX_LIGHTS; i++) {
     struct gl_light *light = &ctx->Light.Light[i];

     if (light->Enabled) {
        key->unit[i].light_enabled = 1;

        if (light->EyePosition[3] == 0.0)
           key->unit[i].light_eyepos3_is_zero = 1;
        
        if (light->SpotCutoff == 180.0)
           key->unit[i].light_spotcutoff_is_180 = 1;

        if (light->ConstantAttenuation != 1.0 ||
        light->LinearAttenuation != 0.0 ||
        light->QuadraticAttenuation != 0.0)
           key->unit[i].light_attenuated = 1;
     }
      }

      if (check_active_shininess(ctx, key, 0)) {
         key->material_shininess_is_zero = 0;
      }
      else if (key->light_twoside &&
               check_active_shininess(ctx, key, 1)) {
         key->material_shininess_is_zero = 0;
      }
      else {
         key->material_shininess_is_zero = 1;
      }
   }

   if (ctx->Transform.Normalize)
      key->normalize = 1;

   if (ctx->Transform.RescaleNormals)
      key->rescale_normals = 1;

   key->fog_mode = translate_fog_mode(fp->FogOption);
   
   if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT)
      key->fog_source_is_depth = 1;
   
   key->tnl_do_vertex_fog = tnl_get_per_vertex_fog(ctx);

   if (ctx->Point._Attenuated)
      key->point_attenuated = 1;

#if FEATURE_point_size_array
   if (ctx->Array.ArrayObj->PointSize.Enabled)
      key->point_array = 1;
#endif

   if (ctx->Texture._TexGenEnabled ||
       ctx->Texture._TexMatEnabled ||
       ctx->Texture._EnabledUnits)
      key->texture_enabled_global = 1;
      
   for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
      struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];

      if (texUnit->_ReallyEnabled)
     key->unit[i].texunit_really_enabled = 1;

      if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i))      
     key->unit[i].texmat_enabled = 1;
      
      if (texUnit->TexGenEnabled) {
     key->unit[i].texgen_enabled = 1;
      
     key->unit[i].texgen_mode0 = 
        translate_texgen( texUnit->TexGenEnabled & (1<<0),
                  texUnit->GenModeS );
     key->unit[i].texgen_mode1 = 
        translate_texgen( texUnit->TexGenEnabled & (1<<1),
                  texUnit->GenModeT );
     key->unit[i].texgen_mode2 = 
        translate_texgen( texUnit->TexGenEnabled & (1<<2),
                  texUnit->GenModeR );
     key->unit[i].texgen_mode3 = 
        translate_texgen( texUnit->TexGenEnabled & (1<<3),
                  texUnit->GenModeQ );
      }
   }
}

Generated on Sat May 26 2012 04:56:41 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.