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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
28 * GLvertexformat no-op functions. Used in out-of-memory situations.
35 #include "main/glheader.h"
36 #include "main/context.h"
37 #include "main/dispatch.h"
38 #include "main/dlist.h"
39 #include "main/eval.h"
40 #include "vbo/vbo_noop.h"
41 #include "vbo_attrib.h"
43 static void GLAPIENTRY
44 _mesa_noop_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* params
)
48 static void GLAPIENTRY
49 _mesa_noop_EvalCoord1f(GLfloat a
)
53 static void GLAPIENTRY
54 _mesa_noop_EvalCoord1fv(const GLfloat
* v
)
58 static void GLAPIENTRY
59 _mesa_noop_EvalCoord2f(GLfloat a
, GLfloat b
)
63 static void GLAPIENTRY
64 _mesa_noop_EvalCoord2fv(const GLfloat
* v
)
68 static void GLAPIENTRY
69 _mesa_noop_EvalPoint1(GLint a
)
73 static void GLAPIENTRY
74 _mesa_noop_EvalPoint2(GLint a
, GLint b
)
78 static void GLAPIENTRY
79 _mesa_noop_ArrayElement(GLint elem
)
84 static void GLAPIENTRY
85 _mesa_noop_Begin(GLenum mode
)
89 static void GLAPIENTRY
94 static void GLAPIENTRY
95 _mesa_noop_PrimitiveRestartNV(void)
100 * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
101 * It depends on a few things, including whether we're inside or outside
105 is_vertex_position(const struct gl_context
*ctx
, GLuint index
)
107 return false; /* it doesn't matter for noop */
110 #define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) do { (void)ctx; (void)(A); } while(0)
111 #define ERROR(err) _mesa_error(ctx, err, __func__)
112 #define TAG(x) _mesa_noop_##x
114 #include "vbo_attrib_tmp.h"
118 * Build a vertexformat of functions that are no-ops.
119 * These are used in out-of-memory situations when we have no VBO
120 * to put the vertex data into.
123 _mesa_noop_vtxfmt_init(struct gl_context
*ctx
, GLvertexformat
* vfmt
)
125 #define NAME_AE(x) _mesa_noop_##x
126 #define NAME_CALLLIST(x) _mesa_##x
127 #define NAME(x) _mesa_noop_##x
128 #define NAME_ES(x) _mesa_noop_##x##ARB
130 #include "vbo_init_tmp.h"
135 * Is the given dispatch table using the no-op functions?
138 _mesa_using_noop_vtxfmt(const struct _glapi_table
*dispatch
)
140 return GET_Begin((struct _glapi_table
*) dispatch
) == _mesa_noop_Begin
;