glsl: don't generate transform feedback candidate when not required
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 2 Feb 2016 22:46:56 +0000 (09:46 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Sat, 6 Feb 2016 03:34:43 +0000 (14:34 +1100)
If we are not even looking for one don't bother generating a candidate
list.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/link_varyings.cpp

index 535c83cd0e725097529726d1688cd3d901790008..590de17450752f683b6b414c336481864092c9ec 100644 (file)
@@ -1643,8 +1643,10 @@ assign_varying_locations(struct gl_context *ctx,
                 (output_var->data.stream < MAX_VERTEX_STREAMS &&
                  producer->Stage == MESA_SHADER_GEOMETRY));
 
-         tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
-         g.process(output_var);
+         if (num_tfeedback_decls > 0) {
+            tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
+            g.process(output_var);
+         }
 
          ir_variable *const input_var =
             linker::get_matching_input(mem_ctx, output_var, consumer_inputs,