diff options
author | Brian <[email protected]> | 2007-06-25 09:44:28 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-06-25 09:44:28 -0600 |
commit | 0717daf4f9861647ae486e0231a56df529630c76 (patch) | |
tree | 98bf9fef982d66716aab6569232158a136c36914 | |
parent | 8f6d06d037524f012416da5b56889e74bcf09f8f (diff) |
emit quad->outputs.depth[], hack need_z
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_fs.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c index 02fcc054679..b4470ac94a5 100644 --- a/src/mesa/pipe/softpipe/sp_quad_fs.c +++ b/src/mesa/pipe/softpipe/sp_quad_fs.c @@ -125,6 +125,7 @@ shade_quad( struct quad_stage *qs, struct quad_header *quad ) GLfloat fx = quad->x0; GLfloat fy = quad->y0; GLuint i, j; + GLboolean need_z = softpipe->depth_test.enabled; /* XXX hack */ exec.coef = quad->coef; @@ -143,12 +144,12 @@ shade_quad( struct quad_stage *qs, struct quad_header *quad ) /* Z and W are done by linear interpolation: * XXX we'll probably have to use integers for Z */ - if (softpipe->need_z) { - linterp(&exec, 0, 2); + if (/*softpipe->*/need_z) { + linterp(&exec, 0, 2); /* attr[0].z */ } if (softpipe->need_w) { - linterp(&exec, 0, 3); + linterp(&exec, 0, 3); /* attr[0].w */ // invert(&exec, 0, 3); } @@ -189,6 +190,13 @@ shade_quad( struct quad_stage *qs, struct quad_header *quad ) memcpy(quad->outputs.color, exec.attr[attr], sizeof(quad->outputs.color)); + + if (need_z) { + quad->outputs.depth[0] = exec.attr[0][2][0]; + quad->outputs.depth[1] = exec.attr[0][2][1]; + quad->outputs.depth[2] = exec.attr[0][2][2]; + quad->outputs.depth[3] = exec.attr[0][2][3]; + } } #endif |