Home | Info | Community | Development | myReactOS | Contact Us
[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); } }