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]

Examine current texture environment state and generate a unique key to identify it.

Definition at line 223 of file texenvprogram.c.

Referenced by _mesa_get_fixed_func_fragment_program().

{
   GLuint i, j;
    
   memset(key, 0, sizeof(*key));

   for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
      const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
      GLenum format;

      if (!texUnit->_ReallyEnabled || !texUnit->Enabled)
         continue;

      format = texUnit->_Current->Image[0][texUnit->_Current->BaseLevel]->_BaseFormat;

      key->unit[i].enabled = 1;
      key->enabled_units |= (1<<i);

      key->unit[i].source_index = 
     translate_tex_src_bit(texUnit->_ReallyEnabled);        
      key->unit[i].shadow = ((texUnit->_Current->CompareMode == GL_COMPARE_R_TO_TEXTURE) && 
                             ((format == GL_DEPTH_COMPONENT) || 
                              (format == GL_DEPTH_STENCIL_EXT)));

      key->unit[i].NumArgsRGB = texUnit->_CurrentCombine->_NumArgsRGB;
      key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA;

      key->unit[i].ModeRGB =
     translate_mode(texUnit->_CurrentCombine->ModeRGB);
      key->unit[i].ModeA =
     translate_mode(texUnit->_CurrentCombine->ModeA);
        
      key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB;
      key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA;

      for (j=0;j<3;j++) {
         key->unit[i].OptRGB[j].Operand =
        translate_operand(texUnit->_CurrentCombine->OperandRGB[j]);
         key->unit[i].OptA[j].Operand =
        translate_operand(texUnit->_CurrentCombine->OperandA[j]);
         key->unit[i].OptRGB[j].Source =
        translate_source(texUnit->_CurrentCombine->SourceRGB[j]);
         key->unit[i].OptA[j].Source =
        translate_source(texUnit->_CurrentCombine->SourceA[j]);
      }
   }
    
   if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
      key->separate_specular = 1;

   if (ctx->Fog.Enabled) {
      key->fog_enabled = 1;
      key->fog_mode = translate_fog_mode(ctx->Fog.Mode);
   }
}

Generated on Fri May 25 2012 04:57:08 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.