From 635c4c41bdf111462939da292d65328595d314e8 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 3 Oct 2007 14:43:57 -0600 Subject: Add outputs_written bitfield to pipe_shader_state, use it to determine if fragment shader writes Z. --- src/mesa/pipe/p_state.h | 4 +--- src/mesa/pipe/softpipe/sp_quad_fs.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/mesa/pipe') diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h index ac9d7009cc..64c5f13f23 100644 --- a/src/mesa/pipe/p_state.h +++ b/src/mesa/pipe/p_state.h @@ -150,13 +150,11 @@ struct pipe_shader_state { #endif void *executable; - /** These fields somewhat constitute the shader "signature" */ ubyte num_inputs; ubyte num_outputs; - + uint outputs_written; /**< bitmask */ ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS]; /**< TGSI_SEMANTIC_x */ ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS]; - ubyte output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; /**< TGSI_SEMANTIC_x */ ubyte output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; }; diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c index d9349a2280..2b0c4366bd 100755 --- a/src/mesa/pipe/softpipe/sp_quad_fs.c +++ b/src/mesa/pipe/softpipe/sp_quad_fs.c @@ -116,8 +116,7 @@ shade_quad( sizeof( quad->outputs.color ) ); /* Z */ - if (qss->stage.softpipe->fs->output_semantic_name[0] - == TGSI_SEMANTIC_POSITION) { + if (qss->stage.softpipe->fs->outputs_written & 0x1) { /* output[0] is new Z */ uint i; for (i = 0; i < 4; i++) { -- cgit v1.2.3