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"
40 static void GLAPIENTRY
41 _mesa_noop_EdgeFlag(GLboolean b
)
45 static void GLAPIENTRY
46 _mesa_noop_Indexf(GLfloat f
)
50 static void GLAPIENTRY
51 _mesa_noop_Indexfv(const GLfloat
* v
)
55 static void GLAPIENTRY
56 _mesa_noop_FogCoordfEXT(GLfloat a
)
60 static void GLAPIENTRY
61 _mesa_noop_FogCoordfvEXT(const GLfloat
* v
)
65 static void GLAPIENTRY
66 _mesa_noop_Normal3f(GLfloat a
, GLfloat b
, GLfloat c
)
70 static void GLAPIENTRY
71 _mesa_noop_Normal3fv(const GLfloat
* v
)
75 static void GLAPIENTRY
76 _mesa_noop_Color4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
80 static void GLAPIENTRY
81 _mesa_noop_Color4fv(const GLfloat
* v
)
85 static void GLAPIENTRY
86 _mesa_noop_Color3f(GLfloat a
, GLfloat b
, GLfloat c
)
90 static void GLAPIENTRY
91 _mesa_noop_Color3fv(const GLfloat
* v
)
95 static void GLAPIENTRY
96 _mesa_noop_MultiTexCoord1fARB(GLenum target
, GLfloat a
)
100 static void GLAPIENTRY
101 _mesa_noop_MultiTexCoord1fvARB(GLenum target
, const GLfloat
* v
)
105 static void GLAPIENTRY
106 _mesa_noop_MultiTexCoord2fARB(GLenum target
, GLfloat a
, GLfloat b
)
110 static void GLAPIENTRY
111 _mesa_noop_MultiTexCoord2fvARB(GLenum target
, const GLfloat
* v
)
115 static void GLAPIENTRY
116 _mesa_noop_MultiTexCoord3fARB(GLenum target
, GLfloat a
, GLfloat b
, GLfloat c
)
120 static void GLAPIENTRY
121 _mesa_noop_MultiTexCoord3fvARB(GLenum target
, const GLfloat
* v
)
125 static void GLAPIENTRY
126 _mesa_noop_MultiTexCoord4fARB(GLenum target
, GLfloat a
, GLfloat b
,
127 GLfloat c
, GLfloat d
)
131 static void GLAPIENTRY
132 _mesa_noop_MultiTexCoord4fvARB(GLenum target
, const GLfloat
* v
)
136 static void GLAPIENTRY
137 _mesa_noop_SecondaryColor3fEXT(GLfloat a
, GLfloat b
, GLfloat c
)
141 static void GLAPIENTRY
142 _mesa_noop_SecondaryColor3fvEXT(const GLfloat
* v
)
146 static void GLAPIENTRY
147 _mesa_noop_TexCoord1f(GLfloat a
)
151 static void GLAPIENTRY
152 _mesa_noop_TexCoord1fv(const GLfloat
* v
)
156 static void GLAPIENTRY
157 _mesa_noop_TexCoord2f(GLfloat a
, GLfloat b
)
161 static void GLAPIENTRY
162 _mesa_noop_TexCoord2fv(const GLfloat
* v
)
166 static void GLAPIENTRY
167 _mesa_noop_TexCoord3f(GLfloat a
, GLfloat b
, GLfloat c
)
171 static void GLAPIENTRY
172 _mesa_noop_TexCoord3fv(const GLfloat
* v
)
176 static void GLAPIENTRY
177 _mesa_noop_TexCoord4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
181 static void GLAPIENTRY
182 _mesa_noop_TexCoord4fv(const GLfloat
* v
)
186 static void GLAPIENTRY
187 _mesa_noop_VertexAttrib1fNV(GLuint index
, GLfloat x
)
191 static void GLAPIENTRY
192 _mesa_noop_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
196 static void GLAPIENTRY
197 _mesa_noop_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
201 static void GLAPIENTRY
202 _mesa_noop_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
206 static void GLAPIENTRY
207 _mesa_noop_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
211 static void GLAPIENTRY
212 _mesa_noop_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
216 static void GLAPIENTRY
217 _mesa_noop_VertexAttrib4fNV(GLuint index
, GLfloat x
,
218 GLfloat y
, GLfloat z
, GLfloat w
)
222 static void GLAPIENTRY
223 _mesa_noop_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
228 static void GLAPIENTRY
229 _mesa_noop_VertexAttrib1fARB(GLuint index
, GLfloat x
)
233 static void GLAPIENTRY
234 _mesa_noop_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
238 static void GLAPIENTRY
239 _mesa_noop_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
243 static void GLAPIENTRY
244 _mesa_noop_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
248 static void GLAPIENTRY
249 _mesa_noop_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
253 static void GLAPIENTRY
254 _mesa_noop_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
258 static void GLAPIENTRY
259 _mesa_noop_VertexAttrib4fARB(GLuint index
, GLfloat x
,
260 GLfloat y
, GLfloat z
, GLfloat w
)
264 static void GLAPIENTRY
265 _mesa_noop_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
269 static void GLAPIENTRY
270 _mesa_noop_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* params
)
274 static void GLAPIENTRY
275 _mesa_noop_Vertex2fv(const GLfloat
* v
)
279 static void GLAPIENTRY
280 _mesa_noop_Vertex3fv(const GLfloat
* v
)
284 static void GLAPIENTRY
285 _mesa_noop_Vertex4fv(const GLfloat
* v
)
289 static void GLAPIENTRY
290 _mesa_noop_Vertex2f(GLfloat a
, GLfloat b
)
294 static void GLAPIENTRY
295 _mesa_noop_Vertex3f(GLfloat a
, GLfloat b
, GLfloat c
)
299 static void GLAPIENTRY
300 _mesa_noop_Vertex4f(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
304 static void GLAPIENTRY
305 _mesa_noop_EvalCoord1f(GLfloat a
)
309 static void GLAPIENTRY
310 _mesa_noop_EvalCoord1fv(const GLfloat
* v
)
314 static void GLAPIENTRY
315 _mesa_noop_EvalCoord2f(GLfloat a
, GLfloat b
)
319 static void GLAPIENTRY
320 _mesa_noop_EvalCoord2fv(const GLfloat
* v
)
324 static void GLAPIENTRY
325 _mesa_noop_EvalPoint1(GLint a
)
329 static void GLAPIENTRY
330 _mesa_noop_EvalPoint2(GLint a
, GLint b
)
334 static void GLAPIENTRY
335 _mesa_noop_Begin(GLenum mode
)
339 static void GLAPIENTRY
344 static void GLAPIENTRY
345 _mesa_noop_PrimitiveRestartNV(void)
350 static void GLAPIENTRY
351 _mesa_noop_Rectf(GLfloat x1
, GLfloat y1
, GLfloat x2
, GLfloat y2
)
356 static void GLAPIENTRY
357 _mesa_noop_DrawArrays(GLenum mode
, GLint start
, GLsizei count
)
361 static void GLAPIENTRY
362 _mesa_noop_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
363 const GLvoid
* indices
)
367 static void GLAPIENTRY
368 _mesa_noop_DrawElementsBaseVertex(GLenum mode
, GLsizei count
, GLenum type
,
369 const GLvoid
* indices
, GLint basevertex
)
374 static void GLAPIENTRY
375 _mesa_noop_DrawRangeElements(GLenum mode
,
376 GLuint start
, GLuint end
,
377 GLsizei count
, GLenum type
,
378 const GLvoid
* indices
)
382 static void GLAPIENTRY
383 _mesa_noop_MultiDrawElements(GLenum mode
, const GLsizei
* count
, GLenum type
,
384 const GLvoid
** indices
, GLsizei primcount
)
388 static void GLAPIENTRY
389 _mesa_noop_DrawRangeElementsBaseVertex(GLenum mode
,
390 GLuint start
, GLuint end
,
391 GLsizei count
, GLenum type
,
392 const GLvoid
* indices
,
397 static void GLAPIENTRY
398 _mesa_noop_MultiDrawElementsBaseVertex(GLenum mode
, const GLsizei
* count
,
400 const GLvoid
* const *indices
,
402 const GLint
* basevertex
)
406 static void GLAPIENTRY
407 _mesa_noop_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
411 static void GLAPIENTRY
412 _mesa_noop_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
418 * Build a vertexformat of functions that are no-ops.
419 * These are used in out-of-memory situations when we have no VBO
420 * to put the vertex data into.
423 _mesa_noop_vtxfmt_init(GLvertexformat
* vfmt
)
425 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
427 vfmt
->Begin
= _mesa_noop_Begin
;
429 _MESA_INIT_DLIST_VTXFMT(vfmt
, _mesa_
);
431 vfmt
->Color3f
= _mesa_noop_Color3f
;
432 vfmt
->Color3fv
= _mesa_noop_Color3fv
;
433 vfmt
->Color4f
= _mesa_noop_Color4f
;
434 vfmt
->Color4fv
= _mesa_noop_Color4fv
;
435 vfmt
->EdgeFlag
= _mesa_noop_EdgeFlag
;
436 vfmt
->End
= _mesa_noop_End
;
438 vfmt
->PrimitiveRestartNV
= _mesa_noop_PrimitiveRestartNV
;
440 _MESA_INIT_EVAL_VTXFMT(vfmt
, _mesa_noop_
);
442 vfmt
->FogCoordfEXT
= _mesa_noop_FogCoordfEXT
;
443 vfmt
->FogCoordfvEXT
= _mesa_noop_FogCoordfvEXT
;
444 vfmt
->Indexf
= _mesa_noop_Indexf
;
445 vfmt
->Indexfv
= _mesa_noop_Indexfv
;
446 vfmt
->Materialfv
= _mesa_noop_Materialfv
;
447 vfmt
->MultiTexCoord1fARB
= _mesa_noop_MultiTexCoord1fARB
;
448 vfmt
->MultiTexCoord1fvARB
= _mesa_noop_MultiTexCoord1fvARB
;
449 vfmt
->MultiTexCoord2fARB
= _mesa_noop_MultiTexCoord2fARB
;
450 vfmt
->MultiTexCoord2fvARB
= _mesa_noop_MultiTexCoord2fvARB
;
451 vfmt
->MultiTexCoord3fARB
= _mesa_noop_MultiTexCoord3fARB
;
452 vfmt
->MultiTexCoord3fvARB
= _mesa_noop_MultiTexCoord3fvARB
;
453 vfmt
->MultiTexCoord4fARB
= _mesa_noop_MultiTexCoord4fARB
;
454 vfmt
->MultiTexCoord4fvARB
= _mesa_noop_MultiTexCoord4fvARB
;
455 vfmt
->Normal3f
= _mesa_noop_Normal3f
;
456 vfmt
->Normal3fv
= _mesa_noop_Normal3fv
;
457 vfmt
->SecondaryColor3fEXT
= _mesa_noop_SecondaryColor3fEXT
;
458 vfmt
->SecondaryColor3fvEXT
= _mesa_noop_SecondaryColor3fvEXT
;
459 vfmt
->TexCoord1f
= _mesa_noop_TexCoord1f
;
460 vfmt
->TexCoord1fv
= _mesa_noop_TexCoord1fv
;
461 vfmt
->TexCoord2f
= _mesa_noop_TexCoord2f
;
462 vfmt
->TexCoord2fv
= _mesa_noop_TexCoord2fv
;
463 vfmt
->TexCoord3f
= _mesa_noop_TexCoord3f
;
464 vfmt
->TexCoord3fv
= _mesa_noop_TexCoord3fv
;
465 vfmt
->TexCoord4f
= _mesa_noop_TexCoord4f
;
466 vfmt
->TexCoord4fv
= _mesa_noop_TexCoord4fv
;
467 vfmt
->Vertex2f
= _mesa_noop_Vertex2f
;
468 vfmt
->Vertex2fv
= _mesa_noop_Vertex2fv
;
469 vfmt
->Vertex3f
= _mesa_noop_Vertex3f
;
470 vfmt
->Vertex3fv
= _mesa_noop_Vertex3fv
;
471 vfmt
->Vertex4f
= _mesa_noop_Vertex4f
;
472 vfmt
->Vertex4fv
= _mesa_noop_Vertex4fv
;
473 vfmt
->VertexAttrib1fNV
= _mesa_noop_VertexAttrib1fNV
;
474 vfmt
->VertexAttrib1fvNV
= _mesa_noop_VertexAttrib1fvNV
;
475 vfmt
->VertexAttrib2fNV
= _mesa_noop_VertexAttrib2fNV
;
476 vfmt
->VertexAttrib2fvNV
= _mesa_noop_VertexAttrib2fvNV
;
477 vfmt
->VertexAttrib3fNV
= _mesa_noop_VertexAttrib3fNV
;
478 vfmt
->VertexAttrib3fvNV
= _mesa_noop_VertexAttrib3fvNV
;
479 vfmt
->VertexAttrib4fNV
= _mesa_noop_VertexAttrib4fNV
;
480 vfmt
->VertexAttrib4fvNV
= _mesa_noop_VertexAttrib4fvNV
;
481 vfmt
->VertexAttrib1fARB
= _mesa_noop_VertexAttrib1fARB
;
482 vfmt
->VertexAttrib1fvARB
= _mesa_noop_VertexAttrib1fvARB
;
483 vfmt
->VertexAttrib2fARB
= _mesa_noop_VertexAttrib2fARB
;
484 vfmt
->VertexAttrib2fvARB
= _mesa_noop_VertexAttrib2fvARB
;
485 vfmt
->VertexAttrib3fARB
= _mesa_noop_VertexAttrib3fARB
;
486 vfmt
->VertexAttrib3fvARB
= _mesa_noop_VertexAttrib3fvARB
;
487 vfmt
->VertexAttrib4fARB
= _mesa_noop_VertexAttrib4fARB
;
488 vfmt
->VertexAttrib4fvARB
= _mesa_noop_VertexAttrib4fvARB
;
490 vfmt
->Rectf
= _mesa_noop_Rectf
;
492 vfmt
->DrawArrays
= _mesa_noop_DrawArrays
;
493 vfmt
->DrawElements
= _mesa_noop_DrawElements
;
494 vfmt
->DrawRangeElements
= _mesa_noop_DrawRangeElements
;
495 vfmt
->MultiDrawElementsEXT
= _mesa_noop_MultiDrawElements
;
496 vfmt
->DrawElementsBaseVertex
= _mesa_noop_DrawElementsBaseVertex
;
497 vfmt
->DrawRangeElementsBaseVertex
= _mesa_noop_DrawRangeElementsBaseVertex
;
498 vfmt
->MultiDrawElementsBaseVertex
= _mesa_noop_MultiDrawElementsBaseVertex
;
503 * Is the given dispatch table using the no-op functions?
506 _mesa_using_noop_vtxfmt(const struct _glapi_table
*dispatch
)
508 return GET_Begin((struct _glapi_table
*) dispatch
) == _mesa_noop_Begin
;