diff options
author | marha <marha@users.sourceforge.net> | 2011-04-07 07:49:55 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-07 07:49:55 +0000 |
commit | 143921f2eb615190ed77e57a6f93f02ffb325c91 (patch) | |
tree | 19c73ab0992ee863cc67e7b98da84d2347a77ef7 /mesalib/src/mesa/main/arrayobj.c | |
parent | e2b908c356746281aba48128da7dc15a28f5a773 (diff) | |
parent | de1c6801fc854692d39fb2f8d53bf54ab25a1287 (diff) | |
download | vcxsrv-143921f2eb615190ed77e57a6f93f02ffb325c91.tar.gz vcxsrv-143921f2eb615190ed77e57a6f93f02ffb325c91.tar.bz2 vcxsrv-143921f2eb615190ed77e57a6f93f02ffb325c91.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/arrayobj.c')
-rw-r--r-- | mesalib/src/mesa/main/arrayobj.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index 1033ce639..8fff3c0e2 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -50,6 +50,7 @@ #include "arrayobj.h"
#include "macros.h"
#include "mtypes.h"
+#include "varray.h"
#include "main/dispatch.h"
@@ -280,44 +281,13 @@ remove_array_object( struct gl_context *ctx, struct gl_array_object *obj ) /**
- * Compute the index of the last array element that can be safely accessed
- * in a vertex array. We can really only do this when the array lives in
- * a VBO.
- * The array->_MaxElement field will be updated.
- * Later in glDrawArrays/Elements/etc we can do some bounds checking.
- */
-static void
-compute_max_element(struct gl_client_array *array)
-{
- if (array->BufferObj->Name) {
- /* Compute the max element we can access in the VBO without going
- * out of bounds.
- */
- array->_MaxElement = ((GLsizeiptrARB) array->BufferObj->Size
- - (GLsizeiptrARB) array->Ptr + array->StrideB
- - array->_ElementSize) / array->StrideB;
- if (0)
- printf("%s Object %u Size %u MaxElement %u\n",
- __FUNCTION__,
- array->BufferObj->Name,
- (GLuint) array->BufferObj->Size,
- array->_MaxElement);
- }
- else {
- /* user-space array, no idea how big it is */
- array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */
- }
-}
-
-
-/**
* Helper for update_arrays().
* \return min(current min, array->_MaxElement).
*/
static GLuint
update_min(GLuint min, struct gl_client_array *array)
{
- compute_max_element(array);
+ _mesa_update_array_max_element(array);
if (array->Enabled)
return MIN2(min, array->_MaxElement);
else
|