diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2014-04-08 13:01:20 +0200 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-04-08 15:10:10 -0700 |
commit | 1a92637c68b84fa30e90f442e8a3d32c450cafcc (patch) | |
tree | 20e67c25b51ef2607c1265d853ecf7e7869c278a /src/mesa/drivers/dri/i965/brw_draw.c | |
parent | 2ffb50d77b7ae3cdedf0319a0def16732ed39578 (diff) | |
download | external_mesa3d-1a92637c68b84fa30e90f442e8a3d32c450cafcc.zip external_mesa3d-1a92637c68b84fa30e90f442e8a3d32c450cafcc.tar.gz external_mesa3d-1a92637c68b84fa30e90f442e8a3d32c450cafcc.tar.bz2 |
tnl: Merge _tnl_vbo_draw_prims() into _tnl_draw_prims().
This should help prevent situations where we render without proper index
bounds. For example: https://bugs.freedesktop.org/show_bug.cgi?id=59455
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_draw.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index ef0f273..0c131be 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -550,17 +550,6 @@ void brw_draw_prims( struct gl_context *ctx, return; } - /* If we're going to have to upload any of the user's vertex arrays, then - * get the minimum and maximum of their index buffer so we know what range - * to upload. - */ - if (!index_bounds_valid && - (ctx->RenderMode != GL_RENDER || !vbo_all_varyings_in_vbos(arrays))) { - perf_debug("Scanning index buffer to compute index buffer bounds. " - "Use glDrawRangeElements() to avoid this.\n"); - vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims); - } - /* Do GL_SELECT and GL_FEEDBACK rendering using swrast, even though it * won't support all the extensions we support. */ @@ -569,10 +558,21 @@ void brw_draw_prims( struct gl_context *ctx, _mesa_lookup_enum_by_nr(ctx->RenderMode)); _swsetup_Wakeup(ctx); _tnl_wakeup(ctx); - _tnl_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index); + _tnl_draw_prims(ctx, prims, nr_prims, ib, + index_bounds_valid, min_index, max_index, NULL, NULL); return; } + /* If we're going to have to upload any of the user's vertex arrays, then + * get the minimum and maximum of their index buffer so we know what range + * to upload. + */ + if (!index_bounds_valid && !vbo_all_varyings_in_vbos(arrays)) { + perf_debug("Scanning index buffer to compute index buffer bounds. " + "Use glDrawRangeElements() to avoid this.\n"); + vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims); + } + /* Try drawing with the hardware, but don't do anything else if we can't * manage it. swrast doesn't support our featureset, so we can't fall back * to it. |