3 * Device driver interfaces.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
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:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
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.
34 /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
38 struct gl_buffer_object
;
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
;
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.
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
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.
60 #define MESA_MAP_NOWAIT_BIT 0x0040
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.
70 * Vertex transformation/clipping/lighting is patched into the T&L module.
71 * Rasterization functions are patched into the swrast module.
73 * Note: when new functions are added here, the drivers/common/driverfuncs.c
74 * file should be updated too!!!
76 struct dd_function_table
{
78 * Return a string as needed by glGetString().
79 * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
82 const GLubyte
* (*GetString
)( struct gl_context
*ctx
, GLenum name
);
85 * Notify the driver after Mesa has made some internal state changes.
87 * This is in addition to any state change callbacks Mesa may already have
90 void (*UpdateState
)( struct gl_context
*ctx
, GLbitfield new_state
);
93 * Get the width and height of the named buffer/window.
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.
98 void (*GetBufferSize
)( struct gl_framebuffer
*buffer
,
99 GLuint
*width
, GLuint
*height
);
102 * Resize the given framebuffer to the given size.
103 * XXX OBSOLETE: this function will be removed in the future.
105 void (*ResizeBuffers
)( struct gl_context
*ctx
, struct gl_framebuffer
*fb
,
106 GLuint width
, GLuint height
);
109 * Called whenever an error is generated.
110 * __struct gl_contextRec::ErrorValue contains the error value.
112 void (*Error
)( struct gl_context
*ctx
);
115 * This is called whenever glFinish() is called.
117 void (*Finish
)( struct gl_context
*ctx
);
120 * This is called whenever glFlush() is called.
122 void (*Flush
)( struct gl_context
*ctx
);
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.
129 void (*Clear
)( struct gl_context
*ctx
, GLbitfield buffers
);
132 * Execute glAccum command.
134 void (*Accum
)( struct gl_context
*ctx
, GLenum op
, GLfloat value
);
138 * Execute glRasterPos, updating the ctx->Current.Raster fields
140 void (*RasterPos
)( struct gl_context
*ctx
, const GLfloat v
[4] );
143 * \name Image-related functions
148 * Called by glDrawPixels().
149 * \p unpack describes how to unpack the source image data.
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
);
158 * Called by glReadPixels().
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
,
167 * Called by glCopyPixels().
169 void (*CopyPixels
)( struct gl_context
*ctx
, GLint srcx
, GLint srcy
,
170 GLsizei width
, GLsizei height
,
171 GLint dstx
, GLint dsty
, GLenum type
);
174 * Called by glBitmap().
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
);
184 * \name Texture image functions
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.
194 gl_format (*ChooseTextureFormat
)( struct gl_context
*ctx
, GLint internalFormat
,
195 GLenum srcFormat
, GLenum srcType
);
198 * Called by glTexImage1D(). Simply copy the source texture data into the
199 * destination texture memory. The gl_texture_image fields, etc. will be
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.
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
);
213 * Called by glTexImage2D().
215 * \sa dd_function_table::TexImage1D.
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
);
225 * Called by glTexSubImage1D(). Replace a subset of the target texture
226 * with new texel data.
227 * \sa dd_function_table::TexImage1D.
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
);
237 * Called by glTexSubImage2D().
239 * \sa dd_function_table::TexSubImage1D.
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
);
251 * Called by glGetTexImage().
253 void (*GetTexImage
)( struct gl_context
*ctx
,
254 GLenum format
, GLenum type
, GLvoid
*pixels
,
255 struct gl_texture_image
*texImage
);
258 * Called by glCopyTexSubImage1D() and glCopyTexImage1D().
260 void (*CopyTexSubImage1D
)(struct gl_context
*ctx
,
261 struct gl_texture_image
*texImage
,
263 struct gl_renderbuffer
*rb
,
264 GLint x
, GLint y
, GLsizei width
);
267 * Called by glCopyTexSubImage2D() and glCopyTexImage2D().
269 void (*CopyTexSubImage2D
)(struct gl_context
*ctx
,
270 struct gl_texture_image
*texImage
,
271 GLint xoffset
, GLint yoffset
,
272 struct gl_renderbuffer
*rb
,
274 GLsizei width
, GLsizei height
);
277 * Called by glTexImage[123]D when user specifies a proxy texture
280 * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails.
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
);
291 * \name Compressed texture functions
296 * Called by glCompressedTexImage1D().
297 * The parameters are the same as for glCompressedTexImage1D(), plus a
298 * pointer to the destination texure image.
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
);
306 * Called by glCompressedTexImage2D().
308 * \sa dd_function_table::CompressedTexImage1D.
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
);
317 * Called by glCompressedTexSubImage1D().
319 void (*CompressedTexSubImage1D
)(struct gl_context
*ctx
,
320 struct gl_texture_image
*texImage
,
321 GLint xoffset
, GLsizei width
,
323 GLsizei imageSize
, const GLvoid
*data
);
326 * Called by glCompressedTexSubImage2D().
328 void (*CompressedTexSubImage2D
)(struct gl_context
*ctx
,
329 struct gl_texture_image
*texImage
,
330 GLint xoffset
, GLint yoffset
,
331 GLsizei width
, GLint height
,
333 GLsizei imageSize
, const GLvoid
*data
);
337 * \name Texture object / image functions
342 * Called by glBindTexture().
344 void (*BindTexture
)( struct gl_context
*ctx
, GLenum target
,
345 struct gl_texture_object
*tObj
);
348 * Called to allocate a new texture object. Drivers will usually
349 * allocate/return a subclass of gl_texture_object.
351 struct gl_texture_object
* (*NewTextureObject
)(struct gl_context
*ctx
,
352 GLuint name
, GLenum target
);
354 * Called to delete/free a texture object. Drivers should free the
355 * object and any image data it contains.
357 void (*DeleteTexture
)(struct gl_context
*ctx
,
358 struct gl_texture_object
*texObj
);
360 /** Called to allocate a new texture image object. */
361 struct gl_texture_image
* (*NewTextureImage
)(struct gl_context
*ctx
);
363 /** Called to free a texture image object returned by NewTextureImage() */
364 void (*DeleteTextureImage
)(struct gl_context
*ctx
,
365 struct gl_texture_image
*);
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
);
373 /** Free the memory for a single texture image */
374 void (*FreeTextureImageBuffer
)(struct gl_context
*ctx
,
375 struct gl_texture_image
*texImage
);
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)
388 void (*MapTextureImage
)(struct gl_context
*ctx
,
389 struct gl_texture_image
*texImage
,
391 GLuint x
, GLuint y
, GLuint w
, GLuint h
,
393 GLubyte
**mapOut
, GLint
*rowStrideOut
);
395 void (*UnmapTextureImage
)(struct gl_context
*ctx
,
396 struct gl_texture_image
*texImage
,
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.
403 GLboolean (*AllocTextureStorage
)(struct gl_context
*ctx
,
404 struct gl_texture_object
*texObj
,
405 GLsizei levels
, GLsizei width
,
406 GLsizei height
, GLsizei depth
);
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)
413 void (*MapRenderbuffer
)(struct gl_context
*ctx
,
414 struct gl_renderbuffer
*rb
,
415 GLuint x
, GLuint y
, GLuint w
, GLuint h
,
417 GLubyte
**mapOut
, GLint
*rowStrideOut
);
419 void (*UnmapRenderbuffer
)(struct gl_context
*ctx
,
420 struct gl_renderbuffer
*rb
);
425 * \name State-changing functions.
427 * \note drawing functions are above.
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.
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.
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
);
529 * \name Vertex/pixel buffer object functions
532 void (*BindBuffer
)( struct gl_context
*ctx
, GLenum target
,
533 struct gl_buffer_object
*obj
);
535 struct gl_buffer_object
* (*NewBufferObject
)( struct gl_context
*ctx
, GLuint buffer
,
538 void (*DeleteBuffer
)( struct gl_context
*ctx
, struct gl_buffer_object
*obj
);
540 GLboolean (*BufferData
)( struct gl_context
*ctx
, GLenum target
, GLsizeiptrARB size
,
541 const GLvoid
*data
, GLenum usage
,
542 struct gl_buffer_object
*obj
);
544 void (*BufferSubData
)( struct gl_context
*ctx
, GLintptrARB offset
,
545 GLsizeiptrARB size
, const GLvoid
*data
,
546 struct gl_buffer_object
*obj
);
548 void (*GetBufferSubData
)( struct gl_context
*ctx
,
549 GLintptrARB offset
, GLsizeiptrARB size
,
550 GLvoid
*data
, struct gl_buffer_object
*obj
);
552 /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
554 void * (*MapBufferRange
)( struct gl_context
*ctx
, GLintptr offset
,
555 GLsizeiptr length
, GLbitfield access
,
556 struct gl_buffer_object
*obj
);
558 void (*FlushMappedBufferRange
)(struct gl_context
*ctx
,
559 GLintptr offset
, GLsizeiptr length
,
560 struct gl_buffer_object
*obj
);
562 GLboolean (*UnmapBuffer
)( struct gl_context
*ctx
,
563 struct gl_buffer_object
*obj
);
568 * \name Support for multiple T&L engines
573 * Set by the driver-supplied T&L engine.
575 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
577 GLuint CurrentExecPrimitive
;
580 * Current state of an in-progress compilation.
582 * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END,
583 * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above.
585 GLuint CurrentSavePrimitive
;
588 #define FLUSH_STORED_VERTICES 0x1
589 #define FLUSH_UPDATE_CURRENT 0x2
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
595 * The dd_function_table::FlushVertices call below may be used to resolve
599 GLuint SaveNeedFlush
;
602 /* Called prior to any of the GLvertexformat functions being
603 * called. Paired with Driver.FlushVertices().
605 void (*BeginVertices
)( struct gl_context
*ctx
);
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
613 * Note that the default T&L engine never clears the
614 * FLUSH_UPDATE_CURRENT bit, even after performing the update.
616 void (*FlushVertices
)( struct gl_context
*ctx
, GLuint flags
);
617 void (*SaveFlushVertices
)( struct gl_context
*ctx
);
620 * \brief Hook for drivers to prepare for a glBegin/glEnd block
622 * This hook is called in vbo_exec_Begin() before any action, including
623 * state updates, occurs.
625 void (*PrepareExecBegin
)( struct gl_context
*ctx
);
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.
632 GLboolean (*NotifySaveBegin
)( struct gl_context
*ctx
, GLenum mode
);
635 * Notify driver that the special derived value _NeedEyeCoords has
638 void (*LightingSpaceChange
)( struct gl_context
*ctx
);
641 * Called by glNewList().
643 * Let the T&L component know what is going on with display lists
644 * in time to make changes to dispatch tables, etc.
646 void (*NewList
)( struct gl_context
*ctx
, GLuint list
, GLenum mode
);
648 * Called by glEndList().
650 * \sa dd_function_table::NewList.
652 void (*EndList
)( struct gl_context
*ctx
);
655 * Called by glCallList(s).
657 * Notify the T&L component before and after calling a display list.
659 void (*BeginCallList
)( struct gl_context
*ctx
,
660 struct gl_display_list
*dlist
);
662 * Called by glEndCallList().
664 * \sa dd_function_table::BeginCallList.
666 void (*EndCallList
)( struct gl_context
*ctx
);
671 * \name GL_NV_texture_barrier interface
673 void (*TextureBarrier
)(struct gl_context
*ctx
);
678 * Transform/Clip/Lighting interface
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.
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.
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.
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
);
759 void (GLAPIENTRYP Rectf
)( GLfloat
, GLfloat
, GLfloat
, GLfloat
);
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
);
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.
780 * Mesa will provide a set of helper functions to do eval within
781 * accelerated vertex formats, eventually...
784 void (GLAPIENTRYP EvalMesh1
)( GLenum mode
, GLint i1
, GLint i2
);
785 void (GLAPIENTRYP EvalMesh2
)( GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
);
791 #endif /* DD_INCLUDED */