~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/tnl/t_array_api.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Mesa 3-D graphics library
3
 
 * Version:  6.5
 
3
 * Version:  6.5.2
4
4
 *
5
5
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
6
6
 *
115
115
{
116
116
   GET_CURRENT_CONTEXT(ctx);
117
117
   TNLcontext *tnl = TNL_CONTEXT(ctx);
 
118
   /* It's tempting to get rid of this threshold value because we take
 
119
    * very different paths if 'count' is less than or greater than 'thresh'.
 
120
    * I've found/fixed at least one bug which only occured for particular
 
121
    * array sizes.  Also, several conformance tests use very short arrays
 
122
    * which means the long-array path doesn't get tested.  -Brian
 
123
    */
118
124
   GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10;
119
125
   
120
126
   if (MESA_VERBOSE & VERBOSE_API)
289
295
   ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT,
290
296
                                               count, type, indices );
291
297
 
 
298
#ifdef DEBUG
 
299
   /* check that array indices really fall inside [start, end] range */
 
300
   {
 
301
      GLuint i;
 
302
      for (i = 0; i < count; i++) {
 
303
         if (ui_indices[i] < start || ui_indices[i] > end) {
 
304
            _mesa_warning(ctx, "Invalid array index in "
 
305
                          "glDrawRangeElements(index=%u)", ui_indices[i]);
 
306
         }
 
307
      }
 
308
   }
 
309
#endif
292
310
 
293
311
   assert(!ctx->CompileFlag);
294
312