summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-08-24 19:06:02 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-08-24 19:06:02 +0000
commit5947f8fd636004aa2f57fb792be0cf737610f2ba (patch)
tree0429e4e77f12cbe7822661ba8ad66a46bd6383ae /src/mesa/swrast
parentce9767f863e7788d4ab0099404abce72399f0b2c (diff)
fix fragment.position initialization bug
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_nvfragprog.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index fa16a41e28..826e71d45c 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1400,8 +1400,14 @@ init_machine( GLcontext *ctx, struct fp_machine *machine,
if (inputsRead & (1 << FRAG_ATTRIB_WPOS)) {
GLfloat *wpos = machine->Inputs[FRAG_ATTRIB_WPOS];
ASSERT(span->arrayMask & SPAN_Z);
- wpos[0] = (GLfloat) span->x + col;
- wpos[1] = (GLfloat) span->y;
+ if (span->arrayMask & SPAN_XY) {
+ wpos[0] = (GLfloat) span->array->x[col];
+ wpos[1] = (GLfloat) span->array->y[col];
+ }
+ else {
+ wpos[0] = (GLfloat) span->x + col;
+ wpos[1] = (GLfloat) span->y;
+ }
wpos[2] = (GLfloat) span->array->z[col] / ctx->DrawBuffer->_DepthMaxF;
wpos[3] = span->w + col * span->dwdx;
}