A number of vertex buffer fields like NormalPtr, FogCoordPtr, etc are really
just aliases for members of the VB->AttribPtr[] array. Begin replacing FogCoordPtr with VB->AttribPtr[_TNL_ATTRIB_FOG], and similarly for NormalPtr, TexCoordPtr, PointSizePtr, etc.
This commit is contained in:
@@ -415,7 +415,6 @@ struct vertex_buffer
|
|||||||
GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */
|
GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */
|
||||||
GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */
|
GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */
|
||||||
GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */
|
GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */
|
||||||
GLvector4f *PointSizePtr; /* _TNL_BIT_POS */
|
|
||||||
GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */
|
GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */
|
||||||
GLvector4f *VaryingPtr[MAX_VARYING_VECTORS];
|
GLvector4f *VaryingPtr[MAX_VARYING_VECTORS];
|
||||||
|
|
||||||
|
@@ -1334,13 +1334,16 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
VB->ClipPtr = &m->attribs[VERT_RESULT_HPOS];
|
VB->ClipPtr = &m->attribs[VERT_RESULT_HPOS];
|
||||||
VB->ClipPtr->count = VB->Count;
|
VB->ClipPtr->count = VB->Count;
|
||||||
|
|
||||||
|
/* XXX There seems to be confusion between using the VERT_ATTRIB_*
|
||||||
|
* values vs _TNL_ATTRIB_* tokens here:
|
||||||
|
*/
|
||||||
outputs = program->Base.OutputsWritten;
|
outputs = program->Base.OutputsWritten;
|
||||||
if (program->IsPositionInvariant)
|
if (program->IsPositionInvariant)
|
||||||
outputs |= (1<<VERT_RESULT_HPOS);
|
outputs |= (1<<VERT_RESULT_HPOS);
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_COL0)) {
|
if (outputs & (1<<VERT_RESULT_COL0)) {
|
||||||
VB->ColorPtr[0] = &m->attribs[VERT_RESULT_COL0];
|
VB->ColorPtr[0] =
|
||||||
VB->AttribPtr[VERT_ATTRIB_COLOR0] = VB->ColorPtr[0];
|
VB->AttribPtr[VERT_ATTRIB_COLOR0] = &m->attribs[VERT_RESULT_COL0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_BFC0)) {
|
if (outputs & (1<<VERT_RESULT_BFC0)) {
|
||||||
@@ -1348,8 +1351,8 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_COL1)) {
|
if (outputs & (1<<VERT_RESULT_COL1)) {
|
||||||
VB->SecondaryColorPtr[0] = &m->attribs[VERT_RESULT_COL1];
|
VB->SecondaryColorPtr[0] =
|
||||||
VB->AttribPtr[VERT_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0];
|
VB->AttribPtr[VERT_ATTRIB_COLOR1] = &m->attribs[VERT_RESULT_COL1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_BFC1)) {
|
if (outputs & (1<<VERT_RESULT_BFC1)) {
|
||||||
@@ -1357,19 +1360,18 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_FOGC)) {
|
if (outputs & (1<<VERT_RESULT_FOGC)) {
|
||||||
VB->FogCoordPtr = &m->attribs[VERT_RESULT_FOGC];
|
VB->FogCoordPtr =
|
||||||
VB->AttribPtr[VERT_ATTRIB_FOG] = VB->FogCoordPtr;
|
VB->AttribPtr[VERT_ATTRIB_FOG] = &m->attribs[VERT_RESULT_FOGC];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs & (1<<VERT_RESULT_PSIZ)) {
|
if (outputs & (1<<VERT_RESULT_PSIZ)) {
|
||||||
VB->PointSizePtr = &m->attribs[VERT_RESULT_PSIZ];
|
|
||||||
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &m->attribs[VERT_RESULT_PSIZ];
|
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &m->attribs[VERT_RESULT_PSIZ];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||||
if (outputs & (1<<(VERT_RESULT_TEX0+i))) {
|
if (outputs & (1<<(VERT_RESULT_TEX0+i))) {
|
||||||
VB->TexCoordPtr[i] = &m->attribs[VERT_RESULT_TEX0 + i];
|
VB->TexCoordPtr[i] =
|
||||||
VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i];
|
VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &m->attribs[VERT_RESULT_TEX0 + i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1380,10 +1382,10 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
VEC_ELT(VB->ClipPtr, GLfloat, i)[1],
|
VEC_ELT(VB->ClipPtr, GLfloat, i)[1],
|
||||||
VEC_ELT(VB->ClipPtr, GLfloat, i)[2],
|
VEC_ELT(VB->ClipPtr, GLfloat, i)[2],
|
||||||
VEC_ELT(VB->ClipPtr, GLfloat, i)[3],
|
VEC_ELT(VB->ClipPtr, GLfloat, i)[3],
|
||||||
VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[0],
|
VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[0],
|
||||||
VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[1],
|
VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[1],
|
||||||
VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[2],
|
VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[2],
|
||||||
VEC_ELT(VB->TexCoordPtr[0], GLfloat, i)[3]);
|
VEC_ELT(VB->AttribPtr[VERT_ATTRIB_TEX0], GLfloat, i)[3]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -236,25 +236,30 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag
|
|||||||
|
|
||||||
vb->ClipPtr = &store->outputs[VERT_RESULT_HPOS];
|
vb->ClipPtr = &store->outputs[VERT_RESULT_HPOS];
|
||||||
vb->ClipPtr->count = vb->Count;
|
vb->ClipPtr->count = vb->Count;
|
||||||
vb->ColorPtr[0] = &store->outputs[VERT_RESULT_COL0];
|
|
||||||
vb->SecondaryColorPtr[0] = &store->outputs[VERT_RESULT_COL1];
|
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
|
|
||||||
vb->TexCoordPtr[i] = &store->outputs[VERT_RESULT_TEX0 + i];
|
|
||||||
vb->ColorPtr[1] = &store->outputs[VERT_RESULT_BFC0];
|
|
||||||
vb->SecondaryColorPtr[1] = &store->outputs[VERT_RESULT_BFC1];
|
|
||||||
vb->FogCoordPtr = &store->outputs[VERT_RESULT_FOGC];
|
|
||||||
vb->PointSizePtr = &store->outputs[VERT_RESULT_PSIZ];
|
|
||||||
for (i = 0; i < MAX_VARYING_VECTORS; i++)
|
|
||||||
vb->VaryingPtr[i] = &store->varyings[i];
|
|
||||||
|
|
||||||
|
vb->ColorPtr[0] = &store->outputs[VERT_RESULT_COL0];
|
||||||
vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0];
|
vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0];
|
||||||
vb->AttribPtr[VERT_ATTRIB_COLOR1] = vb->SecondaryColorPtr[0];
|
vb->ColorPtr[1] = &store->outputs[VERT_RESULT_BFC0];
|
||||||
vb->AttribPtr[VERT_ATTRIB_FOG] = vb->FogCoordPtr;
|
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
|
vb->SecondaryColorPtr[0] =
|
||||||
vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = vb->TexCoordPtr[i];
|
vb->AttribPtr[VERT_ATTRIB_COLOR1] = &store->outputs[VERT_RESULT_COL1];
|
||||||
|
|
||||||
|
vb->SecondaryColorPtr[1] = &store->outputs[VERT_RESULT_BFC1];
|
||||||
|
|
||||||
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||||
|
vb->TexCoordPtr[i] =
|
||||||
|
vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->outputs[VERT_RESULT_TEX0 + i];
|
||||||
|
}
|
||||||
|
|
||||||
|
vb->FogCoordPtr =
|
||||||
|
vb->AttribPtr[VERT_ATTRIB_FOG] = &store->outputs[VERT_RESULT_FOGC];
|
||||||
|
|
||||||
vb->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->outputs[VERT_RESULT_PSIZ];
|
vb->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->outputs[VERT_RESULT_PSIZ];
|
||||||
for (i = 0; i < MAX_VARYING_VECTORS; i++)
|
|
||||||
|
for (i = 0; i < MAX_VARYING_VECTORS; i++) {
|
||||||
|
vb->VaryingPtr[i] = &store->varyings[i];
|
||||||
vb->AttribPtr[_TNL_ATTRIB_GENERIC0 + i] = vb->VaryingPtr[i];
|
vb->AttribPtr[_TNL_ATTRIB_GENERIC0 + i] = vb->VaryingPtr[i];
|
||||||
|
}
|
||||||
|
|
||||||
store->ormask = 0;
|
store->ormask = 0;
|
||||||
store->andmask = CLIP_FRUSTUM_BITS;
|
store->andmask = CLIP_FRUSTUM_BITS;
|
||||||
|
@@ -52,8 +52,8 @@ static GLboolean run_cull_stage( GLcontext *ctx,
|
|||||||
const GLfloat a = ctx->Transform.CullObjPos[0];
|
const GLfloat a = ctx->Transform.CullObjPos[0];
|
||||||
const GLfloat b = ctx->Transform.CullObjPos[1];
|
const GLfloat b = ctx->Transform.CullObjPos[1];
|
||||||
const GLfloat c = ctx->Transform.CullObjPos[2];
|
const GLfloat c = ctx->Transform.CullObjPos[2];
|
||||||
GLfloat *norm = (GLfloat *)VB->NormalPtr->data;
|
GLfloat *norm = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
GLuint stride = VB->NormalPtr->stride;
|
GLuint stride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
GLuint count = VB->Count;
|
GLuint count = VB->Count;
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
|
@@ -158,8 +158,8 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) {
|
if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) {
|
||||||
/* Fog is computed from vertex or fragment Z values */
|
/* Fog is computed from vertex or fragment Z values */
|
||||||
/* source = VB->ObjPtr or VB->EyePtr coords */
|
/* source = VB->ObjPtr or VB->EyePtr coords */
|
||||||
/* dest = VB->FogCoordPtr = fog stage private storage */
|
/* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */
|
||||||
VB->FogCoordPtr = &store->fogcoord;
|
VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord;
|
||||||
|
|
||||||
if (!ctx->_NeedEyeCoords) {
|
if (!ctx->_NeedEyeCoords) {
|
||||||
/* compute fog coords from object coords */
|
/* compute fog coords from object coords */
|
||||||
@@ -199,26 +199,26 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* use glFogCoord() coordinates */
|
/* use glFogCoord() coordinates */
|
||||||
input = VB->FogCoordPtr; /* source data */
|
input = VB->AttribPtr[_TNL_ATTRIB_FOG]; /* source data */
|
||||||
|
|
||||||
/* input->count may be one if glFogCoord was only called once
|
/* input->count may be one if glFogCoord was only called once
|
||||||
* before glBegin. But we need to compute fog for all vertices.
|
* before glBegin. But we need to compute fog for all vertices.
|
||||||
*/
|
*/
|
||||||
input->count = VB->ObjPtr->count;
|
input->count = VB->ObjPtr->count;
|
||||||
|
|
||||||
VB->FogCoordPtr = &store->fogcoord; /* dest data */
|
VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; /* dest data */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tnl->_DoVertexFog) {
|
if (tnl->_DoVertexFog) {
|
||||||
/* compute blend factors from fog coordinates */
|
/* compute blend factors from fog coordinates */
|
||||||
compute_fog_blend_factors( ctx, VB->FogCoordPtr, input );
|
compute_fog_blend_factors( ctx, VB->AttribPtr[_TNL_ATTRIB_FOG], input );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* results = incoming fog coords (compute fog per-fragment later) */
|
/* results = incoming fog coords (compute fog per-fragment later) */
|
||||||
VB->FogCoordPtr = input;
|
VB->AttribPtr[_TNL_ATTRIB_FOG] = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
VB->AttribPtr[_TNL_ATTRIB_FOG] = VB->FogCoordPtr;
|
VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,8 +56,8 @@ static void TAG(light_rgba_spec)( GLcontext *ctx,
|
|||||||
|
|
||||||
const GLuint vstride = input->stride;
|
const GLuint vstride = input->stride;
|
||||||
const GLfloat *vertex = (GLfloat *)input->data;
|
const GLfloat *vertex = (GLfloat *)input->data;
|
||||||
const GLuint nstride = VB->NormalPtr->stride;
|
const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
|
|
||||||
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
||||||
GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data;
|
GLfloat (*Fspec)[4] = (GLfloat (*)[4]) store->LitSecondary[0].data;
|
||||||
@@ -245,8 +245,8 @@ static void TAG(light_rgba)( GLcontext *ctx,
|
|||||||
|
|
||||||
const GLuint vstride = input->stride;
|
const GLuint vstride = input->stride;
|
||||||
const GLfloat *vertex = (GLfloat *) input->data;
|
const GLfloat *vertex = (GLfloat *) input->data;
|
||||||
const GLuint nstride = VB->NormalPtr->stride;
|
const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
|
|
||||||
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
||||||
#if IDX & LIGHT_TWOSIDE
|
#if IDX & LIGHT_TWOSIDE
|
||||||
@@ -428,8 +428,8 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
|
|||||||
|
|
||||||
{
|
{
|
||||||
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
|
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
|
||||||
const GLuint nstride = VB->NormalPtr->stride;
|
const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
||||||
#if IDX & LIGHT_TWOSIDE
|
#if IDX & LIGHT_TWOSIDE
|
||||||
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
||||||
@@ -440,7 +440,7 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
|
|||||||
#if IDX & LIGHT_MATERIAL
|
#if IDX & LIGHT_MATERIAL
|
||||||
const GLuint nr = VB->Count;
|
const GLuint nr = VB->Count;
|
||||||
#else
|
#else
|
||||||
const GLuint nr = VB->NormalPtr->count;
|
const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
@@ -536,8 +536,8 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
|
|||||||
{
|
{
|
||||||
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
|
struct light_stage_data *store = LIGHT_STAGE_DATA(stage);
|
||||||
GLfloat sumA[2];
|
GLfloat sumA[2];
|
||||||
const GLuint nstride = VB->NormalPtr->stride;
|
const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
GLfloat (*Fcolor)[4] = (GLfloat (*)[4]) store->LitColor[0].data;
|
||||||
#if IDX & LIGHT_TWOSIDE
|
#if IDX & LIGHT_TWOSIDE
|
||||||
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
GLfloat (*Bcolor)[4] = (GLfloat (*)[4]) store->LitColor[1].data;
|
||||||
@@ -546,7 +546,7 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
|
|||||||
#if IDX & LIGHT_MATERIAL
|
#if IDX & LIGHT_MATERIAL
|
||||||
const GLuint nr = VB->Count;
|
const GLuint nr = VB->Count;
|
||||||
#else
|
#else
|
||||||
const GLuint nr = VB->NormalPtr->count;
|
const GLuint nr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count;
|
||||||
#endif
|
#endif
|
||||||
const struct gl_light *light;
|
const struct gl_light *light;
|
||||||
|
|
||||||
@@ -656,8 +656,8 @@ static void TAG(light_ci)( GLcontext *ctx,
|
|||||||
GLuint j;
|
GLuint j;
|
||||||
const GLuint vstride = input->stride;
|
const GLuint vstride = input->stride;
|
||||||
const GLfloat *vertex = (GLfloat *) input->data;
|
const GLfloat *vertex = (GLfloat *) input->data;
|
||||||
const GLuint nstride = VB->NormalPtr->stride;
|
const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride;
|
||||||
const GLfloat *normal = (GLfloat *)VB->NormalPtr->data;
|
const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data;
|
||||||
GLfloat *indexResult[2];
|
GLfloat *indexResult[2];
|
||||||
const GLuint nr = VB->Count;
|
const GLuint nr = VB->Count;
|
||||||
|
|
||||||
|
@@ -67,19 +67,19 @@ run_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
|
|
||||||
store->NormalTransform( ctx->ModelviewMatrixStack.Top,
|
store->NormalTransform( ctx->ModelviewMatrixStack.Top,
|
||||||
ctx->_ModelViewInvScale,
|
ctx->_ModelViewInvScale,
|
||||||
VB->NormalPtr, /* input normals */
|
VB->AttribPtr[_TNL_ATTRIB_NORMAL], /* input normals */
|
||||||
lengths,
|
lengths,
|
||||||
&store->normal ); /* resulting normals */
|
&store->normal ); /* resulting normals */
|
||||||
|
|
||||||
if (VB->NormalPtr->count > 1) {
|
if (VB->AttribPtr[_TNL_ATTRIB_NORMAL]->count > 1) {
|
||||||
store->normal.stride = 4 * sizeof(GLfloat);
|
store->normal.stride = 4 * sizeof(GLfloat);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
store->normal.stride = 0;
|
store->normal.stride = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &store->normal;
|
||||||
VB->NormalPtr = &store->normal;
|
VB->NormalPtr = &store->normal;
|
||||||
VB->AttribPtr[_TNL_ATTRIB_NORMAL] = VB->NormalPtr;
|
|
||||||
|
|
||||||
VB->NormalLengthPtr = NULL; /* no longer valid */
|
VB->NormalLengthPtr = NULL; /* no longer valid */
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
@@ -68,7 +68,6 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
|
|||||||
size[i][0] = pointSize * atten; /* clamping done in rasterization */
|
size[i][0] = pointSize * atten; /* clamping done in rasterization */
|
||||||
}
|
}
|
||||||
|
|
||||||
VB->PointSizePtr = &store->PointSize;
|
|
||||||
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize;
|
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->PointSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -156,20 +156,18 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
|
|||||||
VB->SecondaryColorPtr[0] = &store->attribs[VERT_RESULT_COL1];
|
VB->SecondaryColorPtr[0] = &store->attribs[VERT_RESULT_COL1];
|
||||||
VB->SecondaryColorPtr[1] = &store->attribs[VERT_RESULT_BFC1];
|
VB->SecondaryColorPtr[1] = &store->attribs[VERT_RESULT_BFC1];
|
||||||
VB->FogCoordPtr = &store->attribs[VERT_RESULT_FOGC];
|
VB->FogCoordPtr = &store->attribs[VERT_RESULT_FOGC];
|
||||||
VB->PointSizePtr = &store->attribs[VERT_RESULT_PSIZ];
|
|
||||||
|
|
||||||
VB->AttribPtr[VERT_ATTRIB_COLOR0] = VB->ColorPtr[0];
|
VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->attribs[VERT_RESULT_COL0];
|
||||||
VB->AttribPtr[VERT_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0];
|
VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->attribs[VERT_RESULT_COL1];
|
||||||
VB->AttribPtr[VERT_ATTRIB_FOG] = VB->FogCoordPtr;
|
VB->AttribPtr[VERT_ATTRIB_FOG] = &store->attribs[VERT_RESULT_FOGC];
|
||||||
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->attribs[VERT_RESULT_PSIZ];
|
VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->attribs[VERT_RESULT_PSIZ];
|
||||||
|
|
||||||
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
||||||
VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] =
|
VB->TexCoordPtr[i] =
|
||||||
&store->attribs[VERT_RESULT_TEX0 + i];
|
VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]
|
||||||
|
= &store->attribs[VERT_RESULT_TEX0 + i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Cliptest and perspective divide. Clip functions must clear
|
/* Cliptest and perspective divide. Clip functions must clear
|
||||||
* the clipmask.
|
* the clipmask.
|
||||||
*/
|
*/
|
||||||
|
@@ -254,12 +254,12 @@ static void texgen_reflection_map_nv( GLcontext *ctx,
|
|||||||
GLuint unit )
|
GLuint unit )
|
||||||
{
|
{
|
||||||
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
||||||
GLvector4f *in = VB->TexCoordPtr[unit];
|
GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit];
|
||||||
GLvector4f *out = &store->texcoord[unit];
|
GLvector4f *out = &store->texcoord[unit];
|
||||||
|
|
||||||
build_f_tab[VB->EyePtr->size]( out->start,
|
build_f_tab[VB->EyePtr->size]( out->start,
|
||||||
out->stride,
|
out->stride,
|
||||||
VB->NormalPtr,
|
VB->AttribPtr[_TNL_ATTRIB_NORMAL],
|
||||||
VB->EyePtr );
|
VB->EyePtr );
|
||||||
|
|
||||||
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
|
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3;
|
||||||
@@ -276,9 +276,9 @@ static void texgen_normal_map_nv( GLcontext *ctx,
|
|||||||
GLuint unit )
|
GLuint unit )
|
||||||
{
|
{
|
||||||
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
||||||
GLvector4f *in = VB->TexCoordPtr[unit];
|
GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit];
|
||||||
GLvector4f *out = &store->texcoord[unit];
|
GLvector4f *out = &store->texcoord[unit];
|
||||||
GLvector4f *normal = VB->NormalPtr;
|
GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
|
||||||
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start;
|
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->start;
|
||||||
GLuint count = VB->Count;
|
GLuint count = VB->Count;
|
||||||
GLuint i;
|
GLuint i;
|
||||||
@@ -304,7 +304,7 @@ static void texgen_sphere_map( GLcontext *ctx,
|
|||||||
GLuint unit )
|
GLuint unit )
|
||||||
{
|
{
|
||||||
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
|
||||||
GLvector4f *in = VB->TexCoordPtr[unit];
|
GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit];
|
||||||
GLvector4f *out = &store->texcoord[unit];
|
GLvector4f *out = &store->texcoord[unit];
|
||||||
GLfloat (*texcoord)[4] = (GLfloat (*)[4]) out->start;
|
GLfloat (*texcoord)[4] = (GLfloat (*)[4]) out->start;
|
||||||
GLuint count = VB->Count;
|
GLuint count = VB->Count;
|
||||||
@@ -314,7 +314,7 @@ static void texgen_sphere_map( GLcontext *ctx,
|
|||||||
|
|
||||||
(build_m_tab[VB->EyePtr->size])( store->tmp_f,
|
(build_m_tab[VB->EyePtr->size])( store->tmp_f,
|
||||||
store->tmp_m,
|
store->tmp_m,
|
||||||
VB->NormalPtr,
|
VB->AttribPtr[_TNL_ATTRIB_NORMAL],
|
||||||
VB->EyePtr );
|
VB->EyePtr );
|
||||||
|
|
||||||
out->size = MAX2(in->size,2);
|
out->size = MAX2(in->size,2);
|
||||||
@@ -338,12 +338,12 @@ static void texgen( GLcontext *ctx,
|
|||||||
{
|
{
|
||||||
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
||||||
struct vertex_buffer *VB = &tnl->vb;
|
struct vertex_buffer *VB = &tnl->vb;
|
||||||
GLvector4f *in = VB->TexCoordPtr[unit];
|
GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit];
|
||||||
GLvector4f *out = &store->texcoord[unit];
|
GLvector4f *out = &store->texcoord[unit];
|
||||||
const 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 *obj = VB->ObjPtr;
|
||||||
const GLvector4f *eye = VB->EyePtr;
|
const GLvector4f *eye = VB->EyePtr;
|
||||||
const GLvector4f *normal = VB->NormalPtr;
|
const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
|
||||||
const GLfloat *m = store->tmp_m;
|
const GLfloat *m = store->tmp_m;
|
||||||
const GLuint count = VB->Count;
|
const GLuint count = VB->Count;
|
||||||
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data;
|
GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data;
|
||||||
@@ -501,8 +501,8 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
|
|||||||
|
|
||||||
store->TexgenFunc[i]( ctx, store, i );
|
store->TexgenFunc[i]( ctx, store, i );
|
||||||
|
|
||||||
VB->AttribPtr[VERT_ATTRIB_TEX0+i] =
|
VB->TexCoordPtr[i] =
|
||||||
VB->TexCoordPtr[i] = &store->texcoord[i];
|
VB->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->texcoord[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,10 +74,10 @@ static GLboolean run_texmat_stage( GLcontext *ctx,
|
|||||||
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) {
|
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) {
|
||||||
(void) TransformRaw( &store->texcoord[i],
|
(void) TransformRaw( &store->texcoord[i],
|
||||||
ctx->TextureMatrixStack[i].Top,
|
ctx->TextureMatrixStack[i].Top,
|
||||||
VB->TexCoordPtr[i]);
|
VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]);
|
||||||
|
|
||||||
VB->AttribPtr[VERT_ATTRIB_TEX0+i] =
|
VB->TexCoordPtr[i] =
|
||||||
VB->TexCoordPtr[i] = &store->texcoord[i];
|
VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &store->texcoord[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user