diff options
author | Maciej Cencora <m.cencora@gmail.com> | 2010-03-21 11:19:02 +0100 |
---|---|---|
committer | Maciej Cencora <m.cencora@gmail.com> | 2010-03-23 18:47:04 +0100 |
commit | d89d608361987817853cc18941fde416b76d4baf (patch) | |
tree | b0e0a4bfbbe101ce6fecea88ce1507899a475b9d | |
parent | 3428a305150e98c8002e0fb339f5667c5533c0d1 (diff) |
r300: clean fog_attr/wpos_attr if code accessing these attributes has been removed FP during compilation
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_fragprog_common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 61ea5e4d9a..0646da4624 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -256,6 +256,19 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog fp->InputsRead = compiler.Base.Program.InputsRead; + /* Clear the fog/wpos_attr if code accessing these + * attributes has been removed during compilation + */ + if (fp->fog_attr != FRAG_ATTRIB_MAX) { + if (!(fp->InputsRead & (1 << fp->fog_attr))) + fp->fog_attr = FRAG_ATTRIB_MAX; + } + + if (fp->wpos_attr != FRAG_ATTRIB_MAX) { + if (!(fp->InputsRead & (1 << fp->wpos_attr))) + fp->wpos_attr = FRAG_ATTRIB_MAX; + } + rc_destroy(&compiler.Base); } |