diff options
author | marha <marha@users.sourceforge.net> | 2012-01-13 16:54:57 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-01-13 16:54:57 +0100 |
commit | 5cfbe97cd797d8f78ece208bb5114704b83d8aab (patch) | |
tree | 5c88c73ee39367742bb5547ef6fb5a3d25d656e0 /mesalib/src/mesa/program/ir_to_mesa.cpp | |
parent | 39324211d7a79ef8115fd1e39771a2e400b31993 (diff) | |
download | vcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.tar.gz vcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.tar.bz2 vcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.zip |
libxtrans libXdmcp libxcb mesa xserver git update 13 jan 2012
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r-- | mesalib/src/mesa/program/ir_to_mesa.cpp | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index 5a68fc51d..6a90d5ad7 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -2490,34 +2490,6 @@ print_program(struct prog_instruction *mesa_instructions, } } - -/** - * Count resources used by the given gpu program (number of texture - * samplers, etc). - */ -static void -count_resources(struct gl_program *prog) -{ - unsigned int i; - - prog->SamplersUsed = 0; - - for (i = 0; i < prog->NumInstructions; i++) { - 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; - } - } - } - - _mesa_update_shader_textures_used(prog); -} - class add_uniform_to_shader : public uniform_field_visitor { public: add_uniform_to_shader(struct gl_shader_program *shader_program, @@ -3197,7 +3169,10 @@ 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); + + prog->SamplersUsed = shader->active_samplers; + prog->ShadowSamplers = shader->shadow_samplers; + _mesa_update_shader_textures_used(shader_program, prog); /* Set the gl_FragDepth layout. */ if (target == GL_FRAGMENT_PROGRAM_ARB) { |