diff options
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 4 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_link.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index cad983443a7..c5a0fcb6c77 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 */ diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index e33272eff2a..57dbfc23885 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -173,7 +173,7 @@ link_uniform_vars(struct gl_shader_program *shProg, * Furthermore, we'll need to fix the state-var's size/datatype info. */ - if (p->Type == PROGRAM_UNIFORM || + if ((p->Type == PROGRAM_UNIFORM && p->Used) || p->Type == PROGRAM_SAMPLER) { _mesa_append_uniform(shProg->Uniforms, p->Name, prog->Target, i); } |