<div dir="ltr">On 17 February 2013 14:32, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 02/12/2013 06:59 PM, Jordan Justen wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Previously when an input varying was optimized out of the<br>
FS we would still retain it as an output of the VS.<br>
<br>
We now build a hash of live FS input varyings rather<br>
than looking in the FS symbol table. (The FS symbol table<br>
will still contain the optimized out varyings.)<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>><br>
Cc: Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>><br>
</blockquote>
<br></div>
Is this a candidate for 9.1?</blockquote><div><br></div><div style>Since the spec doesn't require us to optimize away these varyings, I personally see this patch as more of a performance optimization than a bug fix. So I would be inclined to leave it out of 9.1. I don't feel terribly strongly about it, though.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/glsl/link_varyings.cpp | 19 ++++++++++++++++++-<br>
1 file changed, 18 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp<br>
index b1317c8..616933d 100644<br>
--- a/src/glsl/link_varyings.cpp<br>
+++ b/src/glsl/link_varyings.cpp<br>
@@ -964,6 +964,8 @@ assign_varying_locations(<u></u>struct gl_context *ctx,<br>
varying_matches matches(ctx->Const.<u></u>DisableVaryingPacking);<br>
hash_table *tfeedback_candidates<br>
= hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare);<br>
+ hash_table *consumer_inputs<br>
+ = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare);<br>
<br>
/* Operate in a total of three passes.<br>
*<br>
@@ -976,6 +978,18 @@ assign_varying_locations(<u></u>struct gl_context *ctx,<br>
* not being inputs. This lets the optimizer eliminate them.<br>
*/<br>
<br>
+ if (consumer) {<br>
+ foreach_list(node, consumer->ir) {<br>
+ ir_variable *const input_var =<br>
+ ((ir_instruction *) node)->as_variable();<br>
+<br>
+ if ((input_var != NULL) && (input_var->mode == ir_var_shader_in)) {<br>
+ hash_table_insert(consumer_<u></u>inputs, input_var,<br>
+ ralloc_strdup(mem_ctx, input_var->name));<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
foreach_list(node, producer->ir) {<br>
ir_variable *const output_var = ((ir_instruction *) node)->as_variable();<br>
<br>
@@ -986,7 +1000,7 @@ assign_varying_locations(<u></u>struct gl_context *ctx,<br>
g.process(output_var);<br>
<br>
ir_variable *input_var =<br>
- consumer ? consumer->symbols->get_<u></u>variable(output_var->name) : NULL;<br>
+ (ir_variable *) hash_table_find(consumer_<u></u>inputs, output_var->name);<br>
<br>
if (input_var && input_var->mode != ir_var_shader_in)<br>
input_var = NULL;<br>
@@ -1005,6 +1019,7 @@ assign_varying_locations(<u></u>struct gl_context *ctx,<br>
<br>
if (matched_candidate == NULL) {<br>
hash_table_dtor(tfeedback_<u></u>candidates);<br>
+ hash_table_dtor(consumer_<u></u>inputs);<br>
return false;<br>
}<br>
<br>
@@ -1021,11 +1036,13 @@ assign_varying_locations(<u></u>struct gl_context *ctx,<br>
<br>
if (!tfeedback_decls[i].assign_<u></u>location(ctx, prog)) {<br>
hash_table_dtor(tfeedback_<u></u>candidates);<br>
+ hash_table_dtor(consumer_<u></u>inputs);<br>
return false;<br>
}<br>
}<br>
<br>
hash_table_dtor(tfeedback_<u></u>candidates);<br>
+ hash_table_dtor(consumer_<u></u>inputs);<br>
<br>
if (ctx->Const.<u></u>DisableVaryingPacking) {<br>
/* Transform feedback code assumes varyings are packed, so if the driver<br>
<br>
</blockquote>
<br></div></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>