summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2007-12-10 21:07:53 +1100
committerBen Skeggs <[email protected]>2007-12-10 21:08:42 +1100
commitf7195b32323d50e9541a5c5cb3143e83d05bd8d8 (patch)
treed29d64af2e703b8f8e7dc2c87a367fa663aa4a48 /src
parent913703d4b822a794853e566d4ab2bfef01ca5099 (diff)
Correct user VBO size.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_draw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index c6fea1f7bc8..24bb4823bc9 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -266,9 +266,14 @@ st_draw_vbo(GLcontext *ctx,
}
else {
/* attribute data is in user-space memory, not a VBO */
- uint bytes = (arrays[mesaAttr]->Size
- * _mesa_sizeof_type(arrays[mesaAttr]->Type)
- * (max_index + 1));
+ uint bytes;
+
+ if (!arrays[mesaAttr]->StrideB) {
+ bytes = arrays[mesaAttr]->Size
+ * _mesa_sizeof_type(arrays[mesaAttr]->Type);
+ } else {
+ bytes = arrays[mesaAttr]->StrideB * (max_index + 1);
+ }
/* wrap user data */
vbuffer[attr].buffer