summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-11-14 18:12:16 -0800
committerIan Romanick <[email protected]>2012-01-11 12:51:24 -0800
commit6a992c3288b6f7a5d94172c9ad1908e71e58233e (patch)
tree01de8311508d0034fc622393f2e7abcbef4742bd /src/mesa/program/ir_to_mesa.cpp
parent32be81de39f7548e353afabf1215b0ea7c7b0916 (diff)
linker: Calculate the sampler to texture target mapping during linking
Track the calculated data in gl_shader_program instead of the individual assembly shaders. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 5a68fc51d08..8280efefe82 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2496,7 +2496,7 @@ print_program(struct prog_instruction *mesa_instructions,
* samplers, etc).
*/
static void
-count_resources(struct gl_program *prog)
+count_resources(struct gl_shader_program *shProg, struct gl_program *prog)
{
unsigned int i;
@@ -2506,8 +2506,6 @@ count_resources(struct gl_program *prog)
struct prog_instruction *inst = &prog->Instructions[i];
if (_mesa_is_tex_instruction(inst->Opcode)) {
- prog->SamplerTargets[inst->TexSrcUnit] =
- (gl_texture_index)inst->TexSrcTarget;
prog->SamplersUsed |= 1 << inst->TexSrcUnit;
if (inst->TexShadow) {
prog->ShadowSamplers |= 1 << inst->TexSrcUnit;
@@ -2515,7 +2513,7 @@ count_resources(struct gl_program *prog)
}
}
- _mesa_update_shader_textures_used(prog);
+ _mesa_update_shader_textures_used(shProg, prog);
}
class add_uniform_to_shader : public uniform_field_visitor {
@@ -3197,7 +3195,7 @@ get_mesa_program(struct gl_context *ctx,
mesa_instructions = NULL;
do_set_program_inouts(shader->ir, prog, shader->Type == GL_FRAGMENT_SHADER);
- count_resources(prog);
+ count_resources(shader_program, prog);
/* Set the gl_FragDepth layout. */
if (target == GL_FRAGMENT_PROGRAM_ARB) {