aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-16 16:33:47 +0000
committermarha <marha@users.sourceforge.net>2011-01-16 16:33:47 +0000
commit5d0def58c0a3124e70076584cadc7c761e1f9e57 (patch)
treee87238976fbf7b0845aaa60876e417ca42146e1a /mesalib/src/mesa/state_tracker/st_draw.c
parent8b668e29799ccd203f12719c6ef92c08027f6592 (diff)
parent367c91bebcdc1f5ba4278b68eb8715218d9640ad (diff)
downloadvcxsrv-5d0def58c0a3124e70076584cadc7c761e1f9e57.tar.gz
vcxsrv-5d0def58c0a3124e70076584cadc7c761e1f9e57.tar.bz2
vcxsrv-5d0def58c0a3124e70076584cadc7c761e1f9e57.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_draw.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index ece051fc8..19466ea44 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -387,9 +387,16 @@ setup_interleaved_attribs(struct gl_context *ctx,
vbuffer->max_index = max_index;
}
+ /*
+ if (arrays[mesaAttr]->InstanceDivisor)
+ vbuffer[attr].max_index = arrays[mesaAttr]->_MaxElement;
+ else
+ vbuffer[attr].max_index = max_index;
+ */
+
velements[attr].src_offset =
(unsigned) (arrays[mesaAttr]->Ptr - offset0);
- velements[attr].instance_divisor = 0;
+ velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor;
velements[attr].vertex_buffer_index = 0;
velements[attr].src_format =
st_pipe_vertex_format(arrays[mesaAttr]->Type,
@@ -440,7 +447,6 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
vbuffer[attr].buffer = NULL;
pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr);
- velements[attr].src_offset = 0;
}
else {
/* attribute data is in user-space memory, not a VBO */
@@ -476,15 +482,19 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
}
vbuffer[attr].buffer_offset = 0;
- velements[attr].src_offset = 0;
}
assert(velements[attr].src_offset <= 2048); /* 11-bit field */
/* common-case setup */
vbuffer[attr].stride = stride; /* in bytes */
- vbuffer[attr].max_index = max_index;
- velements[attr].instance_divisor = 0;
+ if (arrays[mesaAttr]->InstanceDivisor)
+ vbuffer[attr].max_index = arrays[mesaAttr]->_MaxElement;
+ else
+ vbuffer[attr].max_index = max_index;
+
+ velements[attr].src_offset = 0;
+ velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor;
velements[attr].vertex_buffer_index = attr;
velements[attr].src_format
= st_pipe_vertex_format(arrays[mesaAttr]->Type,