diff options
author | Jason Ekstrand <[email protected]> | 2016-05-18 13:05:02 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-23 19:12:34 -0700 |
commit | ad42ab473cb327e9f0498bda9d92cccc4279a0e8 (patch) | |
tree | a8054f12a9b428d9e8c9008f668ed6b51838e6e7 /src/mesa | |
parent | ad3deec8ca9813a746ac833e6a0cc2ed13286c35 (diff) |
i965/draw: Account for BaseInstance in VBO bounds
Cc: "11.1 11.2" <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw_upload.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index c6fb8d277e1..76ed1de12a8 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -1311,6 +1311,7 @@ struct brw_context uint32_t num_instances; int basevertex; + int baseinstance; struct { const struct brw_l3_config *config; diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 7901972111f..fa3ff5fdfc2 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -502,9 +502,11 @@ brw_try_draw_prims(struct gl_context *ctx, intel_batchbuffer_save_state(brw); if (brw->num_instances != prims[i].num_instances || - brw->basevertex != prims[i].basevertex) { + brw->basevertex != prims[i].basevertex || + brw->baseinstance != prims[i].base_instance) { brw->num_instances = prims[i].num_instances; brw->basevertex = prims[i].basevertex; + brw->baseinstance = prims[i].base_instance; if (i > 0) { /* For i == 0 we just did this before the loop */ brw->ctx.NewDriverState |= BRW_NEW_VERTICES; brw_merge_inputs(brw, arrays); diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 725a65e10ab..6d9e65e9cfa 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -473,7 +473,7 @@ brw_prepare_vertices(struct brw_context *brw) uint32_t range = intel_buffer->Base.Size; if (glarray->InstanceDivisor) { if (brw->num_instances) { - start = offset; + start = offset + glarray->StrideB * brw->baseinstance; range = (glarray->StrideB * ((brw->num_instances / glarray->InstanceDivisor) - 1) + glarray->_ElementSize); |