[OPENGL32/MESA]
[reactos.git] / reactos / dll / opengl / mesa / main / dd.h
1 /**
2 * \file dd.h
3 * Device driver interfaces.
4 */
5
6 /*
7 * Mesa 3-D graphics library
8 * Version: 6.5.2
9 *
10 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 */
29
30
31 #ifndef DD_INCLUDED
32 #define DD_INCLUDED
33
34 /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
35
36 #include "glheader.h"
37
38 struct gl_buffer_object;
39 struct gl_context;
40 struct gl_display_list;
41 struct gl_framebuffer;
42 struct gl_pixelstore_attrib;
43 struct gl_renderbuffer;
44 struct gl_renderbuffer_attachment;
45 struct gl_texture_image;
46 struct gl_texture_object;
47
48 /* GL_ARB_vertex_buffer_object */
49 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
50 * NULL) if buffer is unavailable for immediate mapping.
51 *
52 * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
53 * would require more book-keeping in the driver than seems necessary
54 * at this point.
55 *
56 * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
57 * want to provoke the driver to throw away the old storage, we will
58 * respect the contents of already referenced data.
59 */
60 #define MESA_MAP_NOWAIT_BIT 0x0040
61
62
63 /**
64 * Device driver function table.
65 * Core Mesa uses these function pointers to call into device drivers.
66 * Most of these functions directly correspond to OpenGL state commands.
67 * Core Mesa will call these functions after error checking has been done
68 * so that the drivers don't have to worry about error testing.
69 *
70 * Vertex transformation/clipping/lighting is patched into the T&L module.
71 * Rasterization functions are patched into the swrast module.
72 *
73 * Note: when new functions are added here, the drivers/common/driverfuncs.c
74 * file should be updated too!!!
75 */
76 struct dd_function_table {
77 /**
78 * Return a string as needed by glGetString().
79 * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
80 * returned.
81 */
82 const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
83
84 /**
85 * Notify the driver after Mesa has made some internal state changes.
86 *
87 * This is in addition to any state change callbacks Mesa may already have
88 * made.
89 */
90 void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
91
92 /**
93 * Get the width and height of the named buffer/window.
94 *
95 * Mesa uses this to determine when the driver's window size has changed.
96 * XXX OBSOLETE: this function will be removed in the future.
97 */
98 void (*GetBufferSize)( struct gl_framebuffer *buffer,
99 GLuint *width, GLuint *height );
100
101 /**
102 * Resize the given framebuffer to the given size.
103 * XXX OBSOLETE: this function will be removed in the future.
104 */
105 void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb,
106 GLuint width, GLuint height);
107
108 /**
109 * Called whenever an error is generated.
110 * __struct gl_contextRec::ErrorValue contains the error value.
111 */
112 void (*Error)( struct gl_context *ctx );
113
114 /**
115 * This is called whenever glFinish() is called.
116 */
117 void (*Finish)( struct gl_context *ctx );
118
119 /**
120 * This is called whenever glFlush() is called.
121 */
122 void (*Flush)( struct gl_context *ctx );
123
124 /**
125 * Clear the color/depth/stencil/accum buffer(s).
126 * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
127 * renderbuffers need to be cleared.
128 */
129 void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
130
131 /**
132 * Execute glAccum command.
133 */
134 void (*Accum)( struct gl_context *ctx, GLenum op, GLfloat value );
135
136
137 /**
138 * Execute glRasterPos, updating the ctx->Current.Raster fields
139 */
140 void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
141
142 /**
143 * \name Image-related functions
144 */
145 /*@{*/
146
147 /**
148 * Called by glDrawPixels().
149 * \p unpack describes how to unpack the source image data.
150 */
151 void (*DrawPixels)( struct gl_context *ctx,
152 GLint x, GLint y, GLsizei width, GLsizei height,
153 GLenum format, GLenum type,
154 const struct gl_pixelstore_attrib *unpack,
155 const GLvoid *pixels );
156
157 /**
158 * Called by glReadPixels().
159 */
160 void (*ReadPixels)( struct gl_context *ctx,
161 GLint x, GLint y, GLsizei width, GLsizei height,
162 GLenum format, GLenum type,
163 const struct gl_pixelstore_attrib *unpack,
164 GLvoid *dest );
165
166 /**
167 * Called by glCopyPixels().
168 */
169 void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
170 GLsizei width, GLsizei height,
171 GLint dstx, GLint dsty, GLenum type );
172
173 /**
174 * Called by glBitmap().
175 */
176 void (*Bitmap)( struct gl_context *ctx,
177 GLint x, GLint y, GLsizei width, GLsizei height,
178 const struct gl_pixelstore_attrib *unpack,
179 const GLubyte *bitmap );
180 /*@}*/
181
182
183 /**
184 * \name Texture image functions
185 */
186 /*@{*/
187
188 /**
189 * Choose actual hardware texture format given the user-provided source
190 * image format and type and the desired internal format. In some
191 * cases, srcFormat and srcType can be GL_NONE.
192 * Called by glTexImage(), etc.
193 */
194 gl_format (*ChooseTextureFormat)( struct gl_context *ctx, GLint internalFormat,
195 GLenum srcFormat, GLenum srcType );
196
197 /**
198 * Called by glTexImage1D(). Simply copy the source texture data into the
199 * destination texture memory. The gl_texture_image fields, etc. will be
200 * fully initialized.
201 * The parameters are the same as glTexImage1D(), plus:
202 * \param packing describes how to unpack the source data.
203 * \param texImage is the destination texture image.
204 */
205 void (*TexImage1D)(struct gl_context *ctx,
206 struct gl_texture_image *texImage,
207 GLint internalFormat,
208 GLint width, GLint border,
209 GLenum format, GLenum type, const GLvoid *pixels,
210 const struct gl_pixelstore_attrib *packing);
211
212 /**
213 * Called by glTexImage2D().
214 *
215 * \sa dd_function_table::TexImage1D.
216 */
217 void (*TexImage2D)(struct gl_context *ctx,
218 struct gl_texture_image *texImage,
219 GLint internalFormat,
220 GLint width, GLint height, GLint border,
221 GLenum format, GLenum type, const GLvoid *pixels,
222 const struct gl_pixelstore_attrib *packing);
223
224 /**
225 * Called by glTexSubImage1D(). Replace a subset of the target texture
226 * with new texel data.
227 * \sa dd_function_table::TexImage1D.
228 */
229 void (*TexSubImage1D)(struct gl_context *ctx,
230 struct gl_texture_image *texImage,
231 GLint xoffset, GLsizei width,
232 GLenum format, GLenum type,
233 const GLvoid *pixels,
234 const struct gl_pixelstore_attrib *packing);
235
236 /**
237 * Called by glTexSubImage2D().
238 *
239 * \sa dd_function_table::TexSubImage1D.
240 */
241 void (*TexSubImage2D)(struct gl_context *ctx,
242 struct gl_texture_image *texImage,
243 GLint xoffset, GLint yoffset,
244 GLsizei width, GLsizei height,
245 GLenum format, GLenum type,
246 const GLvoid *pixels,
247 const struct gl_pixelstore_attrib *packing);
248
249
250 /**
251 * Called by glGetTexImage().
252 */
253 void (*GetTexImage)( struct gl_context *ctx,
254 GLenum format, GLenum type, GLvoid *pixels,
255 struct gl_texture_image *texImage );
256
257 /**
258 * Called by glCopyTexSubImage1D() and glCopyTexImage1D().
259 */
260 void (*CopyTexSubImage1D)(struct gl_context *ctx,
261 struct gl_texture_image *texImage,
262 GLint xoffset,
263 struct gl_renderbuffer *rb,
264 GLint x, GLint y, GLsizei width);
265
266 /**
267 * Called by glCopyTexSubImage2D() and glCopyTexImage2D().
268 */
269 void (*CopyTexSubImage2D)(struct gl_context *ctx,
270 struct gl_texture_image *texImage,
271 GLint xoffset, GLint yoffset,
272 struct gl_renderbuffer *rb,
273 GLint x, GLint y,
274 GLsizei width, GLsizei height);
275
276 /**
277 * Called by glTexImage[123]D when user specifies a proxy texture
278 * target.
279 *
280 * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
281 */
282 GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
283 GLint level, GLint internalFormat,
284 GLenum format, GLenum type,
285 GLint width, GLint height,
286 GLint depth, GLint border);
287 /*@}*/
288
289
290 /**
291 * \name Compressed texture functions
292 */
293 /*@{*/
294
295 /**
296 * Called by glCompressedTexImage1D().
297 * The parameters are the same as for glCompressedTexImage1D(), plus a
298 * pointer to the destination texure image.
299 */
300 void (*CompressedTexImage1D)(struct gl_context *ctx,
301 struct gl_texture_image *texImage,
302 GLint internalFormat,
303 GLsizei width, GLint border,
304 GLsizei imageSize, const GLvoid *data);
305 /**
306 * Called by glCompressedTexImage2D().
307 *
308 * \sa dd_function_table::CompressedTexImage1D.
309 */
310 void (*CompressedTexImage2D)(struct gl_context *ctx,
311 struct gl_texture_image *texImage,
312 GLint internalFormat,
313 GLsizei width, GLsizei height, GLint border,
314 GLsizei imageSize, const GLvoid *data);
315
316 /**
317 * Called by glCompressedTexSubImage1D().
318 */
319 void (*CompressedTexSubImage1D)(struct gl_context *ctx,
320 struct gl_texture_image *texImage,
321 GLint xoffset, GLsizei width,
322 GLenum format,
323 GLsizei imageSize, const GLvoid *data);
324
325 /**
326 * Called by glCompressedTexSubImage2D().
327 */
328 void (*CompressedTexSubImage2D)(struct gl_context *ctx,
329 struct gl_texture_image *texImage,
330 GLint xoffset, GLint yoffset,
331 GLsizei width, GLint height,
332 GLenum format,
333 GLsizei imageSize, const GLvoid *data);
334 /*@}*/
335
336 /**
337 * \name Texture object / image functions
338 */
339 /*@{*/
340
341 /**
342 * Called by glBindTexture().
343 */
344 void (*BindTexture)( struct gl_context *ctx, GLenum target,
345 struct gl_texture_object *tObj );
346
347 /**
348 * Called to allocate a new texture object. Drivers will usually
349 * allocate/return a subclass of gl_texture_object.
350 */
351 struct gl_texture_object * (*NewTextureObject)(struct gl_context *ctx,
352 GLuint name, GLenum target);
353 /**
354 * Called to delete/free a texture object. Drivers should free the
355 * object and any image data it contains.
356 */
357 void (*DeleteTexture)(struct gl_context *ctx,
358 struct gl_texture_object *texObj);
359
360 /** Called to allocate a new texture image object. */
361 struct gl_texture_image * (*NewTextureImage)(struct gl_context *ctx);
362
363 /** Called to free a texture image object returned by NewTextureImage() */
364 void (*DeleteTextureImage)(struct gl_context *ctx,
365 struct gl_texture_image *);
366
367 /** Called to allocate memory for a single texture image */
368 GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx,
369 struct gl_texture_image *texImage,
370 gl_format format, GLsizei width,
371 GLsizei height, GLsizei depth);
372
373 /** Free the memory for a single texture image */
374 void (*FreeTextureImageBuffer)(struct gl_context *ctx,
375 struct gl_texture_image *texImage);
376
377 /** Map a slice of a texture image into user space.
378 * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice
379 * indicates the 1D array index.
380 * \param texImage the texture image
381 * \param slice the 3D image slice or array texture slice
382 * \param x, y, w, h region of interest
383 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
384 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
385 * \param mapOut returns start of mapping of region of interest
386 * \param rowStrideOut returns row stride (in bytes)
387 */
388 void (*MapTextureImage)(struct gl_context *ctx,
389 struct gl_texture_image *texImage,
390 GLuint slice,
391 GLuint x, GLuint y, GLuint w, GLuint h,
392 GLbitfield mode,
393 GLubyte **mapOut, GLint *rowStrideOut);
394
395 void (*UnmapTextureImage)(struct gl_context *ctx,
396 struct gl_texture_image *texImage,
397 GLuint slice);
398
399 /** For GL_ARB_texture_storage. Allocate memory for whole mipmap stack.
400 * All the gl_texture_images in the texture object will have their
401 * dimensions, format, etc. initialized already.
402 */
403 GLboolean (*AllocTextureStorage)(struct gl_context *ctx,
404 struct gl_texture_object *texObj,
405 GLsizei levels, GLsizei width,
406 GLsizei height, GLsizei depth);
407
408 /**
409 * Map a renderbuffer into user space.
410 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
411 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
412 */
413 void (*MapRenderbuffer)(struct gl_context *ctx,
414 struct gl_renderbuffer *rb,
415 GLuint x, GLuint y, GLuint w, GLuint h,
416 GLbitfield mode,
417 GLubyte **mapOut, GLint *rowStrideOut);
418
419 void (*UnmapRenderbuffer)(struct gl_context *ctx,
420 struct gl_renderbuffer *rb);
421
422 /*@}*/
423
424 /**
425 * \name State-changing functions.
426 *
427 * \note drawing functions are above.
428 *
429 * These functions are called by their corresponding OpenGL API functions.
430 * They are \e also called by the gl_PopAttrib() function!!!
431 * May add more functions like these to the device driver in the future.
432 */
433 /*@{*/
434 /** Specify the alpha test function */
435 void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
436 /** Set the blend color */
437 void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
438 /** Set the blend equation */
439 void (*BlendEquationSeparate)(struct gl_context *ctx, GLenum modeRGB, GLenum modeA);
440 void (*BlendEquationSeparatei)(struct gl_context *ctx, GLuint buffer,
441 GLenum modeRGB, GLenum modeA);
442 /** Specify pixel arithmetic */
443 void (*BlendFuncSeparate)(struct gl_context *ctx,
444 GLenum sfactorRGB, GLenum dfactorRGB,
445 GLenum sfactorA, GLenum dfactorA);
446 void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
447 GLenum sfactorRGB, GLenum dfactorRGB,
448 GLenum sfactorA, GLenum dfactorA);
449 /** Specify clear values for the color buffers */
450 void (*ClearColor)(struct gl_context *ctx,
451 const union gl_color_union color);
452 /** Specify the clear value for the depth buffer */
453 void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
454 /** Specify the clear value for the stencil buffer */
455 void (*ClearStencil)(struct gl_context *ctx, GLint s);
456 /** Specify a plane against which all geometry is clipped */
457 void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
458 /** Enable and disable writing of frame buffer color components */
459 void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
460 GLboolean bmask, GLboolean amask );
461 /** Cause a material color to track the current color */
462 void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
463 /** Specify whether front- or back-facing facets can be culled */
464 void (*CullFace)(struct gl_context *ctx, GLenum mode);
465 /** Define front- and back-facing polygons */
466 void (*FrontFace)(struct gl_context *ctx, GLenum mode);
467 /** Specify the value used for depth buffer comparisons */
468 void (*DepthFunc)(struct gl_context *ctx, GLenum func);
469 /** Enable or disable writing into the depth buffer */
470 void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
471 /** Specify mapping of depth values from NDC to window coordinates */
472 void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval);
473 /** Specify the current buffer for writing */
474 void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
475 /** Enable or disable server-side gl capabilities */
476 void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
477 /** Specify fog parameters */
478 void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
479 /** Specify implementation-specific hints */
480 void (*Hint)(struct gl_context *ctx, GLenum target, GLenum mode);
481 /** Set light source parameters.
482 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
483 * been transformed to eye-space.
484 */
485 void (*Lightfv)(struct gl_context *ctx, GLenum light,
486 GLenum pname, const GLfloat *params );
487 /** Set the lighting model parameters */
488 void (*LightModelfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
489 /** Specify the line stipple pattern */
490 void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
491 /** Specify the width of rasterized lines */
492 void (*LineWidth)(struct gl_context *ctx, GLfloat width);
493 /** Specify a logical pixel operation for color index rendering */
494 void (*LogicOpcode)(struct gl_context *ctx, GLenum opcode);
495 void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
496 const GLfloat *params);
497 /** Specify the diameter of rasterized points */
498 void (*PointSize)(struct gl_context *ctx, GLfloat size);
499 /** Select a polygon rasterization mode */
500 void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
501 /** Set the scale and units used to calculate depth values */
502 void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
503 /** Set the polygon stippling pattern */
504 void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
505 /* Specifies the current buffer for reading */
506 void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
507 /** Set rasterization mode */
508 void (*RenderMode)(struct gl_context *ctx, GLenum mode );
509 /** Define the scissor box */
510 void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
511 /** Select flat or smooth shading */
512 void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
513 /** Control the generation of texture coordinates */
514 void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
515 const GLfloat *params);
516 /** Set texture environment parameters */
517 void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
518 const GLfloat *param);
519 /** Set texture parameters */
520 void (*TexParameter)(struct gl_context *ctx, GLenum target,
521 struct gl_texture_object *texObj,
522 GLenum pname, const GLfloat *params);
523 /** Set the viewport */
524 void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
525 /*@}*/
526
527
528 /**
529 * \name Vertex/pixel buffer object functions
530 */
531 /*@{*/
532 void (*BindBuffer)( struct gl_context *ctx, GLenum target,
533 struct gl_buffer_object *obj );
534
535 struct gl_buffer_object * (*NewBufferObject)( struct gl_context *ctx, GLuint buffer,
536 GLenum target );
537
538 void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
539
540 GLboolean (*BufferData)( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
541 const GLvoid *data, GLenum usage,
542 struct gl_buffer_object *obj );
543
544 void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
545 GLsizeiptrARB size, const GLvoid *data,
546 struct gl_buffer_object *obj );
547
548 void (*GetBufferSubData)( struct gl_context *ctx,
549 GLintptrARB offset, GLsizeiptrARB size,
550 GLvoid *data, struct gl_buffer_object *obj );
551
552 /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
553 */
554 void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
555 GLsizeiptr length, GLbitfield access,
556 struct gl_buffer_object *obj);
557
558 void (*FlushMappedBufferRange)(struct gl_context *ctx,
559 GLintptr offset, GLsizeiptr length,
560 struct gl_buffer_object *obj);
561
562 GLboolean (*UnmapBuffer)( struct gl_context *ctx,
563 struct gl_buffer_object *obj );
564 /*@}*/
565
566
567 /**
568 * \name Support for multiple T&L engines
569 */
570 /*@{*/
571
572 /**
573 * Set by the driver-supplied T&L engine.
574 *
575 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
576 */
577 GLuint CurrentExecPrimitive;
578
579 /**
580 * Current state of an in-progress compilation.
581 *
582 * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
583 * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
584 */
585 GLuint CurrentSavePrimitive;
586
587
588 #define FLUSH_STORED_VERTICES 0x1
589 #define FLUSH_UPDATE_CURRENT 0x2
590 /**
591 * Set by the driver-supplied T&L engine whenever vertices are buffered
592 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current is not
593 * updated.
594 *
595 * The dd_function_table::FlushVertices call below may be used to resolve
596 * these conditions.
597 */
598 GLuint NeedFlush;
599 GLuint SaveNeedFlush;
600
601
602 /* Called prior to any of the GLvertexformat functions being
603 * called. Paired with Driver.FlushVertices().
604 */
605 void (*BeginVertices)( struct gl_context *ctx );
606
607 /**
608 * If inside glBegin()/glEnd(), it should ASSERT(0). Otherwise, if
609 * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
610 * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
611 * __struct gl_contextRec::Current and gl_light_attrib::Material
612 *
613 * Note that the default T&L engine never clears the
614 * FLUSH_UPDATE_CURRENT bit, even after performing the update.
615 */
616 void (*FlushVertices)( struct gl_context *ctx, GLuint flags );
617 void (*SaveFlushVertices)( struct gl_context *ctx );
618
619 /**
620 * \brief Hook for drivers to prepare for a glBegin/glEnd block
621 *
622 * This hook is called in vbo_exec_Begin() before any action, including
623 * state updates, occurs.
624 */
625 void (*PrepareExecBegin)( struct gl_context *ctx );
626
627 /**
628 * Give the driver the opportunity to hook in its own vtxfmt for
629 * compiling optimized display lists. This is called on each valid
630 * glBegin() during list compilation.
631 */
632 GLboolean (*NotifySaveBegin)( struct gl_context *ctx, GLenum mode );
633
634 /**
635 * Notify driver that the special derived value _NeedEyeCoords has
636 * changed.
637 */
638 void (*LightingSpaceChange)( struct gl_context *ctx );
639
640 /**
641 * Called by glNewList().
642 *
643 * Let the T&L component know what is going on with display lists
644 * in time to make changes to dispatch tables, etc.
645 */
646 void (*NewList)( struct gl_context *ctx, GLuint list, GLenum mode );
647 /**
648 * Called by glEndList().
649 *
650 * \sa dd_function_table::NewList.
651 */
652 void (*EndList)( struct gl_context *ctx );
653
654 /**
655 * Called by glCallList(s).
656 *
657 * Notify the T&L component before and after calling a display list.
658 */
659 void (*BeginCallList)( struct gl_context *ctx,
660 struct gl_display_list *dlist );
661 /**
662 * Called by glEndCallList().
663 *
664 * \sa dd_function_table::BeginCallList.
665 */
666 void (*EndCallList)( struct gl_context *ctx );
667
668 /**@}*/
669
670 /**
671 * \name GL_NV_texture_barrier interface
672 */
673 void (*TextureBarrier)(struct gl_context *ctx);
674 };
675
676
677 /**
678 * Transform/Clip/Lighting interface
679 *
680 * Drivers present a reduced set of the functions possible in
681 * glBegin()/glEnd() objects. Core mesa provides translation stubs for the
682 * remaining functions to map down to these entry points.
683 *
684 * These are the initial values to be installed into dispatch by
685 * mesa. If the T&L driver wants to modify the dispatch table
686 * while installed, it must do so itself. It would be possible for
687 * the vertexformat to install its own initial values for these
688 * functions, but this way there is an obvious list of what is
689 * expected of the driver.
690 *
691 * If the driver wants to hook in entry points other than those
692 * listed, it must restore them to their original values in
693 * the disable() callback, below.
694 */
695 typedef struct {
696 /**
697 * \name Vertex
698 */
699 /*@{*/
700 void (GLAPIENTRYP ArrayElement)( GLint );
701 void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
702 void (GLAPIENTRYP Color3fv)( const GLfloat * );
703 void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
704 void (GLAPIENTRYP Color4fv)( const GLfloat * );
705 void (GLAPIENTRYP EdgeFlag)( GLboolean );
706 void (GLAPIENTRYP EvalCoord1f)( GLfloat );
707 void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
708 void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
709 void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
710 void (GLAPIENTRYP EvalPoint1)( GLint );
711 void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
712 void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
713 void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
714 void (GLAPIENTRYP Indexf)( GLfloat );
715 void (GLAPIENTRYP Indexfv)( const GLfloat * );
716 void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
717 void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
718 void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
719 void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
720 void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
721 void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
722 void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
723 void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
724 void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
725 void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
726 void (GLAPIENTRYP Normal3fv)( const GLfloat * );
727 void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
728 void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
729 void (GLAPIENTRYP TexCoord1f)( GLfloat );
730 void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
731 void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
732 void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
733 void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
734 void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
735 void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
736 void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
737 void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
738 void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
739 void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
740 void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
741 void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
742 void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
743 void (GLAPIENTRYP CallList)( GLuint );
744 void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
745 void (GLAPIENTRYP Begin)( GLenum );
746 void (GLAPIENTRYP End)( void );
747 /* GL_NV_vertex_program */
748 void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
749 void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
750 void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
751 void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
752 void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
753 void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
754 void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
755 void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
756
757 /*@}*/
758
759 void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
760
761 /**
762 * \name Array
763 */
764 /*@{*/
765 void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
766 void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
767 const GLvoid *indices );
768 void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
769 GLuint end, GLsizei count,
770 GLenum type, const GLvoid *indices );
771 /*@}*/
772
773 /**
774 * \name Eval
775 *
776 * If you don't support eval, fallback to the default vertex format
777 * on receiving an eval call and use the pipeline mechanism to
778 * provide partial T&L acceleration.
779 *
780 * Mesa will provide a set of helper functions to do eval within
781 * accelerated vertex formats, eventually...
782 */
783 /*@{*/
784 void (GLAPIENTRYP EvalMesh1)( GLenum mode, GLint i1, GLint i2 );
785 void (GLAPIENTRYP EvalMesh2)( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
786 /*@}*/
787
788 } GLvertexformat;
789
790
791 #endif /* DD_INCLUDED */