On 4 November 2011 16:43, Marek Olšák <span dir="ltr">&lt;<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Paul,<br>
<br>
I won&#39;t comment on the patch 1, because I didn&#39;t write it, I was just<br>
preserving history.<br>
<br>
On Fri, Nov 4, 2011 at 10:00 PM, Paul Berry &lt;<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>&gt; wrote:<br>
[snip]<br>
<div><div class="h5">&gt;&gt; +bool parse_tfeedback_decl(const void *mem_ctx, const char *input,<br>
&gt;&gt; +                          struct tfeedback_decl *decl)<br>
&gt;&gt; +{<br>
&gt;&gt; +   /* We don&#39;t have to be pedantic about what is a valid GLSL variable<br>
&gt;&gt; name,<br>
&gt;&gt; +    * because any variable with an invalid name can&#39;t exist in the IR<br>
&gt;&gt; anyway.<br>
&gt;&gt; +    */<br>
&gt;&gt; +<br>
&gt;&gt; +   const char *bracket = strrchr(input, &#39;[&#39;);<br>
&gt;&gt; +<br>
&gt;&gt; +   if (bracket) {<br>
&gt;&gt; +      decl-&gt;name = ralloc_strndup(mem_ctx, input, bracket - input);<br>
&gt;&gt; +      if (sscanf(bracket, &quot;[%u]&quot;, &amp;decl-&gt;array_index) == 1) {<br>
&gt;&gt; +         decl-&gt;is_array = true;<br>
&gt;&gt; +         return true; /* Found: &quot;var[i]&quot; */<br>
&gt;&gt; +      }<br>
&gt;&gt; +   } else {<br>
&gt;&gt; +      decl-&gt;name = ralloc_strdup(mem_ctx, input);<br>
&gt;&gt; +      return true;<br>
&gt;&gt; +   }<br>
&gt;&gt; +<br>
&gt;&gt; +   return false;<br>
&gt;&gt; +}<br>
&gt;<br>
&gt; For non-arrays, this function doesn&#39;t assign to decl-&gt;is_array or<br>
&gt; decl-&gt;array_index.  That&#39;s a problem, because its caller<br>
&gt; (ir_set_transform_feedback_outs::ir_set_transform_feedback_outs()) passes<br>
&gt; uninitialized memory for decl.  We could fix the problem by having<br>
&gt; ir_set_transform_feedback_outs::ir_set_transform_feedback_outs() initialize<br>
&gt; the memory first, but I would prefer if we fixed the problem by always<br>
&gt; assigning to all fields of decl, since we&#39;re effectively treating it as an<br>
&gt; output of this function.<br>
<br>
</div></div>Yeah, that was unintentional.<br>
<br>
Regarding the other comments, I don&#39;t know the GLSL compiler so well.<br>
I had forked ir_set_program_inouts and was basing upon that. Now that<br>
I think about it, it makes more sense to do it like you say. :)<br>
<br>
Concerning this:<br>
<br>
varying mat4 r;<br>
glTransformFeedbackVaryingsEXT(.. &quot;r[1]&quot; ..);<br>
<br>
The EXT spec doesn&#39;t state whether this is legal. It says nothing<br>
about matrices, actually.<br>
<br>
[snip]<br>
<div class="im">&gt;<br>
&gt; The patch series doesn&#39;t add any code that calls this function.  Is that<br>
&gt; planned for a future patch?<br>
&gt;<br>
<br>
</div>The function is already used here:<br>
<a href="http://cgit.freedesktop.org/%7Emareko/mesa/log/?h=transform-feedback" target="_blank">http://cgit.freedesktop.org/~mareko/mesa/log/?h=transform-feedback</a><br>
<br>
It&#39;s a work in progress, but EXT_transform_feedback already works<br>
quite well and ARB_transform_feedback2 too except<br>
glDrawTransformFeedback, which isn&#39;t fully implemented yet. Despite<br>
your remarks, the GLSL linker works pretty good for me, so I am going<br>
to take a break from it for a while.<br>
<br>
Feel free to take over all 3 patches and implement it properly, as I<br>
might not have time to get to it again soon.<br></blockquote><div><br>Ok, I&#39;ve worked up an alternative proposal, which I&#39;ll send out shortly.<br></div></div>