aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/state.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-07 07:41:54 +0000
committermarha <marha@users.sourceforge.net>2011-04-07 07:41:54 +0000
commitde1c6801fc854692d39fb2f8d53bf54ab25a1287 (patch)
tree884c4234434a8da73bd62ef44799b49c752ecd66 /mesalib/src/mesa/main/state.c
parent704e01fc69ebf6302aa1876906805147248abdaa (diff)
downloadvcxsrv-de1c6801fc854692d39fb2f8d53bf54ab25a1287.tar.gz
vcxsrv-de1c6801fc854692d39fb2f8d53bf54ab25a1287.tar.bz2
vcxsrv-de1c6801fc854692d39fb2f8d53bf54ab25a1287.zip
xserver pixman mesa git update 7 Apr 2011
Diffstat (limited to 'mesalib/src/mesa/main/state.c')
-rw-r--r--mesalib/src/mesa/main/state.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c
index 1d1ae4737..4696dbb52 100644
--- a/mesalib/src/mesa/main/state.c
+++ b/mesalib/src/mesa/main/state.c
@@ -48,6 +48,7 @@
#include "texenvprogram.h"
#include "texobj.h"
#include "texstate.h"
+#include "varray.h"
static void
@@ -61,43 +62,13 @@ update_separate_specular(struct gl_context *ctx)
/**
- * 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)
-{
- assert(array->Enabled);
- if (array->BufferObj->Name) {
- GLsizeiptrARB offset = (GLsizeiptrARB) array->Ptr;
- GLsizeiptrARB obj_size = (GLsizeiptrARB) array->BufferObj->Size;
-
- if (offset < obj_size) {
- array->_MaxElement = (obj_size - offset +
- array->StrideB -
- array->_ElementSize) / array->StrideB;
- } else {
- array->_MaxElement = 0;
- }
- }
- 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);
return MIN2(min, array->_MaxElement);
}