diff options
author | Bryan Cain <[email protected]> | 2011-04-30 21:17:38 -0500 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2011-08-01 17:59:07 -0500 |
commit | 5768ed6429937940bd48f5de4f8383273952880a (patch) | |
tree | 631a8025de7a3df30b2e155aa4faa514b2485f1b | |
parent | 556bd82ce1227a568d69dfa0c22841986267d39f (diff) |
glsl_to_tgsi: define the sampler objects used
Fixes the Nexuiz title screen and the water in 0 A.D.
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index aa63539e5e8..5f3f0ba295a 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -2328,7 +2328,7 @@ extern "C" void free_glsl_to_tgsi_visitor(glsl_to_tgsi_visitor *v) * samplers, etc). */ static void -count_resources(glsl_to_tgsi_visitor *v) +count_resources(glsl_to_tgsi_visitor *v, gl_program *prog) { v->samplers_used = 0; @@ -2337,8 +2337,17 @@ count_resources(glsl_to_tgsi_visitor *v) if (_mesa_is_tex_instruction(inst->op)) { v->samplers_used |= 1 << inst->sampler; + + prog->SamplerTargets[inst->sampler] = + (gl_texture_index)inst->tex_target; + if (inst->tex_shadow) { + prog->ShadowSamplers |= 1 << inst->sampler; + } } } + + prog->SamplersUsed = v->samplers_used; + _mesa_update_shader_textures_used(prog); } @@ -4065,7 +4074,7 @@ get_mesa_program(struct gl_context *ctx, prog->NumInstructions = 0; do_set_program_inouts(shader->ir, prog); - count_resources(v); + count_resources(v, prog); check_resources(ctx, shader_program, v, prog); |