summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-03-21 15:01:34 -0700
committerKenneth Graunke <[email protected]>2013-09-01 18:54:39 -0700
commitb8211ab3edb1bb9f414e8b4913609f48326e202e (patch)
treefe1824ee92f97d78d47113a4dd47527bd2f02ef0 /src/mesa
parent976d1d6665686cf6be6f3388a28c21516d94de76 (diff)
i965: Use the proper element of the prim array in brw_try_draw_prims.
The VBO module actually calls us with an array of _mesa_prim objects. For example, it may break up a DrawArrays() call into multiple primitives when primitive restart is enabled. Previously, we treated prim like a pointer, always accessing element 0. This worked because all of the primitive objects in a single draw call have the same value for num_instances and basevertex. However, accessing an array as a pointer and using the wrong object's fields is misleading. For stylistic reasons alone, we should use the right object. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 0b115666eda..dec17db87d1 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -390,12 +390,12 @@ static bool brw_try_draw_prims( struct gl_context *ctx,
intel_batchbuffer_require_space(brw, estimated_max_prim_size, false);
intel_batchbuffer_save_state(brw);
- if (brw->num_instances != prim->num_instances) {
- brw->num_instances = prim->num_instances;
+ if (brw->num_instances != prim[i].num_instances) {
+ brw->num_instances = prim[i].num_instances;
brw->state.dirty.brw |= BRW_NEW_VERTICES;
}
- if (brw->basevertex != prim->basevertex) {
- brw->basevertex = prim->basevertex;
+ if (brw->basevertex != prim[i].basevertex) {
+ brw->basevertex = prim[i].basevertex;
brw->state.dirty.brw |= BRW_NEW_VERTICES;
}
if (brw->gen < 6)