summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_feedback.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-02-05 10:10:01 -0700
committerBrian <[email protected]>2007-02-05 10:10:01 -0700
commitdd34fe8679fa200e55cfaf8e80bbecdecea084e3 (patch)
tree329b7c0280a198b8dabd02a5afb97dcaa5f3f4bd /src/mesa/swrast/s_feedback.c
parent93b975a1d9fcc4a10987676f7368809522f27d71 (diff)
Merge SWvertex texcoord and varying fields into attrib[] array field.
Fragment texcoords and varying code is now unified in the point/line/triangle rasterization code. In the future, merge color, fog, etc. attribs.
Diffstat (limited to 'src/mesa/swrast/s_feedback.c')
-rw-r--r--src/mesa/swrast/s_feedback.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index 26cb05cd560..5d3fbdfeb6e 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -46,10 +46,10 @@
static void feedback_vertex( GLcontext *ctx,
const SWvertex *v, const SWvertex *pv )
{
- const GLuint texUnit = 0; /* See section 5.3 of 1.2.1 spec */
GLfloat win[4];
GLfloat color[4];
GLfloat tc[4];
+ const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0];
win[0] = v->win[0];
win[1] = v->win[1];
@@ -61,16 +61,15 @@ static void feedback_vertex( GLcontext *ctx,
color[2] = CHAN_TO_FLOAT(pv->color[2]);
color[3] = CHAN_TO_FLOAT(pv->color[3]);
- if (v->texcoord[texUnit][3] != 1.0 &&
- v->texcoord[texUnit][3] != 0.0) {
- GLfloat invq = 1.0F / v->texcoord[texUnit][3];
- tc[0] = v->texcoord[texUnit][0] * invq;
- tc[1] = v->texcoord[texUnit][1] * invq;
- tc[2] = v->texcoord[texUnit][2] * invq;
- tc[3] = v->texcoord[texUnit][3];
+ if (vtc[3] != 1.0 && vtc[3] != 0.0) {
+ GLfloat invq = 1.0F / vtc[3];
+ tc[0] = vtc[0] * invq;
+ tc[1] = vtc[1] * invq;
+ tc[2] = vtc[2] * invq;
+ tc[3] = vtc[3];
}
else {
- COPY_4V(tc, v->texcoord[texUnit]);
+ COPY_4V(tc, vtc);
}
_mesa_feedback_vertex( ctx, win, color, (GLfloat) v->index, tc );