diff options
author | Michal Krol <[email protected]> | 2006-11-01 19:02:27 +0000 |
---|---|---|
committer | Michal Krol <[email protected]> | 2006-11-01 19:02:27 +0000 |
commit | 7d08e3a117b7ba8fa0d64713b333f6263bff24d0 (patch) | |
tree | f6b67c6205a1b09bf89e82d5d920290eb4a3826e /src/mesa/swrast/s_arbshader.c | |
parent | 9669804fe476f3497ac7e76e1e7b3e62d547fb6e (diff) |
Write back gl_FragDepth to span->array->z.
Diffstat (limited to 'src/mesa/swrast/s_arbshader.c')
-rw-r--r-- | src/mesa/swrast/s_arbshader.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_arbshader.c b/src/mesa/swrast/s_arbshader.c index 9e41d7c673d..ee971a36ecc 100644 --- a/src/mesa/swrast/s_arbshader.c +++ b/src/mesa/swrast/s_arbshader.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.6 * * Copyright (C) 2006 Brian Paul All Rights Reserved. * @@ -106,6 +106,15 @@ _swrast_exec_arbshader(GLcontext *ctx, SWspan *span) (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGCOLOR, vec, 0, 4 * sizeof(GLfloat), GL_FALSE); COPY_4V(span->array->color.sz4.rgba[i], vec); + + (**pro).UpdateFixedVarying(pro, SLANG_FRAGMENT_FIXED_FRAGDEPTH, vec, 0, + sizeof (GLfloat), GL_FALSE); + if (vec[0] <= 0.0f) + span->array->z[i] = 0; + else if (vec[0] >= 1.0f) + span->array->z[i] = ctx->DrawBuffer->_DepthMax; + else + span->array->z[i] = IROUND(vec[0] * ctx->DrawBuffer->_DepthMaxF); } } } |