aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2014-03-28 08:14:02 +0100
committerKenneth Graunke <[email protected]>2014-03-28 08:48:14 -0700
commit029ccd773d01a5f801c809c499516d7b0c4cc3f8 (patch)
tree5a9e13a3c5a02e2e532c23d8399c95a0d83b9f37 /src
parente7f75745984937d004bf3ce08a2a8fd2149801d1 (diff)
i965: Make sure we always compute valid index bounds before drawing.
When doing software rendering (i.e. rendering to the selection buffer) we need to make sure that we have valid index bounds before calling _tnl_draw_prims(), otherwise we can crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59455 Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index d684c172212..ef0f2737ca1 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -554,7 +554,8 @@ void brw_draw_prims( struct gl_context *ctx,
* get the minimum and maximum of their index buffer so we know what range
* to upload.
*/
- if (!vbo_all_varyings_in_vbos(arrays) && !index_bounds_valid) {
+ 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);