[Mesa-stable] [PATCH 06/13] i965/draw: Account for BaseInstance in VBO bounds
Jason Ekstrand
jason at jlekstrand.net
Thu May 19 07:21:03 UTC 2016
Cc: "10.2" <mesa-stable at lists.freedesktop.org>
---
src/mesa/drivers/dri/i965/brw_context.h | 1 +
src/mesa/drivers/dri/i965/brw_draw.c | 4 +++-
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 c6fb8d2..76ed1de 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 7901972..fa3ff5f 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 725a65e..6d9e65e 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);
--
2.5.0.400.gff86faf
More information about the mesa-stable
mailing list