summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vertex.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2004-01-08 13:55:24 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2004-01-08 13:55:24 +0000
commitfb2a95b39142a2507e710d8a8e973f107fffb654 (patch)
tree1fcf6d5d9aa7d511702aa8a53ff495f16728c2d8 /src/mesa/tnl/t_vertex.c
parent2fa774edba710b32bc6999a65b92ade2db415589 (diff)
Perform check for dstclip[3] == 0.
Diffstat (limited to 'src/mesa/tnl/t_vertex.c')
-rw-r--r--src/mesa/tnl/t_vertex.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index 575db2a966..7fe7194a3d 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -716,15 +716,17 @@ static void generic_interp( GLcontext *ctx,
if (tnl->NeedNdcCoords) {
const GLfloat *dstclip = VB->ClipPtr->data[edst];
- const GLfloat w = 1.0 / dstclip[3];
- GLfloat pos[4];
+ if (dstclip[3] != 0.0) {
+ const GLfloat w = 1.0 / dstclip[3];
+ GLfloat pos[4];
- pos[0] = dstclip[0] * w;
- pos[1] = dstclip[1] * w;
- pos[2] = dstclip[2] * w;
- pos[3] = w;
+ pos[0] = dstclip[0] * w;
+ pos[1] = dstclip[1] * w;
+ pos[2] = dstclip[2] * w;
+ pos[3] = w;
- a[0].insert[4-1]( &a[0], vdst, pos );
+ a[0].insert[4-1]( &a[0], vdst, pos );
+ }
}
else {
a[0].insert[4-1]( &a[0], vdst, VB->ClipPtr->data[edst] );