summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-03 13:46:48 -0600
committerBrian <[email protected]>2007-10-03 13:50:11 -0600
commit5356ba250c078c861f3a31a587b79570308cfc23 (patch)
treeda6d1b1c3b515e2acb65563c8e1803dd9931c3e1 /src
parenta9f0330061471ba47beb2369884d7661b715722e (diff)
handle frag progs that write Z
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mesa/pipe/softpipe/sp_quad_fs.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c
index a8c25c48683..d9a2e6b9cf2 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 ) {