diff options
author | Keith Whitwell <[email protected]> | 2001-01-29 20:47:39 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-01-29 20:47:39 +0000 |
commit | 5c1e7fa6ee72f4403d9ec9d12830dd689b966e71 (patch) | |
tree | 8cb11c26af178632b05de9c5b2f53c32331475c5 /src/mesa/tnl/t_vb_texgen.c | |
parent | 4b90e68ac6d0fe4ffca5e2cd51794bb4350cac28 (diff) |
Removed knowledge of swrast Clear/Bitmap/Accum/Draw/Read/CopyPixels
functions from core mesa -- if drivers need these fallbacks they
must now call them themselves.
Introduced hooks for clip-vertex-interpolation and the rendering
of clipped lines and polygons. Allows drivers to interpolate
their hardware-format vertices directly. Used in dri drivers to
replace fastpath code.
Slight optimizations to pipeline build/run routines.
Diffstat (limited to 'src/mesa/tnl/t_vb_texgen.c')
-rw-r--r-- | src/mesa/tnl/t_vb_texgen.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index e975665e8a4..70c53de7de2 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_texgen.c,v 1.1 2000/12/26 05:09:33 keithw Exp $ */ +/* $Id: t_vb_texgen.c,v 1.2 2001/01/29 20:47:39 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -372,6 +372,7 @@ static void texgen( GLcontext *ctx, GLuint count = VB->Count; GLfloat (*f)[3] = store->tmp_f; GLfloat *m = store->tmp_m; + GLuint holes = 0; if (texUnit->_GenFlags & TEXGEN_NEED_M) { @@ -380,25 +381,33 @@ static void texgen( GLcontext *ctx, build_f_tab[in->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); } - if (in != out) { + 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) gl_copy_tab[0][copy](out, in, 0); - } - if (store->TexgenHoles[unit]) - { - GLuint holes = (~all_bits[in->size] & store->TexgenHoles[unit]); - if (holes) { - if (holes & VEC_DIRTY_2) gl_vector4f_clean_elem(out, count, 2); - if (holes & VEC_DIRTY_1) gl_vector4f_clean_elem(out, count, 1); - if (holes & VEC_DIRTY_0) gl_vector4f_clean_elem(out, count, 0); - } + 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 = in->count; + if (holes) { + if (holes & VEC_DIRTY_2) gl_vector4f_clean_elem(out, count, 2); + if (holes & VEC_DIRTY_1) gl_vector4f_clean_elem(out, count, 1); + if (holes & VEC_DIRTY_0) gl_vector4f_clean_elem(out, count, 0); + } if (texUnit->TexGenEnabled & S_BIT) { GLuint i; @@ -414,7 +423,7 @@ static void texgen( GLcontext *ctx, texUnit->EyePlaneS, 0); break; case GL_SPHERE_MAP: - for (indata=in->start,i=0 ; i<count ; i++, STRIDE_F(indata,in->stride)) + for (indata=in->start,i=0 ; i<count ;i++, STRIDE_F(indata,in->stride)) texcoord[i][0] = indata[0] * m[i] + 0.5F; break; case GL_REFLECTION_MAP_NV: @@ -604,8 +613,8 @@ static void check_texgen( GLcontext *ctx, struct gl_pipeline_stage *stage ) /* Need the original input in case it contains a Q coord: * (sigh) */ - if ((ctx->Texture.Unit[i]._ReallyEnabled|Q_BIT) & - ~ctx->Texture.Unit[i].TexGenEnabled) +/* if ((ctx->Texture.Unit[i]._ReallyEnabled|Q_BIT) & */ +/* ~ctx->Texture.Unit[i].TexGenEnabled) */ inputs |= VERT_TEX(i); /* Something for Feedback? */ |