summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_tritemp.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-20 04:34:29 +0000
committerBrian Paul <[email protected]>2005-09-20 04:34:29 +0000
commit7265556b9aa0367e9b5031e7cb15ed2a5d73866d (patch)
treebf00760d2c5e6566f228ea9c3af8f196b6aaa627 /src/mesa/swrast/s_tritemp.h
parent22607975b49633a38ddf65127e26a30e9522d825 (diff)
Change zLeft and zval to GLuint. Seems to fix 32-bit Z computation
Diffstat (limited to 'src/mesa/swrast/s_tritemp.h')
-rw-r--r--src/mesa/swrast/s_tritemp.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index fe19a3363f9..d32a86bb88f 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 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"),
@@ -693,7 +693,8 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
DEPTH_TYPE *zRow = NULL;
GLint dZRowOuter = 0, dZRowInner; /* offset in bytes */
# endif
- GLfixed zLeft = 0, fdzOuter = 0, fdzInner;
+ GLuint zLeft = 0;
+ GLfixed fdzOuter = 0, fdzInner;
#endif
#ifdef INTERP_W
GLfloat wLeft = 0, dwOuter = 0, dwInner;
@@ -841,7 +842,8 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
GLfloat z0 = vLower->win[2];
if (depthBits <= 16) {
/* interpolate fixed-pt values */
- GLfloat tmp = (z0 * FIXED_SCALE + span.dzdx * adjx + span.dzdy * adjy) + FIXED_HALF;
+ GLfloat tmp = (z0 * FIXED_SCALE + span.dzdx * adjx
+ + span.dzdy * adjy) + FIXED_HALF;
if (tmp < MAX_GLUINT / 2)
zLeft = (GLfixed) tmp;
else
@@ -849,8 +851,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
fdzOuter = SignedFloatToFixed(span.dzdy + dxOuter * span.dzdx);
}
else {
- /* interpolate depth values exactly */
- zLeft = (GLint) (z0 + span.dzdx * FixedToFloat(adjx) + span.dzdy * FixedToFloat(adjy));
+ /* interpolate depth values w/out scaling */
+ zLeft = (GLuint) (z0 + span.dzdx * FixedToFloat(adjx)
+ + span.dzdy * FixedToFloat(adjy));
fdzOuter = (GLint) (span.dzdy + dxOuter * span.dzdx);
}
# ifdef DEPTH_TYPE