On 13 December 2011 15:53, Brian Paul <span dir="ltr">&lt;<a href="mailto:brian.e.paul@gmail.com">brian.e.paul@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">
<div class="HOEnZb"><div class="h5">On Tue, Dec 13, 2011 at 4:35 PM, Paul Berry &lt;<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>&gt; wrote:<br>
&gt; This patch adds the field gl_transform_feedback_info::BufferStride,<br>
&gt; which records the total number of components (per vertex) that<br>
&gt; transform feedback is being instructed to store in each buffer.  The<br>
&gt; i965 gen6 back-end needs this information in order to set up binding<br>
&gt; tables, and it seems better to have the linker provide this<br>
&gt; information rather than force the back-end to recompute it.<br>
&gt; ---<br>
&gt;  src/glsl/linker.cpp    |    4 +++-<br>
&gt;  src/mesa/main/mtypes.h |    5 +++++<br>
&gt;  2 files changed, 8 insertions(+), 1 deletions(-)<br>
&gt;<br>
&gt; diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp<br>
&gt; index b8a7126..5eb2a20 100644<br>
&gt; --- a/src/glsl/linker.cpp<br>
&gt; +++ b/src/glsl/linker.cpp<br>
&gt; @@ -1599,6 +1599,7 @@ tfeedback_decl::store(struct gl_shader_program *prog,<br>
&gt;       info-&gt;Outputs[info-&gt;NumOutputs].NumComponents = this-&gt;vector_elements;<br>
&gt;       info-&gt;Outputs[info-&gt;NumOutputs].OutputBuffer = buffer;<br>
&gt;       ++info-&gt;NumOutputs;<br>
&gt; +      info-&gt;BufferStride[buffer] += this-&gt;vector_elements;<br>
&gt;    }<br>
&gt;    return true;<br>
&gt;  }<br>
&gt; @@ -1863,7 +1864,8 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,<br>
&gt;                      tfeedback_decl *tfeedback_decls)<br>
&gt;  {<br>
&gt;    unsigned total_tfeedback_components = 0;<br>
&gt; -   prog-&gt;LinkedTransformFeedback.NumOutputs = 0;<br>
&gt; +   memset(&amp;prog-&gt;LinkedTransformFeedback, 0,<br>
&gt; +          sizeof(prog-&gt;LinkedTransformFeedback));<br>
&gt;    for (unsigned i = 0; i &lt; num_tfeedback_decls; ++i) {<br>
&gt;       unsigned buffer =<br>
&gt;          prog-&gt;TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS ? i : 0;<br>
&gt; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h<br>
&gt; index 1934349..d4c600a 100644<br>
&gt; --- a/src/mesa/main/mtypes.h<br>
&gt; +++ b/src/mesa/main/mtypes.h<br>
&gt; @@ -1822,6 +1822,11 @@ struct gl_transform_feedback_info {<br>
&gt;       unsigned OutputBuffer;<br>
&gt;       unsigned NumComponents;<br>
&gt;    } Outputs[MAX_PROGRAM_OUTPUTS];<br>
&gt; +<br>
&gt; +   /**<br>
&gt; +    * Number of components stored in each buffer.<br>
&gt; +    */<br>
&gt; +   unsigned BufferStride[MAX_FEEDBACK_ATTRIBS];<br>
&gt;  };<br>
<br>
</div></div>Minor nit: I&#39;d use a single line comment there: /** Number of<br>
components... */ to be consistent with other comments.<br></blockquote><div><br>Good point.  Considering Ken&#39;s confusion, though, I think I&#39;ll expand the comment to make it clearer what&#39;s going on.<br> </div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The rest looks OK to me otherwise.  Reviewed-by: Brian Paul<br>
&lt;<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>&gt;  But if you have any doubts, another one of the<br>
GLSL people should probably review the rest too.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Brian<br>
</font></span></blockquote></div><br>