summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_fragprog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 7f205a200af..1caa0ebc226 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -237,7 +237,8 @@ run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
else if (depth >= 1.0)
span->array->z[i] = ctx->DrawBuffer->_DepthMax;
else
- span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
+ span->array->z[i] =
+ (GLuint) (depth * ctx->DrawBuffer->_DepthMaxF + 0.5F);
}
}
else {