summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-12-09 18:33:58 +0100
committerChristoph Bumiller <[email protected]>2011-12-15 18:51:48 +0100
commitc05fafa4a0fd93d4264c46578e23a83ecf2b481e (patch)
treed53751c909b147934d727bc9a276d331a38ed61c /src/mesa/state_tracker/st_draw.c
parent36d66f8d4ad1e2b18bb28d0b08e98f968ad6137e (diff)
st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 86478bbceba..87a99786521 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -51,6 +51,7 @@
#include "st_context.h"
#include "st_atom.h"
#include "st_cb_bufferobjects.h"
+#include "st_cb_xformfb.h"
#include "st_draw.h"
#include "st_program.h"
@@ -940,7 +941,6 @@ st_draw_vbo(struct gl_context *ctx,
/* Mesa core state should have been validated already */
assert(ctx->NewState == 0x0);
- assert(!tfb_vertcount);
if (ib) {
/* Gallium probably doesn't want this in some cases. */
@@ -1034,6 +1034,11 @@ st_draw_vbo(struct gl_context *ctx,
info.restart_index = ctx->Array.RestartIndex;
}
+ /* Set info.count_from_stream_output. */
+ if (tfb_vertcount) {
+ st_transform_feedback_draw_init(tfb_vertcount, &info);
+ }
+
/* do actual drawing */
for (i = 0; i < nr_prims; i++) {
info.mode = translate_prim( ctx, prims[i].mode );
@@ -1046,7 +1051,10 @@ st_draw_vbo(struct gl_context *ctx,
info.max_index = info.start + info.count - 1;
}
- if (info.primitive_restart) {
+ if (info.count_from_stream_output) {
+ pipe->draw_vbo(pipe, &info);
+ }
+ else if (info.primitive_restart) {
if (st->sw_primitive_restart) {
/* Handle primitive restart for drivers that doesn't support it */
handle_fallback_primitive_restart(pipe, ib, &ibuffer, &info);