diff options
author | Chris Forbes <[email protected]> | 2014-09-07 18:19:15 +1200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-07-23 00:59:28 +0200 |
commit | 0e94f350eeecd84cd5f15b10837b285bc9120684 (patch) | |
tree | ab4e8964a0fa667eaa51e3dcb1b1ef2e80b8028d /src/glsl/link_varyings.cpp | |
parent | 567f1b2ee89bf05f0600e9e79847140555f0a035 (diff) |
glsl: push vertex count determination down one level
We have the prog here, so we don't need the caller to work this out for
us.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r-- | src/glsl/link_varyings.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index f7c219ece05..532204e44e9 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -1356,9 +1356,6 @@ canonicalize_shader_io(exec_list *ir, enum ir_variable_mode io_mode) * each of these objects that matches one of the outputs of the * producer. * - * \param gs_input_vertices: if \c consumer is a geometry shader, this is the - * number of input vertices it accepts. Otherwise zero. - * * When num_tfeedback_decls is nonzero, it is permissible for the consumer to * be NULL. In this case, varying locations are assigned solely based on the * requirements of transform feedback. @@ -1369,8 +1366,7 @@ assign_varying_locations(struct gl_context *ctx, struct gl_shader_program *prog, gl_shader *producer, gl_shader *consumer, unsigned num_tfeedback_decls, - tfeedback_decl *tfeedback_decls, - unsigned gs_input_vertices) + tfeedback_decl *tfeedback_decls) { varying_matches matches(ctx->Const.DisableVaryingPacking, consumer && consumer->Stage == MESA_SHADER_FRAGMENT); @@ -1384,6 +1380,10 @@ assign_varying_locations(struct gl_context *ctx, NULL, }; + unsigned consumer_vertices = 0; + if (consumer && consumer->Stage == MESA_SHADER_GEOMETRY) + consumer_vertices = prog->Geom.VerticesIn; + /* Operate in a total of four passes. * * 1. Sort inputs / outputs into a canonical order. This is necessary so @@ -1523,7 +1523,7 @@ assign_varying_locations(struct gl_context *ctx, } if (consumer) { lower_packed_varyings(mem_ctx, slots_used, ir_var_shader_in, - gs_input_vertices, consumer); + consumer_vertices, consumer); } } |