2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
5 * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 * GLvertexformat no-op functions. Used in out-of-memory situations.
31 #include "main/glheader.h"
32 #include "main/api_arrayelt.h"
33 #include "main/context.h"
34 #include "main/dispatch.h"
35 #include "main/dlist.h"
36 #include "main/eval.h"
37 #include "main/mfeatures.h"
38 #include "vbo/vbo_noop.h"
43 static void GLAPIENTRY
44 _mesa_noop_EdgeFlag(GLboolean b
)
48 static void GLAPIENTRY
49 _mesa_noop_Indexf(GLfloat f
)
53 static void GLAPIENTRY
54 _mesa_noop_Indexfv(const GLfloat
* v
)
58 static void GLAPIENTRY
59 _mesa_noop_FogCoordfEXT(GLfloat a
)
63 static void GLAPIENTRY
64 _mesa_noop_FogCoordfvEXT(const GLfloat
* v
)
68 static void GLAPIENTRY
69 _mesa_noop_Normal3f(GLfloat a
, GLfloat b
, GLfloat c
)
73 static void GLAPIENTRY
74 _mesa_noop_Normal3fv(const GLfloat
* v
)
78 static void GLAPIENTRY
79 _mesa_noop_Color4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
83 static void GLAPIENTRY
84 _mesa_noop_Color4fv(const GLfloat
* v
)
88 static void GLAPIENTRY
89 _mesa_noop_Color3f(GLfloat a
, GLfloat b
, GLfloat c
)
93 static void GLAPIENTRY
94 _mesa_noop_Color3fv(const GLfloat
* v
)
98 static void GLAPIENTRY
99 _mesa_noop_MultiTexCoord1fARB(GLenum target
, GLfloat a
)
103 static void GLAPIENTRY
104 _mesa_noop_MultiTexCoord1fvARB(GLenum target
, const GLfloat
* v
)
108 static void GLAPIENTRY
109 _mesa_noop_MultiTexCoord2fARB(GLenum target
, GLfloat a
, GLfloat b
)
113 static void GLAPIENTRY
114 _mesa_noop_MultiTexCoord2fvARB(GLenum target
, const GLfloat
* v
)
118 static void GLAPIENTRY
119 _mesa_noop_MultiTexCoord3fARB(GLenum target
, GLfloat a
, GLfloat b
, GLfloat c
)
123 static void GLAPIENTRY
124 _mesa_noop_MultiTexCoord3fvARB(GLenum target
, const GLfloat
* v
)
128 static void GLAPIENTRY
129 _mesa_noop_MultiTexCoord4fARB(GLenum target
, GLfloat a
, GLfloat b
,
130 GLfloat c
, GLfloat d
)
134 static void GLAPIENTRY
135 _mesa_noop_MultiTexCoord4fvARB(GLenum target
, const GLfloat
* v
)
139 static void GLAPIENTRY
140 _mesa_noop_SecondaryColor3fEXT(GLfloat a
, GLfloat b
, GLfloat c
)
144 static void GLAPIENTRY
145 _mesa_noop_SecondaryColor3fvEXT(const GLfloat
* v
)
149 static void GLAPIENTRY
150 _mesa_noop_TexCoord1f(GLfloat a
)
154 static void GLAPIENTRY
155 _mesa_noop_TexCoord1fv(const GLfloat
* v
)
159 static void GLAPIENTRY
160 _mesa_noop_TexCoord2f(GLfloat a
, GLfloat b
)
164 static void GLAPIENTRY
165 _mesa_noop_TexCoord2fv(const GLfloat
* v
)
169 static void GLAPIENTRY
170 _mesa_noop_TexCoord3f(GLfloat a
, GLfloat b
, GLfloat c
)
174 static void GLAPIENTRY
175 _mesa_noop_TexCoord3fv(const GLfloat
* v
)
179 static void GLAPIENTRY
180 _mesa_noop_TexCoord4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
184 static void GLAPIENTRY
185 _mesa_noop_TexCoord4fv(const GLfloat
* v
)
189 static void GLAPIENTRY
190 _mesa_noop_VertexAttrib1fNV(GLuint index
, GLfloat x
)
194 static void GLAPIENTRY
195 _mesa_noop_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
199 static void GLAPIENTRY
200 _mesa_noop_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
204 static void GLAPIENTRY
205 _mesa_noop_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
209 static void GLAPIENTRY
210 _mesa_noop_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
214 static void GLAPIENTRY
215 _mesa_noop_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
219 static void GLAPIENTRY
220 _mesa_noop_VertexAttrib4fNV(GLuint index
, GLfloat x
,
221 GLfloat y
, GLfloat z
, GLfloat w
)
225 static void GLAPIENTRY
226 _mesa_noop_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
231 static void GLAPIENTRY
232 _mesa_noop_VertexAttrib1fARB(GLuint index
, GLfloat x
)
236 static void GLAPIENTRY
237 _mesa_noop_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
241 static void GLAPIENTRY
242 _mesa_noop_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
246 static void GLAPIENTRY
247 _mesa_noop_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
251 static void GLAPIENTRY
252 _mesa_noop_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
256 static void GLAPIENTRY
257 _mesa_noop_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
261 static void GLAPIENTRY
262 _mesa_noop_VertexAttrib4fARB(GLuint index
, GLfloat x
,
263 GLfloat y
, GLfloat z
, GLfloat w
)
267 static void GLAPIENTRY
268 _mesa_noop_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
272 static void GLAPIENTRY
273 _mesa_noop_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* params
)
277 static void GLAPIENTRY
278 _mesa_noop_Vertex2fv(const GLfloat
* v
)
282 static void GLAPIENTRY
283 _mesa_noop_Vertex3fv(const GLfloat
* v
)
287 static void GLAPIENTRY
288 _mesa_noop_Vertex4fv(const GLfloat
* v
)
292 static void GLAPIENTRY
293 _mesa_noop_Vertex2f(GLfloat a
, GLfloat b
)
297 static void GLAPIENTRY
298 _mesa_noop_Vertex3f(GLfloat a
, GLfloat b
, GLfloat c
)
302 static void GLAPIENTRY
303 _mesa_noop_Vertex4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
308 #if FEATURE_evaluators
309 static void GLAPIENTRY
310 _mesa_noop_EvalCoord1f(GLfloat a
)
314 static void GLAPIENTRY
315 _mesa_noop_EvalCoord1fv(const GLfloat
* v
)
319 static void GLAPIENTRY
320 _mesa_noop_EvalCoord2f(GLfloat a
, GLfloat b
)
324 static void GLAPIENTRY
325 _mesa_noop_EvalCoord2fv(const GLfloat
* v
)
329 static void GLAPIENTRY
330 _mesa_noop_EvalPoint1(GLint a
)
334 static void GLAPIENTRY
335 _mesa_noop_EvalPoint2(GLint a
, GLint b
)
338 #endif /* FEATURE_evaluators */
341 static void GLAPIENTRY
342 _mesa_noop_Begin(GLenum mode
)
346 static void GLAPIENTRY
351 static void GLAPIENTRY
352 _mesa_noop_PrimitiveRestartNV(void)
357 static void GLAPIENTRY
358 _mesa_noop_Rectf(GLfloat x1
, GLfloat y1
, GLfloat x2
, GLfloat y2
)
363 static void GLAPIENTRY
364 _mesa_noop_DrawArrays(GLenum mode
, GLint start
, GLsizei count
)
368 static void GLAPIENTRY
369 _mesa_noop_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
370 const GLvoid
* indices
)
374 static void GLAPIENTRY
375 _mesa_noop_DrawElementsBaseVertex(GLenum mode
, GLsizei count
, GLenum type
,
376 const GLvoid
* indices
, GLint basevertex
)
381 static void GLAPIENTRY
382 _mesa_noop_DrawRangeElements(GLenum mode
,
383 GLuint start
, GLuint end
,
384 GLsizei count
, GLenum type
,
385 const GLvoid
* indices
)
389 static void GLAPIENTRY
390 _mesa_noop_MultiDrawElements(GLenum mode
, const GLsizei
* count
, GLenum type
,
391 const GLvoid
** indices
, GLsizei primcount
)
395 static void GLAPIENTRY
396 _mesa_noop_DrawRangeElementsBaseVertex(GLenum mode
,
397 GLuint start
, GLuint end
,
398 GLsizei count
, GLenum type
,
399 const GLvoid
* indices
,
404 static void GLAPIENTRY
405 _mesa_noop_MultiDrawElementsBaseVertex(GLenum mode
, const GLsizei
* count
,
407 const GLvoid
* const *indices
,
409 const GLint
* basevertex
)
413 static void GLAPIENTRY
414 _mesa_noop_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
418 static void GLAPIENTRY
419 _mesa_noop_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
425 * Build a vertexformat of functions that are no-ops.
426 * These are used in out-of-memory situations when we have no VBO
427 * to put the vertex data into.
430 _mesa_noop_vtxfmt_init(GLvertexformat
* vfmt
)
432 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
434 vfmt
->Begin
= _mesa_noop_Begin
;
436 _MESA_INIT_DLIST_VTXFMT(vfmt
, _mesa_
);
438 vfmt
->Color3f
= _mesa_noop_Color3f
;
439 vfmt
->Color3fv
= _mesa_noop_Color3fv
;
440 vfmt
->Color4f
= _mesa_noop_Color4f
;
441 vfmt
->Color4fv
= _mesa_noop_Color4fv
;
442 vfmt
->EdgeFlag
= _mesa_noop_EdgeFlag
;
443 vfmt
->End
= _mesa_noop_End
;
445 vfmt
->PrimitiveRestartNV
= _mesa_noop_PrimitiveRestartNV
;
447 _MESA_INIT_EVAL_VTXFMT(vfmt
, _mesa_noop_
);
449 vfmt
->FogCoordfEXT
= _mesa_noop_FogCoordfEXT
;
450 vfmt
->FogCoordfvEXT
= _mesa_noop_FogCoordfvEXT
;
451 vfmt
->Indexf
= _mesa_noop_Indexf
;
452 vfmt
->Indexfv
= _mesa_noop_Indexfv
;
453 vfmt
->Materialfv
= _mesa_noop_Materialfv
;
454 vfmt
->MultiTexCoord1fARB
= _mesa_noop_MultiTexCoord1fARB
;
455 vfmt
->MultiTexCoord1fvARB
= _mesa_noop_MultiTexCoord1fvARB
;
456 vfmt
->MultiTexCoord2fARB
= _mesa_noop_MultiTexCoord2fARB
;
457 vfmt
->MultiTexCoord2fvARB
= _mesa_noop_MultiTexCoord2fvARB
;
458 vfmt
->MultiTexCoord3fARB
= _mesa_noop_MultiTexCoord3fARB
;
459 vfmt
->MultiTexCoord3fvARB
= _mesa_noop_MultiTexCoord3fvARB
;
460 vfmt
->MultiTexCoord4fARB
= _mesa_noop_MultiTexCoord4fARB
;
461 vfmt
->MultiTexCoord4fvARB
= _mesa_noop_MultiTexCoord4fvARB
;
462 vfmt
->Normal3f
= _mesa_noop_Normal3f
;
463 vfmt
->Normal3fv
= _mesa_noop_Normal3fv
;
464 vfmt
->SecondaryColor3fEXT
= _mesa_noop_SecondaryColor3fEXT
;
465 vfmt
->SecondaryColor3fvEXT
= _mesa_noop_SecondaryColor3fvEXT
;
466 vfmt
->TexCoord1f
= _mesa_noop_TexCoord1f
;
467 vfmt
->TexCoord1fv
= _mesa_noop_TexCoord1fv
;
468 vfmt
->TexCoord2f
= _mesa_noop_TexCoord2f
;
469 vfmt
->TexCoord2fv
= _mesa_noop_TexCoord2fv
;
470 vfmt
->TexCoord3f
= _mesa_noop_TexCoord3f
;
471 vfmt
->TexCoord3fv
= _mesa_noop_TexCoord3fv
;
472 vfmt
->TexCoord4f
= _mesa_noop_TexCoord4f
;
473 vfmt
->TexCoord4fv
= _mesa_noop_TexCoord4fv
;
474 vfmt
->Vertex2f
= _mesa_noop_Vertex2f
;
475 vfmt
->Vertex2fv
= _mesa_noop_Vertex2fv
;
476 vfmt
->Vertex3f
= _mesa_noop_Vertex3f
;
477 vfmt
->Vertex3fv
= _mesa_noop_Vertex3fv
;
478 vfmt
->Vertex4f
= _mesa_noop_Vertex4f
;
479 vfmt
->Vertex4fv
= _mesa_noop_Vertex4fv
;
480 vfmt
->VertexAttrib1fNV
= _mesa_noop_VertexAttrib1fNV
;
481 vfmt
->VertexAttrib1fvNV
= _mesa_noop_VertexAttrib1fvNV
;
482 vfmt
->VertexAttrib2fNV
= _mesa_noop_VertexAttrib2fNV
;
483 vfmt
->VertexAttrib2fvNV
= _mesa_noop_VertexAttrib2fvNV
;
484 vfmt
->VertexAttrib3fNV
= _mesa_noop_VertexAttrib3fNV
;
485 vfmt
->VertexAttrib3fvNV
= _mesa_noop_VertexAttrib3fvNV
;
486 vfmt
->VertexAttrib4fNV
= _mesa_noop_VertexAttrib4fNV
;
487 vfmt
->VertexAttrib4fvNV
= _mesa_noop_VertexAttrib4fvNV
;
488 vfmt
->VertexAttrib1fARB
= _mesa_noop_VertexAttrib1fARB
;
489 vfmt
->VertexAttrib1fvARB
= _mesa_noop_VertexAttrib1fvARB
;
490 vfmt
->VertexAttrib2fARB
= _mesa_noop_VertexAttrib2fARB
;
491 vfmt
->VertexAttrib2fvARB
= _mesa_noop_VertexAttrib2fvARB
;
492 vfmt
->VertexAttrib3fARB
= _mesa_noop_VertexAttrib3fARB
;
493 vfmt
->VertexAttrib3fvARB
= _mesa_noop_VertexAttrib3fvARB
;
494 vfmt
->VertexAttrib4fARB
= _mesa_noop_VertexAttrib4fARB
;
495 vfmt
->VertexAttrib4fvARB
= _mesa_noop_VertexAttrib4fvARB
;
497 vfmt
->Rectf
= _mesa_noop_Rectf
;
499 vfmt
->DrawArrays
= _mesa_noop_DrawArrays
;
500 vfmt
->DrawElements
= _mesa_noop_DrawElements
;
501 vfmt
->DrawRangeElements
= _mesa_noop_DrawRangeElements
;
502 vfmt
->MultiDrawElementsEXT
= _mesa_noop_MultiDrawElements
;
503 vfmt
->DrawElementsBaseVertex
= _mesa_noop_DrawElementsBaseVertex
;
504 vfmt
->DrawRangeElementsBaseVertex
= _mesa_noop_DrawRangeElementsBaseVertex
;
505 vfmt
->MultiDrawElementsBaseVertex
= _mesa_noop_MultiDrawElementsBaseVertex
;
510 * Is the given dispatch table using the no-op functions?
513 _mesa_using_noop_vtxfmt(const struct _glapi_table
*dispatch
)
515 return GET_Begin((struct _glapi_table
*) dispatch
) == _mesa_noop_Begin
;
519 #endif /* FEATURE_beginend */