aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-13 17:04:47 +0100
committermarha <marha@users.sourceforge.net>2012-01-13 17:04:47 +0100
commite2e1bdced7e09e39fed613dae1f2f3096cb18118 (patch)
tree63c7066c79d1053c7656b6175e22e2ced6f11e01 /mesalib/src/mesa/program
parentcc96d00cae473f472e371328ce8dc572ad258073 (diff)
parent5cfbe97cd797d8f78ece208bb5114704b83d8aab (diff)
downloadvcxsrv-e2e1bdced7e09e39fed613dae1f2f3096cb18118.tar.gz
vcxsrv-e2e1bdced7e09e39fed613dae1f2f3096cb18118.tar.bz2
vcxsrv-e2e1bdced7e09e39fed613dae1f2f3096cb18118.zip
Merge remote-tracking branch 'origin/released'
Conflicts: libxcb/src/xcb_auth.c libxcb/src/xcb_conn.c libxcb/src/xcb_out.c libxcb/src/xcb_util.c xorg-server/dix/dispatch.c xorg-server/include/dixstruct.h xorg-server/include/misc.h xorg-server/os/connection.c
Diffstat (limited to 'mesalib/src/mesa/program')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp33
-rw-r--r--mesalib/src/mesa/program/prog_print.c4
2 files changed, 6 insertions, 31 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) {
diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c
index 352a80f27..46f1df0fc 100644
--- a/mesalib/src/mesa/program/prog_print.c
+++ b/mesalib/src/mesa/program/prog_print.c
@@ -194,7 +194,7 @@ _mesa_print_vp_inputs(GLbitfield inputs)
{
printf("VP Inputs 0x%x: \n", inputs);
while (inputs) {
- GLint attr = _mesa_ffs(inputs) - 1;
+ GLint attr = ffs(inputs) - 1;
const char *name = arb_input_attrib_string(attr,
GL_VERTEX_PROGRAM_ARB);
printf(" %d: %s\n", attr, name);
@@ -212,7 +212,7 @@ _mesa_print_fp_inputs(GLbitfield inputs)
{
printf("FP Inputs 0x%x: \n", inputs);
while (inputs) {
- GLint attr = _mesa_ffs(inputs) - 1;
+ GLint attr = ffs(inputs) - 1;
const char *name = arb_input_attrib_string(attr,
GL_FRAGMENT_PROGRAM_ARB);
printf(" %d: %s\n", attr, name);