diff options
author | Brian <[email protected]> | 2007-05-20 12:27:39 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-05-20 12:27:39 -0600 |
commit | 9e8a961dd7d7b717a9fb4ecdea1c1b60ea355efe (patch) | |
tree | 60c87644ec38f4693ceecbf440b120b02e2d07e6 /src/mesa/tnl_dd | |
parent | aa133a9dae53bc6aa50b88ee43deb8b34e8d0029 (diff) |
Overhaul/simplify SWvertex and SWspan attribute handling.
Instead of separate fog/specular/texcoord/varying code, just treat all of
them as generic attributes. Simplifies the point/line/triangle functions.
Diffstat (limited to 'src/mesa/tnl_dd')
-rw-r--r-- | src/mesa/tnl_dd/t_dd_vb.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c index 6cdd1bc0313..ab3bb37631b 100644 --- a/src/mesa/tnl_dd/t_dd_vb.c +++ b/src/mesa/tnl_dd/t_dd_vb.c @@ -89,15 +89,15 @@ void TAG(translate_vertex)(GLcontext *ctx, if (format == TINY_VERTEX_FORMAT) { if (HAVE_HW_VIEWPORT) { - dst->win[0] = s[0] * src->v.x + s[12]; - dst->win[1] = s[5] * src->v.y + s[13]; - dst->win[2] = s[10] * src->v.z + s[14]; - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; } else { - dst->win[0] = UNVIEWPORT_X( src->v.x ); - dst->win[1] = UNVIEWPORT_Y( src->v.y ); - dst->win[2] = UNVIEWPORT_Z( src->v.z ); - dst->win[3] = 1.0; + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); + dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); + dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); + dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; } dst->color[0] = src->tv.color.red; @@ -109,21 +109,21 @@ void TAG(translate_vertex)(GLcontext *ctx, if (HAVE_HW_VIEWPORT) { if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { GLfloat oow = 1.0 / src->v.w; - dst->win[0] = s[0] * src->v.x * oow + s[12]; - dst->win[1] = s[5] * src->v.y * oow + s[13]; - dst->win[2] = s[10] * src->v.z * oow + s[14]; - dst->win[3] = oow; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x * oow + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y * oow + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z * oow + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = oow; } else { - dst->win[0] = s[0] * src->v.x + s[12]; - dst->win[1] = s[5] * src->v.y + s[13]; - dst->win[2] = s[10] * src->v.z + s[14]; - dst->win[3] = src->v.w; + dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; + dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; + dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; + dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; } } else { - dst->win[0] = UNVIEWPORT_X( src->v.x ); - dst->win[1] = UNVIEWPORT_Y( src->v.y ); - dst->win[2] = UNVIEWPORT_Z( src->v.z ); - dst->win[3] = src->v.w; + dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); + dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); + dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); + dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; } dst->color[0] = src->v.color.red; @@ -131,11 +131,11 @@ void TAG(translate_vertex)(GLcontext *ctx, dst->color[2] = src->v.color.blue; dst->color[3] = src->v.color.alpha; - dst->specular[0] = src->v.specular.red; - dst->specular[1] = src->v.specular.green; - dst->specular[2] = src->v.specular.blue; + dst->attrib[FRAG_ATTRIB_COL1][0] = UBYTE_TO_FLOAT(src->v.specular.red); + dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(src->v.specular.green); + dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(src->v.specular.blue); - dst->attrib[FRAG_ATTRIB_FOGC][0] = src->v.specular.alpha/255.0; + dst->attrib[FRAG_ATTRIB_FOGC][0] = UBYTE_TO_FLOAT(src->v.specular.alpha); if (HAVE_PTEX_VERTICES && ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || |