summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast_setup
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-01-06 00:18:23 +0000
committerKeith Whitwell <[email protected]>2004-01-06 00:18:23 +0000
commit38bf45d4bbc576a695a2f7bb7d9ae3caf28a6838 (patch)
tree4eccfba049df5308ae2e8a0416df18be8cec1f74 /src/mesa/swrast_setup
parent44d4a8f64521fe9d398ecca5dc886171d8a40a7e (diff)
Fixes for _swsetup_Translate()
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r--src/mesa/swrast_setup/ss_context.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index df99fdb20b7..c1d932f245f 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -215,10 +215,17 @@ _swsetup_Wakeup( GLcontext *ctx )
void
_swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest )
{
+ const GLfloat *m = ctx->Viewport._WindowMap.m;
GLfloat tmp[4];
GLint i;
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, dest->win );
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp );
+
+ dest->win[0] = m[0] * tmp[0] + m[12];
+ dest->win[1] = m[5] * tmp[1] + m[13];
+ dest->win[2] = m[10] * tmp[2] + m[15];
+ dest->win[3] = tmp[3];
+
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0+i, dest->texcoord[i] );
@@ -227,7 +234,7 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest )
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp );
- UNCLAMPED_FLOAT_TO_RGB_CHAN( dest->specular, tmp );
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
dest->fog = tmp[0];