1af69d88dSmrg/* 2af69d88dSmrg * Mesa 3-D graphics library 3af69d88dSmrg * 4af69d88dSmrg * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 5af69d88dSmrg * Copyright (C) 2011 VMware, Inc. All Rights Reserved. 6af69d88dSmrg * 7af69d88dSmrg * Permission is hereby granted, free of charge, to any person obtaining a 8af69d88dSmrg * copy of this software and associated documentation files (the "Software"), 9af69d88dSmrg * to deal in the Software without restriction, including without limitation 10af69d88dSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11af69d88dSmrg * and/or sell copies of the Software, and to permit persons to whom the 12af69d88dSmrg * Software is furnished to do so, subject to the following conditions: 13af69d88dSmrg * 14af69d88dSmrg * The above copyright notice and this permission notice shall be included 15af69d88dSmrg * in all copies or substantial portions of the Software. 16af69d88dSmrg * 17af69d88dSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18af69d88dSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19af69d88dSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 21af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 24af69d88dSmrg */ 25af69d88dSmrg 26af69d88dSmrg 27af69d88dSmrg/** 28af69d88dSmrg * GLvertexformat no-op functions. Used in out-of-memory situations. 29af69d88dSmrg */ 30af69d88dSmrg 317ec681f3Smrg#ifdef _WIN32 327ec681f3Smrg#define NOGDI 337ec681f3Smrg#endif 34af69d88dSmrg 35af69d88dSmrg#include "main/glheader.h" 36af69d88dSmrg#include "main/context.h" 37af69d88dSmrg#include "main/dispatch.h" 38af69d88dSmrg#include "main/dlist.h" 39af69d88dSmrg#include "main/eval.h" 40af69d88dSmrg#include "vbo/vbo_noop.h" 417ec681f3Smrg#include "vbo_attrib.h" 42af69d88dSmrg 43af69d88dSmrgstatic void GLAPIENTRY 44af69d88dSmrg_mesa_noop_Materialfv(GLenum face, GLenum pname, const GLfloat * params) 45af69d88dSmrg{ 46af69d88dSmrg} 47af69d88dSmrg 48af69d88dSmrgstatic void GLAPIENTRY 49af69d88dSmrg_mesa_noop_EvalCoord1f(GLfloat a) 50af69d88dSmrg{ 51af69d88dSmrg} 52af69d88dSmrg 53af69d88dSmrgstatic void GLAPIENTRY 54af69d88dSmrg_mesa_noop_EvalCoord1fv(const GLfloat * v) 55af69d88dSmrg{ 56af69d88dSmrg} 57af69d88dSmrg 58af69d88dSmrgstatic void GLAPIENTRY 59af69d88dSmrg_mesa_noop_EvalCoord2f(GLfloat a, GLfloat b) 60af69d88dSmrg{ 61af69d88dSmrg} 62af69d88dSmrg 63af69d88dSmrgstatic void GLAPIENTRY 64af69d88dSmrg_mesa_noop_EvalCoord2fv(const GLfloat * v) 65af69d88dSmrg{ 66af69d88dSmrg} 67af69d88dSmrg 68af69d88dSmrgstatic void GLAPIENTRY 69af69d88dSmrg_mesa_noop_EvalPoint1(GLint a) 70af69d88dSmrg{ 71af69d88dSmrg} 72af69d88dSmrg 73af69d88dSmrgstatic void GLAPIENTRY 74af69d88dSmrg_mesa_noop_EvalPoint2(GLint a, GLint b) 75af69d88dSmrg{ 76af69d88dSmrg} 77af69d88dSmrg 78af69d88dSmrgstatic void GLAPIENTRY 79af69d88dSmrg_mesa_noop_ArrayElement(GLint elem) 80af69d88dSmrg{ 81af69d88dSmrg} 82af69d88dSmrg 83af69d88dSmrg 84af69d88dSmrgstatic void GLAPIENTRY 85af69d88dSmrg_mesa_noop_Begin(GLenum mode) 86af69d88dSmrg{ 87af69d88dSmrg} 88af69d88dSmrg 89af69d88dSmrgstatic void GLAPIENTRY 90af69d88dSmrg_mesa_noop_End(void) 91af69d88dSmrg{ 92af69d88dSmrg} 93af69d88dSmrg 94af69d88dSmrgstatic void GLAPIENTRY 95af69d88dSmrg_mesa_noop_PrimitiveRestartNV(void) 96af69d88dSmrg{ 97af69d88dSmrg} 98af69d88dSmrg 997ec681f3Smrg/** 1007ec681f3Smrg * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex? 1017ec681f3Smrg * It depends on a few things, including whether we're inside or outside 1027ec681f3Smrg * of glBegin/glEnd. 1037ec681f3Smrg */ 1047ec681f3Smrgstatic inline bool 1057ec681f3Smrgis_vertex_position(const struct gl_context *ctx, GLuint index) 1067ec681f3Smrg{ 1077ec681f3Smrg return false; /* it doesn't matter for noop */ 1087ec681f3Smrg} 1097ec681f3Smrg 1107ec681f3Smrg#define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) do { (void)ctx; (void)(A); } while(0) 1117ec681f3Smrg#define ERROR(err) _mesa_error(ctx, err, __func__) 1127ec681f3Smrg#define TAG(x) _mesa_noop_##x 1137ec681f3Smrg 1147ec681f3Smrg#include "vbo_attrib_tmp.h" 1157ec681f3Smrg 116af69d88dSmrg 117af69d88dSmrg/** 118af69d88dSmrg * Build a vertexformat of functions that are no-ops. 119af69d88dSmrg * These are used in out-of-memory situations when we have no VBO 120af69d88dSmrg * to put the vertex data into. 121af69d88dSmrg */ 122af69d88dSmrgvoid 1237ec681f3Smrg_mesa_noop_vtxfmt_init(struct gl_context *ctx, GLvertexformat * vfmt) 124af69d88dSmrg{ 1257ec681f3Smrg#define NAME_AE(x) _mesa_noop_##x 1267ec681f3Smrg#define NAME_CALLLIST(x) _mesa_##x 1277ec681f3Smrg#define NAME(x) _mesa_noop_##x 1287ec681f3Smrg#define NAME_ES(x) _mesa_noop_##x##ARB 129af69d88dSmrg 1307ec681f3Smrg#include "vbo_init_tmp.h" 131af69d88dSmrg} 132af69d88dSmrg 133af69d88dSmrg 134af69d88dSmrg/** 135af69d88dSmrg * Is the given dispatch table using the no-op functions? 136af69d88dSmrg */ 137af69d88dSmrgGLboolean 138af69d88dSmrg_mesa_using_noop_vtxfmt(const struct _glapi_table *dispatch) 139af69d88dSmrg{ 140af69d88dSmrg return GET_Begin((struct _glapi_table *) dispatch) == _mesa_noop_Begin; 141af69d88dSmrg} 142