summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-26 11:19:35 +0200
committerMarek Olšák <[email protected]>2012-04-30 01:18:47 +0200
commit01bf5569c44389c1127bbb9e873c8a234ac92ff7 (patch)
treeb34aa167526e6ee2aad7a887d0e18f702438e74b
parent944b97990bbdf61b2be2e92c3641d3240e12fe58 (diff)
st/mesa: reorder code in draw_vbo
-rw-r--r--src/mesa/state_tracker/st_draw.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 6128320d7c2..cbf4e59fb6d 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -912,14 +912,6 @@ st_draw_vbo(struct gl_context *ctx,
/* Mesa core state should have been validated already */
assert(ctx->NewState == 0x0);
- if (ib) {
- /* Gallium probably doesn't want this in some cases. */
- if (!index_bounds_valid)
- if (!all_varyings_in_vbos(arrays))
- vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index,
- nr_prims);
- }
-
/* Validate state. */
if (st->dirty.st) {
GLboolean vertDataEdgeFlags;
@@ -951,6 +943,12 @@ st_draw_vbo(struct gl_context *ctx,
util_draw_init_info(&info);
if (ib) {
+ /* Get index bounds for user buffers. */
+ if (!index_bounds_valid)
+ if (!all_varyings_in_vbos(arrays))
+ vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index,
+ nr_prims);
+
setup_index_buffer(st, ib, &ibuffer);
info.indexed = TRUE;
@@ -965,10 +963,12 @@ st_draw_vbo(struct gl_context *ctx,
info.primitive_restart = ctx->Array.PrimitiveRestart;
info.restart_index = ctx->Array.RestartIndex;
}
-
- /* Set info.count_from_stream_output. */
- if (tfb_vertcount) {
- st_transform_feedback_draw_init(tfb_vertcount, &info);
+ else {
+ /* Transform feedback drawing is always non-indexed. */
+ /* Set info.count_from_stream_output. */
+ if (tfb_vertcount) {
+ st_transform_feedback_draw_init(tfb_vertcount, &info);
+ }
}
/* do actual drawing */