diff options
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_vb_texgen.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 22cb07edf30..a9ae9cc999a 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -319,6 +319,7 @@ static void texgen_sphere_map( GLcontext *ctx, GLfloat (*f)[3] = store->tmp_f; GLfloat *m = store->tmp_m; + /* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */ /* __FUNCTION__, VB->NormalPtr->stride, */ /* VB->EyePtr->stride); */ @@ -356,22 +357,20 @@ static void texgen( GLcontext *ctx, struct vertex_buffer *VB = &tnl->vb; GLvector4f *in = VB->TexCoordPtr[unit]; GLvector4f *out = &store->texcoord[unit]; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const GLvector4f *obj = VB->ObjPtr; const GLvector4f *eye = VB->EyePtr; const GLvector4f *normal = VB->NormalPtr; + const GLfloat *m = store->tmp_m; + const GLuint count = VB->Count; GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; - GLfloat *indata; - GLuint count = VB->Count; GLfloat (*f)[3] = store->tmp_f; - GLfloat *m = store->tmp_m; GLuint holes = 0; - if (texUnit->_GenFlags & TEXGEN_NEED_M) { - build_m_tab[in->size]( store->tmp_f, store->tmp_m, normal, eye ); + build_m_tab[eye->size]( store->tmp_f, store->tmp_m, normal, eye ); } else if (texUnit->_GenFlags & TEXGEN_NEED_F) { - build_f_tab[in->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); + build_f_tab[eye->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); } if (!in) { @@ -417,8 +416,8 @@ static void texgen( GLcontext *ctx, texUnit->EyePlaneS ); break; case GL_SPHERE_MAP: - for (indata=in->start,i=0 ; i<count ;i++, STRIDE_F(indata,in->stride)) - texcoord[i][0] = indata[0] * m[i] + 0.5F; + for (i = 0; i < count; i++) + texcoord[i][0] = f[i][0] * m[i] + 0.5F; break; case GL_REFLECTION_MAP_NV: for (i=0;i<count;i++) @@ -450,8 +449,8 @@ static void texgen( GLcontext *ctx, texUnit->EyePlaneT ); break; case GL_SPHERE_MAP: - for (indata=in->start,i=0; i<count ;i++,STRIDE_F(indata,in->stride)) - texcoord[i][1] = indata[1] * m[i] + 0.5F; + for (i = 0; i < count; i++) + texcoord[i][1] = f[i][1] * m[i] + 0.5F; break; case GL_REFLECTION_MAP_NV: for (i=0;i<count;i++) @@ -562,8 +561,9 @@ static GLboolean run_validate_texgen_stage( GLcontext *ctx, store->TexgenSize[i] = sz; store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled); - store->TexgenFunc[i] = texgen; + store->TexgenFunc[i] = texgen; /* general solution */ + /* look for special texgen cases */ if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) { if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) { store->TexgenFunc[i] = texgen_reflection_map_nv; |