aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_noop.c
blob: 86bdbb04edb1b06096d51e928e45501938aa91e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
/*
 * Mesa 3-D graphics library
 *
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 * Copyright (C) 2011  VMware, Inc.  All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */


/**
 * GLvertexformat no-op functions.  Used in out-of-memory situations.
 */


#include "main/glheader.h"
#include "main/api_arrayelt.h"
#include "main/context.h"
#include "main/dispatch.h"
#include "main/dlist.h"
#include "main/eval.h"
#include "main/mfeatures.h"
#include "vbo/vbo_noop.h"

static void GLAPIENTRY
_mesa_noop_EdgeFlag(GLboolean b)
{
}

static void GLAPIENTRY
_mesa_noop_Indexf(GLfloat f)
{
}

static void GLAPIENTRY
_mesa_noop_Indexfv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_FogCoordfEXT(GLfloat a)
{
}

static void GLAPIENTRY
_mesa_noop_FogCoordfvEXT(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Normal3f(GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_Normal3fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Color4f(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
{
}

static void GLAPIENTRY
_mesa_noop_Color4fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Color3f(GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_Color3fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord1fARB(GLenum target, GLfloat a)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord1fvARB(GLenum target, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord2fARB(GLenum target, GLfloat a, GLfloat b)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord2fvARB(GLenum target, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord3fARB(GLenum target, GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord3fvARB(GLenum target, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord4fARB(GLenum target, GLfloat a, GLfloat b,
                              GLfloat c, GLfloat d)
{
}

static void GLAPIENTRY
_mesa_noop_MultiTexCoord4fvARB(GLenum target, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_SecondaryColor3fEXT(GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_SecondaryColor3fvEXT(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord1f(GLfloat a)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord1fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord2f(GLfloat a, GLfloat b)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord2fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord3f(GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord3fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord4f(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
{
}

static void GLAPIENTRY
_mesa_noop_TexCoord4fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib1fNV(GLuint index, GLfloat x)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib4fNV(GLuint index, GLfloat x,
                            GLfloat y, GLfloat z, GLfloat w)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
{
}


static void GLAPIENTRY
_mesa_noop_VertexAttrib1fARB(GLuint index, GLfloat x)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib4fARB(GLuint index, GLfloat x,
                             GLfloat y, GLfloat z, GLfloat w)
{
}

static void GLAPIENTRY
_mesa_noop_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Materialfv(GLenum face, GLenum pname, const GLfloat * params)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex2fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex3fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex4fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex2f(GLfloat a, GLfloat b)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex3f(GLfloat a, GLfloat b, GLfloat c)
{
}

static void GLAPIENTRY
_mesa_noop_Vertex4f(GLfloat a, GLfloat b, GLfloat c, GLfloat d)
{
}


#if FEATURE_evaluators
static void GLAPIENTRY
_mesa_noop_EvalCoord1f(GLfloat a)
{
}

static void GLAPIENTRY
_mesa_noop_EvalCoord1fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_EvalCoord2f(GLfloat a, GLfloat b)
{
}

static void GLAPIENTRY
_mesa_noop_EvalCoord2fv(const GLfloat * v)
{
}

static void GLAPIENTRY
_mesa_noop_EvalPoint1(GLint a)
{
}

static void GLAPIENTRY
_mesa_noop_EvalPoint2(GLint a, GLint b)
{
}
#endif /* FEATURE_evaluators */


static void GLAPIENTRY
_mesa_noop_Begin(GLenum mode)
{
}

static void GLAPIENTRY
_mesa_noop_End(void)
{
}

static void GLAPIENTRY
_mesa_noop_PrimitiveRestartNV(void)
{
}


static void GLAPIENTRY
_mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
{
}


static void GLAPIENTRY
_mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
}

static void GLAPIENTRY
_mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
                        const GLvoid * indices)
{
}

static void GLAPIENTRY
_mesa_noop_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
                                  const GLvoid * indices, GLint basevertex)
{
}


static void GLAPIENTRY
_mesa_noop_DrawRangeElements(GLenum mode,
                             GLuint start, GLuint end,
                             GLsizei count, GLenum type,
                             const GLvoid * indices)
{
}

static void GLAPIENTRY
_mesa_noop_MultiDrawElements(GLenum mode, const GLsizei * count, GLenum type,
                             const GLvoid ** indices, GLsizei primcount)
{
}

static void GLAPIENTRY
_mesa_noop_DrawRangeElementsBaseVertex(GLenum mode,
                                       GLuint start, GLuint end,
                                       GLsizei count, GLenum type,
                                       const GLvoid * indices,
                                       GLint basevertex)
{
}

static void GLAPIENTRY
_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei * count,
                                       GLenum type,
                                       const GLvoid * const *indices,
                                       GLsizei primcount,
                                       const GLint * basevertex)
{
}

static void GLAPIENTRY
_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
}

static void GLAPIENTRY
_mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
}


/**
 * Build a vertexformat of functions that are no-ops.
 * These are used in out-of-memory situations when we have no VBO
 * to put the vertex data into.
 */
void
_mesa_noop_vtxfmt_init(GLvertexformat * vfmt)
{
   _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);

   vfmt->Begin = _mesa_noop_Begin;

   _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_);

   vfmt->Color3f = _mesa_noop_Color3f;
   vfmt->Color3fv = _mesa_noop_Color3fv;
   vfmt->Color4f = _mesa_noop_Color4f;
   vfmt->Color4fv = _mesa_noop_Color4fv;
   vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
   vfmt->End = _mesa_noop_End;

   vfmt->PrimitiveRestartNV = _mesa_noop_PrimitiveRestartNV;

   _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_);

   vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
   vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
   vfmt->Indexf = _mesa_noop_Indexf;
   vfmt->Indexfv = _mesa_noop_Indexfv;
   vfmt->Materialfv = _mesa_noop_Materialfv;
   vfmt->MultiTexCoord1fARB = _mesa_noop_MultiTexCoord1fARB;
   vfmt->MultiTexCoord1fvARB = _mesa_noop_MultiTexCoord1fvARB;
   vfmt->MultiTexCoord2fARB = _mesa_noop_MultiTexCoord2fARB;
   vfmt->MultiTexCoord2fvARB = _mesa_noop_MultiTexCoord2fvARB;
   vfmt->MultiTexCoord3fARB = _mesa_noop_MultiTexCoord3fARB;
   vfmt->MultiTexCoord3fvARB = _mesa_noop_MultiTexCoord3fvARB;
   vfmt->MultiTexCoord4fARB = _mesa_noop_MultiTexCoord4fARB;
   vfmt->MultiTexCoord4fvARB = _mesa_noop_MultiTexCoord4fvARB;
   vfmt->Normal3f = _mesa_noop_Normal3f;
   vfmt->Normal3fv = _mesa_noop_Normal3fv;
   vfmt->SecondaryColor3fEXT = _mesa_noop_SecondaryColor3fEXT;
   vfmt->SecondaryColor3fvEXT = _mesa_noop_SecondaryColor3fvEXT;
   vfmt->TexCoord1f = _mesa_noop_TexCoord1f;
   vfmt->TexCoord1fv = _mesa_noop_TexCoord1fv;
   vfmt->TexCoord2f = _mesa_noop_TexCoord2f;
   vfmt->TexCoord2fv = _mesa_noop_TexCoord2fv;
   vfmt->TexCoord3f = _mesa_noop_TexCoord3f;
   vfmt->TexCoord3fv = _mesa_noop_TexCoord3fv;
   vfmt->TexCoord4f = _mesa_noop_TexCoord4f;
   vfmt->TexCoord4fv = _mesa_noop_TexCoord4fv;
   vfmt->Vertex2f = _mesa_noop_Vertex2f;
   vfmt->Vertex2fv = _mesa_noop_Vertex2fv;
   vfmt->Vertex3f = _mesa_noop_Vertex3f;
   vfmt->Vertex3fv = _mesa_noop_Vertex3fv;
   vfmt->Vertex4f = _mesa_noop_Vertex4f;
   vfmt->Vertex4fv = _mesa_noop_Vertex4fv;
   vfmt->VertexAttrib1fNV = _mesa_noop_VertexAttrib1fNV;
   vfmt->VertexAttrib1fvNV = _mesa_noop_VertexAttrib1fvNV;
   vfmt->VertexAttrib2fNV = _mesa_noop_VertexAttrib2fNV;
   vfmt->VertexAttrib2fvNV = _mesa_noop_VertexAttrib2fvNV;
   vfmt->VertexAttrib3fNV = _mesa_noop_VertexAttrib3fNV;
   vfmt->VertexAttrib3fvNV = _mesa_noop_VertexAttrib3fvNV;
   vfmt->VertexAttrib4fNV = _mesa_noop_VertexAttrib4fNV;
   vfmt->VertexAttrib4fvNV = _mesa_noop_VertexAttrib4fvNV;
   vfmt->VertexAttrib1fARB = _mesa_noop_VertexAttrib1fARB;
   vfmt->VertexAttrib1fvARB = _mesa_noop_VertexAttrib1fvARB;
   vfmt->VertexAttrib2fARB = _mesa_noop_VertexAttrib2fARB;
   vfmt->VertexAttrib2fvARB = _mesa_noop_VertexAttrib2fvARB;
   vfmt->VertexAttrib3fARB = _mesa_noop_VertexAttrib3fARB;
   vfmt->VertexAttrib3fvARB = _mesa_noop_VertexAttrib3fvARB;
   vfmt->VertexAttrib4fARB = _mesa_noop_VertexAttrib4fARB;
   vfmt->VertexAttrib4fvARB = _mesa_noop_VertexAttrib4fvARB;

   vfmt->Rectf = _mesa_noop_Rectf;

   vfmt->DrawArrays = _mesa_noop_DrawArrays;
   vfmt->DrawElements = _mesa_noop_DrawElements;
   vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
   vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
   vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex;
   vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex;
   vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
}


/**
 * Is the given dispatch table using the no-op functions?
 */
GLboolean
_mesa_using_noop_vtxfmt(const struct _glapi_table *dispatch)
{
   return GET_Begin((struct _glapi_table *) dispatch) == _mesa_noop_Begin;
}