/* Per-texunit derived state.
*/
GLuint TexgenSize[MAX_TEXTURE_COORD_UNITS];
- GLuint TexgenHoles[MAX_TEXTURE_COORD_UNITS];
texgen_func TexgenFunc[MAX_TEXTURE_COORD_UNITS];
/* Temporary values used in texgen.
};
+
/* Special case texgen functions.
*/
static void texgen_reflection_map_nv( GLcontext *ctx,
VB->NormalPtr,
VB->EyePtr );
- if (in) {
- out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
- out->count = in->count;
- out->size = MAX2(in->size, 3);
- if (in->size == 4)
- _mesa_copy_tab[0x8]( out, in );
- }
- else {
- out->flags |= VEC_SIZE_3;
- out->size = 3;
- out->count = in->count;
- }
-
+ out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
+ out->count = VB->Count;
+ out->size = MAX2(in->size, 3);
+ if (in->size == 4)
+ _mesa_copy_tab[0x8]( out, in );
}
}
- if (in) {
- out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
- out->count = in->count;
- out->size = MAX2(in->size, 3);
- if (in->size == 4)
- _mesa_copy_tab[0x8]( out, in );
- }
- else {
- out->flags |= VEC_SIZE_3;
- out->size = 3;
- out->count = in->count;
- }
+ out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
+ out->count = count;
+ out->size = MAX2(in->size, 3);
+ if (in->size == 4)
+ _mesa_copy_tab[0x8]( out, in );
}
VB->NormalPtr,
VB->EyePtr );
+ out->size = MAX2(in->size,2);
+
for (i=0;i<count;i++) {
texcoord[i][0] = f[i][0] * m[i] + 0.5F;
texcoord[i][1] = f[i][1] * m[i] + 0.5F;
}
- if (in) {
- out->size = MAX2(in->size,2);
- out->count = in->count;
- out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_2;
- if (in->size > 2)
- _mesa_copy_tab[all_bits[in->size] & ~0x3]( out, in );
- } else {
- out->size = 2;
- out->flags |= VEC_SIZE_2;
- out->count = in->count;
- }
+ out->count = count;
+ out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_2;
+ if (in->size > 2)
+ _mesa_copy_tab[all_bits[in->size] & ~0x3]( out, in );
}
const GLuint count = VB->Count;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data;
GLfloat (*f)[3] = store->tmp_f;
- GLuint holes = 0;
+ GLuint copy;
if (texUnit->_GenFlags & TEXGEN_NEED_M) {
build_m_tab[eye->size]( store->tmp_f, store->tmp_m, normal, eye );
build_f_tab[eye->size]( (GLfloat *)store->tmp_f, 3, normal, eye );
}
- if (!in) {
- ASSERT(0);
- in = out;
- in->count = VB->Count;
-
- out->size = store->TexgenSize[unit];
- out->flags |= texUnit->TexGenEnabled;
- out->count = VB->Count;
- holes = store->TexgenHoles[unit];
- }
- else {
- GLuint copy = (all_bits[in->size] & ~texUnit->TexGenEnabled);
- if (copy)
- _mesa_copy_tab[copy]( out, in );
-
- out->size = MAX2(in->size, store->TexgenSize[unit]);
- out->flags |= (in->flags & VEC_SIZE_FLAGS) | texUnit->TexGenEnabled;
- out->count = in->count;
- holes = ~all_bits[in->size] & store->TexgenHoles[unit];
- }
+ out->size = MAX2(in->size, store->TexgenSize[unit]);
+ out->flags |= (in->flags & VEC_SIZE_FLAGS) | texUnit->TexGenEnabled;
+ out->count = count;
- if (holes) {
- if (holes & VEC_DIRTY_3) _mesa_vector4f_clean_elem(out, count, 3);
- if (holes & VEC_DIRTY_2) _mesa_vector4f_clean_elem(out, count, 2);
- if (holes & VEC_DIRTY_1) _mesa_vector4f_clean_elem(out, count, 1);
- if (holes & VEC_DIRTY_0) _mesa_vector4f_clean_elem(out, count, 0);
- }
+ copy = (all_bits[in->size] & ~texUnit->TexGenEnabled);
+ if (copy)
+ _mesa_copy_tab[copy]( out, in );
if (texUnit->TexGenEnabled & S_BIT) {
GLuint i;
sz = 1;
store->TexgenSize[i] = sz;
- store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled);
store->TexgenFunc[i] = texgen; /* general solution */
/* look for special texgen cases */