On 4 November 2011 16:43, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>></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't comment on the patch 1, because I didn't write it, I was just<br>
preserving history.<br>
<br>
On Fri, Nov 4, 2011 at 10:00 PM, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
[snip]<br>
<div><div class="h5">>> +bool parse_tfeedback_decl(const void *mem_ctx, const char *input,<br>
>> + struct tfeedback_decl *decl)<br>
>> +{<br>
>> + /* We don't have to be pedantic about what is a valid GLSL variable<br>
>> name,<br>
>> + * because any variable with an invalid name can't exist in the IR<br>
>> anyway.<br>
>> + */<br>
>> +<br>
>> + const char *bracket = strrchr(input, '[');<br>
>> +<br>
>> + if (bracket) {<br>
>> + decl->name = ralloc_strndup(mem_ctx, input, bracket - input);<br>
>> + if (sscanf(bracket, "[%u]", &decl->array_index) == 1) {<br>
>> + decl->is_array = true;<br>
>> + return true; /* Found: "var[i]" */<br>
>> + }<br>
>> + } else {<br>
>> + decl->name = ralloc_strdup(mem_ctx, input);<br>
>> + return true;<br>
>> + }<br>
>> +<br>
>> + return false;<br>
>> +}<br>
><br>
> For non-arrays, this function doesn't assign to decl->is_array or<br>
> decl->array_index. That's a problem, because its caller<br>
> (ir_set_transform_feedback_outs::ir_set_transform_feedback_outs()) passes<br>
> uninitialized memory for decl. We could fix the problem by having<br>
> ir_set_transform_feedback_outs::ir_set_transform_feedback_outs() initialize<br>
> the memory first, but I would prefer if we fixed the problem by always<br>
> assigning to all fields of decl, since we're effectively treating it as an<br>
> output of this function.<br>
<br>
</div></div>Yeah, that was unintentional.<br>
<br>
Regarding the other comments, I don'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(.. "r[1]" ..);<br>
<br>
The EXT spec doesn't state whether this is legal. It says nothing<br>
about matrices, actually.<br>
<br>
[snip]<br>
<div class="im">><br>
> The patch series doesn't add any code that calls this function. Is that<br>
> planned for a future patch?<br>
><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's a work in progress, but EXT_transform_feedback already works<br>
quite well and ARB_transform_feedback2 too except<br>
glDrawTransformFeedback, which isn'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've worked up an alternative proposal, which I'll send out shortly.<br></div></div>