diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-19 10:27:06 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-19 10:27:06 -0600 |
commit | 3e1706f720b211f27a4aa88af2141db0c793adbb (patch) | |
tree | ed60e31df217ec796fa024c3327e4b40982f1c09 /src/mesa/shader/slang/slang_emit.c | |
parent | df9bd01ea0c8a4d5b5ffecad4482ca6b4f2db33d (diff) |
mesa: glsl: add usage tracking for uniform vars
Unused uniforms are no longer included in the active uniforms list.
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index cad983443a..c5a0fcb6c7 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1703,6 +1703,10 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) if (n->Store->File == PROGRAM_STATE_VAR && n->Store->Index < 0) { n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters); } + else if (n->Store->File == PROGRAM_UNIFORM) { + /* mark var as used */ + _mesa_use_uniform(emitInfo->prog->Parameters, (char *) n->Var->a_name); + } if (n->Store->Index < 0) { /* probably ran out of registers */ |