~ubuntu-branches/ubuntu/raring/mesa/raring

« back to all changes in this revision

Viewing changes to src/mesa/vbo/vbo_context.h

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2013-01-22 11:54:09 UTC
  • mfrom: (1.7.13)
  • Revision ID: package-import@ubuntu.com-20130122115409-5e9xii2ee1whab3e
Tags: 9.0.2-0ubuntu1
* New upstream release.
* Decrease size of mesa's libgl1-mesa-dri again
  - re-enable 117-static-gallium.patch
  - add 118-dricore-gallium.patch to link against libdricore again

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
   }
152
152
}
153
153
 
 
154
/**
 
155
 * Return if format is integer. The immediate mode commands only emit floats
 
156
 * for non-integer types, thus everything else is integer.
 
157
 */
 
158
static inline GLboolean
 
159
vbo_attrtype_to_integer_flag(GLenum format)
 
160
{
 
161
   switch (format) {
 
162
   case GL_FLOAT:
 
163
      return GL_FALSE;
 
164
   case GL_INT:
 
165
   case GL_UNSIGNED_INT:
 
166
      return GL_TRUE;
 
167
   default:
 
168
      ASSERT(0);
 
169
      return GL_FALSE;
 
170
   }
 
171
}
 
172
 
 
173
 
 
174
/**
 
175
 * Return default component values for the given format.
 
176
 * The return type is an array of floats, because that's how we declare
 
177
 * the vertex storage despite the fact we sometimes store integers in there.
 
178
 */
 
179
static inline const GLfloat *
 
180
vbo_get_default_vals_as_float(GLenum format)
 
181
{
 
182
   static const GLfloat default_float[4] = { 0, 0, 0, 1 };
 
183
   static const GLint default_int[4] = { 0, 0, 0, 1 };
 
184
 
 
185
   switch (format) {
 
186
   case GL_FLOAT:
 
187
      return default_float;
 
188
   case GL_INT:
 
189
   case GL_UNSIGNED_INT:
 
190
      return (const GLfloat*)default_int;
 
191
   default:
 
192
      ASSERT(0);
 
193
      return NULL;
 
194
   }
 
195
}
 
196
 
154
197
#endif