aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_xformfb.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-07-30 20:44:50 +1000
committerDave Airlie <[email protected]>2015-07-31 07:27:29 +1000
commit518abd0bbe1886550b43c62679a2ebd41e8199e9 (patch)
treec4da9aaa441b30754c1971fe38c7b31a49561b43 /src/mesa/state_tracker/st_cb_xformfb.c
parentfdb84876134ed074563b842eae20fd10dbe9e8d6 (diff)
st/mesa: don't draw instead of asserting in transform feedback
if we get a request to take the count from feedback, but there is no buffer to take it from, just draw as if we got 0 vertices so nothing. This fixes this assert killing the ogl conform, and a piglit test I've sent. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_xformfb.c')
-rw-r--r--src/mesa/state_tracker/st_cb_xformfb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c
index 07c118e227b..0708e68ec7b 100644
--- a/src/mesa/state_tracker/st_cb_xformfb.c
+++ b/src/mesa/state_tracker/st_cb_xformfb.c
@@ -191,7 +191,6 @@ st_transform_feedback_get_draw_target(struct gl_transform_feedback_object *obj)
}
}
- assert(0);
return NULL;
}
@@ -211,14 +210,17 @@ st_end_transform_feedback(struct gl_context *ctx,
}
-void
+bool
st_transform_feedback_draw_init(struct gl_transform_feedback_object *obj,
struct pipe_draw_info *out)
{
struct st_transform_feedback_object *sobj =
st_transform_feedback_object(obj);
+ if (sobj->draw_count == NULL)
+ return false;
out->count_from_stream_output = sobj->draw_count;
+ return true;
}