From 5356ba250c078c861f3a31a587b79570308cfc23 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 3 Oct 2007 13:46:48 -0600 Subject: handle frag progs that write Z --- src/mesa/pipe/softpipe/sp_quad_fs.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c index a8c25c4868..d9a2e6b9cf 100755 --- a/src/mesa/pipe/softpipe/sp_quad_fs.c +++ b/src/mesa/pipe/softpipe/sp_quad_fs.c @@ -123,25 +123,22 @@ shade_quad( &machine->Outputs[1].xyzw[0].f[0], sizeof( quad->outputs.color ) ); -#if 0 - if( softpipe->need_z ) { - /* XXX temporary */ - memcpy( - quad->outputs.depth, - machine->Outputs[0].xyzw[2], - sizeof( quad->outputs.depth ) ); + /* Z */ + if (qss->stage.softpipe->fs->output_semantic_name[0] + == TGSI_SEMANTIC_POSITION) { + /* output[0] is new Z */ + uint i; + for (i = 0; i < 4; i++) { + quad->outputs.depth[i] = machine->Outputs[0].xyzw[2].f[i]; + } } -#else - { + else { + /* pass input Z to output Z */ uint i; for (i = 0; i < 4; i++) { quad->outputs.depth[i] = machine->Inputs[0].xyzw[2].f[i]; -#if 0 - printf("output z %f\n", quad->outputs.depth[i]); -#endif } } -#endif /* shader may cull fragments */ if( quad->mask ) { -- cgit v1.2.3