Module: Mesa Branch: 7.8 Commit: 70929f4505d5cb1b9848a02e8359e9f7a8ef598c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=70929f4505d5cb1b9848a02e8359e9f7a8ef598c
Author: Maciej Cencora <[email protected]> Date: Sun Mar 21 11:19:02 2010 +0100 r300: clean fog_attr/wpos_attr if code accessing these attributes has been removed FP during compilation --- 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 61ea5e4..0646da4 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); } _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
