On 3 January 2012 12:57, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</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">
<div class="HOEnZb"><div class="h5">On 01/02/2012 09:37 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From the EXT_transform_feedback spec:<br>
<br>
The error INVALID_OPERATION is generated by<br>
BeginTransformFeedbackEXT if any transform feedback buffer object<br>
binding point used in transform feedback mode does not have a<br>
buffer object bound.<br>
<br>
This required adding a new NumBuffers field to the<br>
gl_transform_feedback_info struct, to keep track of how many transform<br>
feedback buffers are required by the current program.<br>
<br>
Fixes Piglit tests:<br>
- EXT_transform_feedback/api-<u></u>errors interleaved_unbound<br>
- EXT_transform_feedback/api-<u></u>errors separate_unbound_0_1<br>
- EXT_transform_feedback/api-<u></u>errors separate_unbound_0_2<br>
- EXT_transform_feedback/api-<u></u>errors separate_unbound_1_2<br>
---<br>
src/glsl/linker.cpp | 7 +++++--<br>
src/mesa/main/mtypes.h | 5 +++++<br>
src/mesa/main/<u></u>transformfeedback.c | 12 ++++++++++++<br>
3 files changed, 22 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp<br>
index ed9a5d7..43be205 100644<br>
--- a/src/glsl/linker.cpp<br>
+++ b/src/glsl/linker.cpp<br>
@@ -1889,11 +1889,14 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,<br>
tfeedback_decl *tfeedback_decls)<br>
{<br>
unsigned total_tfeedback_components = 0;<br>
+ bool separate_attribs_mode =<br>
+ prog->TransformFeedback.<u></u>BufferMode == GL_SEPARATE_ATTRIBS;<br>
memset(&prog-><u></u>LinkedTransformFeedback, 0,<br>
sizeof(prog-><u></u>LinkedTransformFeedback));<br>
+ prog->LinkedTransformFeedback.<u></u>NumBuffers =<br>
+ separate_attribs_mode ? num_tfeedback_decls : 1;<br>
for (unsigned i = 0; i< num_tfeedback_decls; ++i) {<br>
- unsigned buffer =<br>
- prog->TransformFeedback.<u></u>BufferMode == GL_SEPARATE_ATTRIBS ? i : 0;<br>
+ unsigned buffer = separate_attribs_mode ? i : 0;<br>
</blockquote>
<br></div></div>
Is this actually necessary? If separate_attribs_mode is false, num_tfeedback_decls is 1, and i can only ever be 0. Right?<br></blockquote><div><br>No, num_tfeedback_decls is the value of "count" that was passed to TransformFeedbackVaryings--it indicates the number of varyings that should be captured. So if separate_attribs_mode is false, and more than one varying is being interleaved, then num_tfeedback_decls will be greater than 1.<br>
</div></div>