[Mesa-dev] [PATCH] i965: Flush pipeline on EndTransformFeedback.
Kenneth Graunke
kenneth at whitecape.org
Wed Dec 14 14:57:43 PST 2011
On 12/14/2011 02:54 PM, Paul Berry wrote:
> A common use case for transform feedback is to perform one draw
> operation that writes transform feedback output to a buffer, followed
> by a second draw operation that consumes that buffer as vertex input.
> Since vertex input is consumed at an earlier pipeline stage than
> writing transform feedback output, we need to flush the pipeline to
> ensure that the transform feedback output is completely written before
> the data is consumed.
>
> In an ideal world, we would do some dependency tracking, so that we
> would only flush the pipeline if the next draw call was about to
> consume data generated by a previous draw call in the same batch.
> However, since we don't have that sort of dependency tracking
> infrastructure right now, we just unconditionally flush the buffer
> every time glEndTransformFeedback() is called. This will cause a
> performance hit compared to the ideal case (since we will sometimes
> flush the pipeline unnecessarily), but fortunately the performance hit
> will be confined to circumstances where transform feedback is in use.
> ---
>
> Ken pointed out to me on IRC that in my last attempt at this patch, I
> neglected to back out bogus the extra argument I added to
> brwInitDriverFunctions(). This fixes that. I now believe the only
> differences between my proposal and Ken's are:
>
> - I'm not doing "if (intel->gen < 6) return;" because I believe that
> we will need to do this flush on every platform that supports
> transform feedback, not just Gen6.
>
> - I'm calling the function that does the flush
> "brw_end_transform_feedback" instead of
> "gen6_end_transform_feedback", because it's no longer a
> gen6-specific function.
>
> Hopefully I haven't made any other gaffes this time.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
More information about the mesa-dev
mailing list