-/* $Id: t_vb_texgen.c,v 1.9 2001/04/26 14:53:48 keithw Exp $ */
+/* $Id: t_vb_texgen.c,v 1.13 2002/06/29 19:48:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void build_m3( GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
static void build_m2( GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
typedef void (*build_m_func)( GLfloat f[][3],
GLfloat m[],
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye );
*/
static void build_f3( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
static void build_f2( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal,
+ const GLvector4f *normal,
const GLvector4f *eye )
{
GLuint stride = eye->stride;
typedef void (*build_f_func)( GLfloat *f,
GLuint fstride,
- const GLvector3f *normal_vec,
+ const GLvector4f *normal_vec,
const GLvector4f *eye );
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
GLvector4f *in = VB->TexCoordPtr[unit];
GLvector4f *out = &store->texcoord[unit];
- GLvector3f *normal = VB->NormalPtr;
+ GLvector4f *normal = VB->NormalPtr;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start;
GLuint count = VB->Count;
GLuint i;
GLfloat (*f)[3] = store->tmp_f;
GLfloat *m = store->tmp_m;
-/* fprintf(stderr, "%s normstride %d eyestride %d\n", */
+/* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */
/* __FUNCTION__, VB->NormalPtr->stride, */
/* VB->EyePtr->stride); */
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const GLvector4f *obj = VB->ObjPtr;
const GLvector4f *eye = VB->EyePtr;
- const GLvector3f *normal = VB->NormalPtr;
+ const GLvector4f *normal = VB->NormalPtr;
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data;
GLfloat *indata;
GLuint count = VB->Count;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i)) {
- if (stage->changed_inputs & (VERT_EYE | VERT_NORM | VERT_TEX(i)))
+ if (stage->changed_inputs & (VERT_BIT_EYE | VERT_BIT_NORMAL | VERT_BIT_TEX(i)))
store->TexgenFunc[i]( ctx, store, i );
VB->TexCoordPtr[i] = &store->texcoord[i];
GLuint i;
stage->active = 0;
- if (ctx->Texture._TexGenEnabled) {
+ if (ctx->Texture._TexGenEnabled && !ctx->VertexProgram.Enabled) {
GLuint inputs = 0;
GLuint outputs = 0;
if (ctx->Texture._GenFlags & TEXGEN_OBJ_LINEAR)
- inputs |= VERT_OBJ;
+ inputs |= VERT_BIT_POS;
if (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD)
- inputs |= VERT_EYE;
+ inputs |= VERT_BIT_EYE;
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS)
- inputs |= VERT_NORM;
+ inputs |= VERT_BIT_NORMAL;
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i))
{
- outputs |= VERT_TEX(i);
+ outputs |= VERT_BIT_TEX(i);
/* Need the original input in case it contains a Q coord:
* (sigh)
*/
- inputs |= VERT_TEX(i);
+ inputs |= VERT_BIT_TEX(i);
/* Something for Feedback? */
}
const struct gl_pipeline_stage _tnl_texgen_stage =
{
- "texgen",
+ "texgen", /* name */
_NEW_TEXTURE, /* when to call check() */
_NEW_TEXTURE, /* when to invalidate stored data */
- 0,0,0, /* active, inputs, outputs */
- 0,0, /* changed_inputs, private */
+ GL_FALSE, /* active? */
+ 0, /* inputs */
+ 0, /* outputs */
+ 0, /* changed_inputs */
+ NULL, /* private data */
free_texgen_data, /* destructor */
check_texgen, /* check */
alloc_texgen_data /* run -- initially set to alloc data */