diff options
author | Brian Paul <[email protected]> | 2009-09-24 10:52:15 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-24 10:52:15 -0600 |
commit | 7549a8397b310acf672f97a08c8e7d866cdf492c (patch) | |
tree | 98166a8670ad275f1149dc24bf027cd46e03d32f /src/mesa/state_tracker/st_draw.c | |
parent | a64d4516a0d6219dec0b5b0622215918469faecc (diff) | |
parent | 2acd5de22651a3461c0576107c8e8fab1f01469a (diff) |
Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 503a5f34a3f..c76bff91819 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -328,23 +328,29 @@ get_arrays_bounds(const struct st_vertex_program *vp, const GLubyte **low, const GLubyte **high) { const GLubyte *low_addr = NULL; + const GLubyte *high_addr = NULL; GLuint attr; - GLint stride; for (attr = 0; attr < vp->num_inputs; attr++) { const GLuint mesaAttr = vp->index_to_input[attr]; + const GLint stride = arrays[mesaAttr]->StrideB; const GLubyte *start = arrays[mesaAttr]->Ptr; - stride = arrays[mesaAttr]->StrideB; + const unsigned sz = (arrays[mesaAttr]->Size * + _mesa_sizeof_type(arrays[mesaAttr]->Type)); + const GLubyte *end = start + (max_index * stride) + sz; + if (attr == 0) { low_addr = start; + high_addr = end; } else { low_addr = MIN2(low_addr, start); + high_addr = MAX2(high_addr, end); } } *low = low_addr; - *high = low_addr + (max_index + 1) * stride; + *high = high_addr; } |