diff options
author | Keith Whitwell <[email protected]> | 2005-05-10 10:25:16 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-05-10 10:25:16 +0000 |
commit | 586f2c59fe80a31b6342805e6ffc39ca878b098d (patch) | |
tree | 467cfd7cd173392e29be06ec7756572e6adf21c0 /src/mesa/main | |
parent | e3b0c19ec98cb97138e1d13d46fdb4a5449837f1 (diff) |
Temporary fix - delete and recreate texenvprogram so that drivers
notice when it changes.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/texenvprogram.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 1f9d7ae1c50..1618287af6d 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -37,7 +37,7 @@ #include "shader/arbfragparse.h" -#define DISASSEM 0 +#define DISASSEM 1 /* Use uregs to represent registers internally, translate to Mesa's * expected formats on emit. @@ -172,8 +172,10 @@ static struct ureg get_tex_temp( struct texenv_fragment_program *p ) /* Then any unused temporary: */ - if (!bit) + if (!bit) { bit = ffs( ~p->temp_flag ); + p->program->NumTexIndirections++; + } if (!bit) { fprintf(stderr, "%s: out of temporaries\n", __FILE__); @@ -689,9 +691,12 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) if (ctx->FragmentProgram._Enabled) return; - if (!ctx->_TexEnvProgram) - ctx->_TexEnvProgram = (struct fragment_program *) - ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); + if (ctx->_TexEnvProgram) + ctx->Driver.DeleteProgram(ctx, ctx->_TexEnvProgram); + + ctx->FragmentProgram._Current = ctx->_TexEnvProgram = + (struct fragment_program *) + ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); p.ctx = ctx; p.program = ctx->_TexEnvProgram; |