diff options
author | Kenneth Graunke <[email protected]> | 2013-09-06 16:59:31 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-10-31 11:04:37 -0700 |
commit | 82a5ee6be4b4f5881d86f18d4b002d23c9e18ea5 (patch) | |
tree | 2e5949be645977b3c37514eb9d48914f36fa9b6f /include/c99_compat.h | |
parent | b2ff11618fa6036744d8ab12730865b3adf81765 (diff) |
i965: Implement glDrawTransformFeedback().
Implementing the GetTransformFeedbackVertexCount() driver hook allows
the VBO module to call us with the right number of vertices.
The hardware doesn't directly count the number of vertices written by
SOL, so we instead use the SO_NUM_PRIMS_WRITTEN(n) counters and multiply
by the number of vertices per primitive.
Unfortunately, counting the number of primitives generated is tricky:
a program might pause a transform feedback operation, start a second one
with a different object, then switch back and resume. Both transform
feedback operations share the SO_NUM_PRIMS_WRITTEN counters.
To work around this, we save the counter values at Begin, Pause, Resume,
and End. This "bookends" each section where transform feedback is
active for the current object. Adding up differences of pairs gives
us the number of primitives generated. (This is similar to what we
do for occlusion queries on platforms without hardware contexts.)
v2: Fix missing parenthesis in assertion (caught by Eric Anholt).
v3: Reuse prim_count_bo rather than freeing it and immediately
allocating a new one (suggested by Topi Pohjolainen).
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'include/c99_compat.h')
0 files changed, 0 insertions, 0 deletions