This patch series adds support for the transform feedback queries (PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) for i965 Gen6. For now, the queries are implemented using software counters, since we don't yet have the necessary kernel support to use the hardware counters. (The kernel support that would be required is the ability to save and restore GPU registers on a context switch, so that primitives rendered by other processes would not be accidentally counted). We'll need to change these to hardware counters before implementing geometry shaders or primitive restart.
In addition, patch 3/6 adds logic to re-program the SVBI registers at the start of each new batch. This is necessary to work around the same kernel issue: since the kernel does not save and restore GPU registers, we have to reprogram the SVBI registers at any time when a context switch might have occurred; this means at the start of each batch. At this point transform feedback support for i965 is complete, with the exception of fixing a few of the Piglit EXT_transform_feedback/tessellation tests. I think that it's reasonable to postpone that work until a later bugfix patch, for the following reasons: (a) The tessellation tests that are failing are subtle edge cases (e.g. tessellation of triangle strips flips the orientation of some triangles, and tessellation of quads and polygons fails to preserve the provoking vertex, causing flatshading errors). (b) Transform feedback operates in a completely different way on Gen7, and it's likely that some of these tessellation failures will be unfixable on Gen7. It seems silly to fix subtle edge cases on Gen6 that will be unfixable on Gen7, so I'd rather wait until we have implemented transform feedback on Gen7, and then do whatever is necessary to make Gen6 behave just as well as Gen7. (c) Enabling transform feedback now will allow us to get valuable feedback from the field and from Intel QA. Accordingly, patch 6/6 unconditionally switches on the EXT_transform_feedback extension for i965 gen6. Note: this patch series depends on several previous patches that are still under review on the mailing list: - [PATCH 0/8] i965 gen6: Initial implementation of transform feedback. - [PATCH] i965: Implement bounds checking for transform feedback output. - [PATCH 2/2] i965 gen6: Implement rasterizer discard. If you want to see this patch series in its proper context, you can pull from branch "xf-queries" on git://github.com/stereotype441/mesa.git. [PATCH 1/6] mesa: Add count_tessellated_primitives() function. [PATCH 2/6] mesa: Add a function to query whether a meta-op is in progress. [PATCH 3/6] i965 gen6: Ensure correct transform feedback indices on new batch. [PATCH 4/6] i965: Convert if/else to switch statements in brw_queryobj.c [PATCH 5/6] i965 gen6: Implement transform feedback queries. [PATCH 6/6] i965 gen6: Turn on transform feedback extension unconditionally. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev