3 * Device driver interfaces.
7 * Mesa 3-D graphics library
9 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
38 struct gl_bitmap_atlas
;
39 struct gl_buffer_object
;
41 struct gl_display_list
;
42 struct gl_framebuffer
;
44 struct gl_pixelstore_attrib
;
46 struct gl_renderbuffer
;
47 struct gl_renderbuffer_attachment
;
49 struct gl_shader_program
;
50 struct gl_texture_image
;
51 struct gl_texture_object
;
52 struct gl_memory_info
;
53 struct gl_transform_feedback_object
;
54 struct ati_fragment_shader
;
55 struct util_queue_monitoring
;
57 struct _mesa_index_buffer
;
59 /* GL_ARB_vertex_buffer_object */
60 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
61 * NULL) if buffer is unavailable for immediate mapping.
63 * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
64 * would require more book-keeping in the driver than seems necessary
67 * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
68 * want to provoke the driver to throw away the old storage, we will
69 * respect the contents of already referenced data.
71 #define MESA_MAP_NOWAIT_BIT 0x4000
75 * Device driver function table.
76 * Core Mesa uses these function pointers to call into device drivers.
77 * Most of these functions directly correspond to OpenGL state commands.
78 * Core Mesa will call these functions after error checking has been done
79 * so that the drivers don't have to worry about error testing.
81 * Vertex transformation/clipping/lighting is patched into the T&L module.
82 * Rasterization functions are patched into the swrast module.
84 * Note: when new functions are added here, the drivers/common/driverfuncs.c
85 * file should be updated too!!!
87 struct dd_function_table
{
89 * Return a string as needed by glGetString().
90 * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
93 const GLubyte
* (*GetString
)( struct gl_context
*ctx
, GLenum name
);
96 * Notify the driver after Mesa has made some internal state changes.
98 * This is in addition to any state change callbacks Mesa may already have
101 void (*UpdateState
)(struct gl_context
*ctx
);
104 * This is called whenever glFinish() is called.
106 void (*Finish
)( struct gl_context
*ctx
);
109 * This is called whenever glFlush() is called.
111 void (*Flush
)( struct gl_context
*ctx
);
114 * Clear the color/depth/stencil/accum buffer(s).
115 * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
116 * renderbuffers need to be cleared.
118 void (*Clear
)( struct gl_context
*ctx
, GLbitfield buffers
);
121 * Execute glRasterPos, updating the ctx->Current.Raster fields
123 void (*RasterPos
)( struct gl_context
*ctx
, const GLfloat v
[4] );
126 * \name Image-related functions
131 * Called by glDrawPixels().
132 * \p unpack describes how to unpack the source image data.
134 void (*DrawPixels
)( struct gl_context
*ctx
,
135 GLint x
, GLint y
, GLsizei width
, GLsizei height
,
136 GLenum format
, GLenum type
,
137 const struct gl_pixelstore_attrib
*unpack
,
138 const GLvoid
*pixels
);
141 * Called by glReadPixels().
143 void (*ReadPixels
)( struct gl_context
*ctx
,
144 GLint x
, GLint y
, GLsizei width
, GLsizei height
,
145 GLenum format
, GLenum type
,
146 const struct gl_pixelstore_attrib
*unpack
,
150 * Called by glCopyPixels().
152 void (*CopyPixels
)( struct gl_context
*ctx
, GLint srcx
, GLint srcy
,
153 GLsizei width
, GLsizei height
,
154 GLint dstx
, GLint dsty
, GLenum type
);
157 * Called by glBitmap().
159 void (*Bitmap
)( struct gl_context
*ctx
,
160 GLint x
, GLint y
, GLsizei width
, GLsizei height
,
161 const struct gl_pixelstore_attrib
*unpack
,
162 const GLubyte
*bitmap
);
165 * Called by display list code for optimized glCallLists/glBitmap rendering
166 * The driver must support texture rectangles of width 1024 or more.
168 void (*DrawAtlasBitmaps
)(struct gl_context
*ctx
,
169 const struct gl_bitmap_atlas
*atlas
,
170 GLuint count
, const GLubyte
*ids
);
175 * \name Texture image functions
180 * Choose actual hardware texture format given the texture target, the
181 * user-provided source image format and type and the desired internal
182 * format. In some cases, srcFormat and srcType can be GL_NONE.
183 * Note: target may be GL_TEXTURE_CUBE_MAP, but never
184 * GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ].
185 * Called by glTexImage(), etc.
187 mesa_format (*ChooseTextureFormat
)(struct gl_context
*ctx
,
188 GLenum target
, GLint internalFormat
,
189 GLenum srcFormat
, GLenum srcType
);
192 * Queries different driver parameters for a particular target and format.
193 * Since ARB_internalformat_query2 introduced several new query parameters
194 * over ARB_internalformat_query, having one driver hook for each parameter
195 * is no longer feasible. So this is the generic entry-point for calls
196 * to glGetInternalFormativ and glGetInternalFormati64v, after Mesa has
197 * checked errors and default values.
199 * \param ctx GL context
200 * \param target GL target enum
201 * \param internalFormat GL format enum
202 * \param pname GL enum that specifies the info to query.
203 * \param params Buffer to hold the result of the query.
205 void (*QueryInternalFormat
)(struct gl_context
*ctx
,
207 GLenum internalFormat
,
212 * Called by glTexImage[123]D() and glCopyTexImage[12]D()
213 * Allocate texture memory and copy the user's image to the buffer.
214 * The gl_texture_image fields, etc. will be fully initialized.
215 * The parameters are the same as glTexImage3D(), plus:
216 * \param dims 1, 2, or 3 indicating glTexImage1/2/3D()
217 * \param packing describes how to unpack the source data.
218 * \param texImage is the destination texture image.
220 void (*TexImage
)(struct gl_context
*ctx
, GLuint dims
,
221 struct gl_texture_image
*texImage
,
222 GLenum format
, GLenum type
, const GLvoid
*pixels
,
223 const struct gl_pixelstore_attrib
*packing
);
226 * Called by glTexSubImage[123]D().
227 * Replace a subset of the target texture with new texel data.
229 void (*TexSubImage
)(struct gl_context
*ctx
, GLuint dims
,
230 struct gl_texture_image
*texImage
,
231 GLint xoffset
, GLint yoffset
, GLint zoffset
,
232 GLsizei width
, GLsizei height
, GLint depth
,
233 GLenum format
, GLenum type
,
234 const GLvoid
*pixels
,
235 const struct gl_pixelstore_attrib
*packing
);
239 * Called by glGetTexImage(), glGetTextureSubImage().
241 void (*GetTexSubImage
)(struct gl_context
*ctx
,
242 GLint xoffset
, GLint yoffset
, GLint zoffset
,
243 GLsizei width
, GLsizei height
, GLsizei depth
,
244 GLenum format
, GLenum type
, GLvoid
*pixels
,
245 struct gl_texture_image
*texImage
);
248 * Called by glClearTex[Sub]Image
250 * Clears a rectangular region of the image to a given value. The
251 * clearValue argument is either NULL or points to a single texel to use as
252 * the clear value in the same internal format as the texture image. If it
253 * is NULL then the texture should be cleared to zeroes.
255 void (*ClearTexSubImage
)(struct gl_context
*ctx
,
256 struct gl_texture_image
*texImage
,
257 GLint xoffset
, GLint yoffset
, GLint zoffset
,
258 GLsizei width
, GLsizei height
, GLsizei depth
,
259 const GLvoid
*clearValue
);
262 * Called by glCopyTex[Sub]Image[123]D().
264 * This function should copy a rectangular region in the rb to a single
265 * destination slice, specified by @slice. In the case of 1D array
266 * textures (where one GL call can potentially affect multiple destination
267 * slices), core mesa takes care of calling this function multiple times,
268 * once for each scanline to be copied.
270 void (*CopyTexSubImage
)(struct gl_context
*ctx
, GLuint dims
,
271 struct gl_texture_image
*texImage
,
272 GLint xoffset
, GLint yoffset
, GLint slice
,
273 struct gl_renderbuffer
*rb
,
275 GLsizei width
, GLsizei height
);
277 * Called by glCopyImageSubData().
279 * This function should copy one 2-D slice from src_teximage or
280 * src_renderbuffer to dst_teximage or dst_renderbuffer. Either the
281 * teximage or renderbuffer pointer will be non-null to indicate which
282 * is the real src/dst.
284 * If one of the textures is 3-D or is a 1-D or 2-D array
285 * texture, this function will be called multiple times: once for each
286 * slice. If one of the textures is a cube map, this function will be
287 * called once for each face to be copied.
289 void (*CopyImageSubData
)(struct gl_context
*ctx
,
290 struct gl_texture_image
*src_teximage
,
291 struct gl_renderbuffer
*src_renderbuffer
,
292 int src_x
, int src_y
, int src_z
,
293 struct gl_texture_image
*dst_teximage
,
294 struct gl_renderbuffer
*dst_renderbuffer
,
295 int dst_x
, int dst_y
, int dst_z
,
296 int src_width
, int src_height
);
299 * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
300 * Note that if the texture is a cube map, the <target> parameter will
301 * indicate which cube face to generate (GL_POSITIVE/NEGATIVE_X/Y/Z).
302 * texObj->BaseLevel is the level from which to generate the remaining
305 void (*GenerateMipmap
)(struct gl_context
*ctx
, GLenum target
,
306 struct gl_texture_object
*texObj
);
309 * Called by glTexImage, glCompressedTexImage, glCopyTexImage
310 * and glTexStorage to check if the dimensions of the texture image
312 * \param target any GL_PROXY_TEXTURE_x target
313 * \return GL_TRUE if the image is OK, GL_FALSE if too large
315 GLboolean (*TestProxyTexImage
)(struct gl_context
*ctx
, GLenum target
,
316 GLuint numLevels
, GLint level
,
317 mesa_format format
, GLuint numSamples
,
318 GLint width
, GLint height
,
324 * \name Compressed texture functions
329 * Called by glCompressedTexImage[123]D().
331 void (*CompressedTexImage
)(struct gl_context
*ctx
, GLuint dims
,
332 struct gl_texture_image
*texImage
,
333 GLsizei imageSize
, const GLvoid
*data
);
336 * Called by glCompressedTexSubImage[123]D().
338 void (*CompressedTexSubImage
)(struct gl_context
*ctx
, GLuint dims
,
339 struct gl_texture_image
*texImage
,
340 GLint xoffset
, GLint yoffset
, GLint zoffset
,
341 GLsizei width
, GLsizei height
, GLsizei depth
,
343 GLsizei imageSize
, const GLvoid
*data
);
347 * \name Texture object / image functions
352 * Called by glBindTexture() and glBindTextures().
354 void (*BindTexture
)( struct gl_context
*ctx
, GLuint texUnit
,
355 GLenum target
, struct gl_texture_object
*tObj
);
358 * Called to allocate a new texture object. Drivers will usually
359 * allocate/return a subclass of gl_texture_object.
361 struct gl_texture_object
* (*NewTextureObject
)(struct gl_context
*ctx
,
362 GLuint name
, GLenum target
);
364 * Called to delete/free a texture object. Drivers should free the
365 * object and any image data it contains.
367 void (*DeleteTexture
)(struct gl_context
*ctx
,
368 struct gl_texture_object
*texObj
);
370 /** Called to allocate a new texture image object. */
371 struct gl_texture_image
* (*NewTextureImage
)(struct gl_context
*ctx
);
373 /** Called to free a texture image object returned by NewTextureImage() */
374 void (*DeleteTextureImage
)(struct gl_context
*ctx
,
375 struct gl_texture_image
*);
377 /** Called to allocate memory for a single texture image */
378 GLboolean (*AllocTextureImageBuffer
)(struct gl_context
*ctx
,
379 struct gl_texture_image
*texImage
);
381 /** Free the memory for a single texture image */
382 void (*FreeTextureImageBuffer
)(struct gl_context
*ctx
,
383 struct gl_texture_image
*texImage
);
385 /** Map a slice of a texture image into user space.
386 * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice
387 * indicates the 1D array index.
388 * \param texImage the texture image
389 * \param slice the 3D image slice or array texture slice
390 * \param x, y, w, h region of interest
391 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
392 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
393 * \param mapOut returns start of mapping of region of interest
394 * \param rowStrideOut returns row stride (in bytes). In the case of a
395 * compressed texture, this is the byte stride between one row of blocks
398 void (*MapTextureImage
)(struct gl_context
*ctx
,
399 struct gl_texture_image
*texImage
,
401 GLuint x
, GLuint y
, GLuint w
, GLuint h
,
403 GLubyte
**mapOut
, GLint
*rowStrideOut
);
405 void (*UnmapTextureImage
)(struct gl_context
*ctx
,
406 struct gl_texture_image
*texImage
,
409 /** For GL_ARB_texture_storage. Allocate memory for whole mipmap stack.
410 * All the gl_texture_images in the texture object will have their
411 * dimensions, format, etc. initialized already.
413 GLboolean (*AllocTextureStorage
)(struct gl_context
*ctx
,
414 struct gl_texture_object
*texObj
,
415 GLsizei levels
, GLsizei width
,
416 GLsizei height
, GLsizei depth
);
418 /** Called as part of glTextureView to add views to origTexObj */
419 GLboolean (*TextureView
)(struct gl_context
*ctx
,
420 struct gl_texture_object
*texObj
,
421 struct gl_texture_object
*origTexObj
);
424 * Map a renderbuffer into user space.
425 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
426 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
428 void (*MapRenderbuffer
)(struct gl_context
*ctx
,
429 struct gl_renderbuffer
*rb
,
430 GLuint x
, GLuint y
, GLuint w
, GLuint h
,
432 GLubyte
**mapOut
, GLint
*rowStrideOut
,
435 void (*UnmapRenderbuffer
)(struct gl_context
*ctx
,
436 struct gl_renderbuffer
*rb
);
439 * Optional driver entrypoint that binds a non-texture renderbuffer's
440 * contents to a texture image.
442 GLboolean (*BindRenderbufferTexImage
)(struct gl_context
*ctx
,
443 struct gl_renderbuffer
*rb
,
444 struct gl_texture_image
*texImage
);
449 * \name Vertex/fragment program functions
452 /** Allocate a new program */
453 struct gl_program
* (*NewProgram
)(struct gl_context
*ctx
, GLenum target
,
454 GLuint id
, bool is_arb_asm
);
455 /** Delete a program */
456 void (*DeleteProgram
)(struct gl_context
*ctx
, struct gl_program
*prog
);
458 * Allocate a program to associate with the new ATI fragment shader (optional)
460 struct gl_program
* (*NewATIfs
)(struct gl_context
*ctx
,
461 struct ati_fragment_shader
*curProg
);
463 * Notify driver that a program string (and GPU code) has been specified
464 * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is
465 * supported by the driver.
467 GLboolean (*ProgramStringNotify
)(struct gl_context
*ctx
, GLenum target
,
468 struct gl_program
*prog
);
471 * Notify driver that the sampler uniforms for the current program have
472 * changed. On some drivers, this may require shader recompiles.
474 void (*SamplerUniformChange
)(struct gl_context
*ctx
, GLenum target
,
475 struct gl_program
*prog
);
477 /** Query if program can be loaded onto hardware */
478 GLboolean (*IsProgramNative
)(struct gl_context
*ctx
, GLenum target
,
479 struct gl_program
*prog
);
484 * \name GLSL shader/program functions.
488 * Called when a shader program is linked.
490 * This gives drivers an opportunity to clone the IR and make their
491 * own transformations on it for the purposes of code generation.
493 GLboolean (*LinkShader
)(struct gl_context
*ctx
,
494 struct gl_shader_program
*shader
);
499 * \name Draw functions.
503 * For indirect array drawing:
509 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise
510 * } DrawArraysIndirectCommand;
512 * For indirect indexed drawing:
519 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise
520 * } DrawElementsIndirectCommand;
524 * Draw a number of primitives.
525 * \param prims array [nr_prims] describing what to draw (prim type,
526 * vertex count, first index, instance count, etc).
527 * \param ib index buffer for indexed drawing, NULL for array drawing
528 * \param index_bounds_valid are min_index and max_index valid?
529 * \param min_index lowest vertex index used
530 * \param max_index highest vertex index used
531 * \param num_instances instance count from ARB_draw_instanced
532 * \param base_instance base instance from ARB_base_instance
533 * \param tfb_vertcount if non-null, indicates which transform feedback
534 * object has the vertex count.
535 * \param tfb_stream If called via DrawTransformFeedbackStream, specifies
536 * the vertex stream buffer from which to get the vertex
538 * \param indirect If any prims are indirect, this specifies the buffer
539 * to find the "DrawArrays/ElementsIndirectCommand" data.
540 * This may be deprecated in the future
542 void (*Draw
)(struct gl_context
*ctx
,
543 const struct _mesa_prim
*prims
, GLuint nr_prims
,
544 const struct _mesa_index_buffer
*ib
,
545 GLboolean index_bounds_valid
,
546 GLuint min_index
, GLuint max_index
,
547 GLuint num_instances
, GLuint base_instance
,
548 struct gl_transform_feedback_object
*tfb_vertcount
,
549 unsigned tfb_stream
);
553 * Draw a primitive, getting the vertex count, instance count, start
554 * vertex, etc. from a buffer object.
555 * \param mode GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP, etc.
556 * \param indirect_data buffer to get "DrawArrays/ElementsIndirectCommand"
558 * \param indirect_offset offset of first primitive in indrect_data buffer
559 * \param draw_count number of primitives to draw
560 * \param stride stride, in bytes, between
561 * "DrawArrays/ElementsIndirectCommand" objects
562 * \param indirect_draw_count_buffer if non-NULL specifies a buffer to get
563 * the real draw_count value. Used for
564 * GL_ARB_indirect_parameters.
565 * \param indirect_draw_count_offset offset to the draw_count value in
566 * indirect_draw_count_buffer
567 * \param ib index buffer for indexed drawing, NULL otherwise.
569 void (*DrawIndirect
)(struct gl_context
*ctx
, GLuint mode
,
570 struct gl_buffer_object
*indirect_data
,
571 GLsizeiptr indirect_offset
, unsigned draw_count
,
573 struct gl_buffer_object
*indirect_draw_count_buffer
,
574 GLsizeiptr indirect_draw_count_offset
,
575 const struct _mesa_index_buffer
*ib
);
580 * \name State-changing functions.
582 * \note drawing functions are above.
584 * These functions are called by their corresponding OpenGL API functions.
585 * They are \e also called by the gl_PopAttrib() function!!!
586 * May add more functions like these to the device driver in the future.
589 /** Specify the alpha test function */
590 void (*AlphaFunc
)(struct gl_context
*ctx
, GLenum func
, GLfloat ref
);
591 /** Set the blend color */
592 void (*BlendColor
)(struct gl_context
*ctx
, const GLfloat color
[4]);
593 /** Set the blend equation */
594 void (*BlendEquationSeparate
)(struct gl_context
*ctx
,
595 GLenum modeRGB
, GLenum modeA
);
596 /** Specify pixel arithmetic */
597 void (*BlendFuncSeparate
)(struct gl_context
*ctx
,
598 GLenum sfactorRGB
, GLenum dfactorRGB
,
599 GLenum sfactorA
, GLenum dfactorA
);
600 /** Specify a plane against which all geometry is clipped */
601 void (*ClipPlane
)(struct gl_context
*ctx
, GLenum plane
, const GLfloat
*eq
);
602 /** Enable and disable writing of frame buffer color components */
603 void (*ColorMask
)(struct gl_context
*ctx
, GLboolean rmask
, GLboolean gmask
,
604 GLboolean bmask
, GLboolean amask
);
605 /** Cause a material color to track the current color */
606 void (*ColorMaterial
)(struct gl_context
*ctx
, GLenum face
, GLenum mode
);
607 /** Specify whether front- or back-facing facets can be culled */
608 void (*CullFace
)(struct gl_context
*ctx
, GLenum mode
);
609 /** Define front- and back-facing polygons */
610 void (*FrontFace
)(struct gl_context
*ctx
, GLenum mode
);
611 /** Specify the value used for depth buffer comparisons */
612 void (*DepthFunc
)(struct gl_context
*ctx
, GLenum func
);
613 /** Enable or disable writing into the depth buffer */
614 void (*DepthMask
)(struct gl_context
*ctx
, GLboolean flag
);
615 /** Specify mapping of depth values from NDC to window coordinates */
616 void (*DepthRange
)(struct gl_context
*ctx
);
617 /** Specify the current buffer for writing */
618 void (*DrawBuffer
)(struct gl_context
*ctx
);
619 /** Used to allocated any buffers with on-demand creation */
620 void (*DrawBufferAllocate
)(struct gl_context
*ctx
);
621 /** Enable or disable server-side gl capabilities */
622 void (*Enable
)(struct gl_context
*ctx
, GLenum cap
, GLboolean state
);
623 /** Specify fog parameters */
624 void (*Fogfv
)(struct gl_context
*ctx
, GLenum pname
, const GLfloat
*params
);
625 /** Set light source parameters.
626 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
627 * been transformed to eye-space.
629 void (*Lightfv
)(struct gl_context
*ctx
, GLenum light
,
630 GLenum pname
, const GLfloat
*params
);
631 /** Set the lighting model parameters */
632 void (*LightModelfv
)(struct gl_context
*ctx
, GLenum pname
,
633 const GLfloat
*params
);
634 /** Specify the line stipple pattern */
635 void (*LineStipple
)(struct gl_context
*ctx
, GLint factor
, GLushort pattern
);
636 /** Specify the width of rasterized lines */
637 void (*LineWidth
)(struct gl_context
*ctx
, GLfloat width
);
638 /** Specify a logical pixel operation for color index rendering */
639 void (*LogicOpcode
)(struct gl_context
*ctx
, enum gl_logicop_mode opcode
);
640 void (*PointParameterfv
)(struct gl_context
*ctx
, GLenum pname
,
641 const GLfloat
*params
);
642 /** Specify the diameter of rasterized points */
643 void (*PointSize
)(struct gl_context
*ctx
, GLfloat size
);
644 /** Select a polygon rasterization mode */
645 void (*PolygonMode
)(struct gl_context
*ctx
, GLenum face
, GLenum mode
);
646 /** Set the scale and units used to calculate depth values */
647 void (*PolygonOffset
)(struct gl_context
*ctx
, GLfloat factor
, GLfloat units
, GLfloat clamp
);
648 /** Set the polygon stippling pattern */
649 void (*PolygonStipple
)(struct gl_context
*ctx
, const GLubyte
*mask
);
650 /* Specifies the current buffer for reading */
651 void (*ReadBuffer
)( struct gl_context
*ctx
, GLenum buffer
);
652 /** Set rasterization mode */
653 void (*RenderMode
)(struct gl_context
*ctx
, GLenum mode
);
654 /** Define the scissor box */
655 void (*Scissor
)(struct gl_context
*ctx
);
656 /** Select flat or smooth shading */
657 void (*ShadeModel
)(struct gl_context
*ctx
, GLenum mode
);
658 /** OpenGL 2.0 two-sided StencilFunc */
659 void (*StencilFuncSeparate
)(struct gl_context
*ctx
, GLenum face
, GLenum func
,
660 GLint ref
, GLuint mask
);
661 /** OpenGL 2.0 two-sided StencilMask */
662 void (*StencilMaskSeparate
)(struct gl_context
*ctx
, GLenum face
, GLuint mask
);
663 /** OpenGL 2.0 two-sided StencilOp */
664 void (*StencilOpSeparate
)(struct gl_context
*ctx
, GLenum face
, GLenum fail
,
665 GLenum zfail
, GLenum zpass
);
666 /** Control the generation of texture coordinates */
667 void (*TexGen
)(struct gl_context
*ctx
, GLenum coord
, GLenum pname
,
668 const GLfloat
*params
);
669 /** Set texture environment parameters */
670 void (*TexEnv
)(struct gl_context
*ctx
, GLenum target
, GLenum pname
,
671 const GLfloat
*param
);
672 /** Set texture parameter (callee gets param value from the texObj) */
673 void (*TexParameter
)(struct gl_context
*ctx
,
674 struct gl_texture_object
*texObj
, GLenum pname
);
675 /** Set the viewport */
676 void (*Viewport
)(struct gl_context
*ctx
);
681 * \name Vertex/pixel buffer object functions
684 struct gl_buffer_object
* (*NewBufferObject
)(struct gl_context
*ctx
,
687 void (*DeleteBuffer
)( struct gl_context
*ctx
, struct gl_buffer_object
*obj
);
689 GLboolean (*BufferData
)(struct gl_context
*ctx
, GLenum target
,
690 GLsizeiptrARB size
, const GLvoid
*data
, GLenum usage
,
691 GLenum storageFlags
, struct gl_buffer_object
*obj
);
693 void (*BufferSubData
)( struct gl_context
*ctx
, GLintptrARB offset
,
694 GLsizeiptrARB size
, const GLvoid
*data
,
695 struct gl_buffer_object
*obj
);
697 void (*GetBufferSubData
)( struct gl_context
*ctx
,
698 GLintptrARB offset
, GLsizeiptrARB size
,
699 GLvoid
*data
, struct gl_buffer_object
*obj
);
701 void (*ClearBufferSubData
)( struct gl_context
*ctx
,
702 GLintptr offset
, GLsizeiptr size
,
703 const GLvoid
*clearValue
,
704 GLsizeiptr clearValueSize
,
705 struct gl_buffer_object
*obj
);
707 void (*CopyBufferSubData
)( struct gl_context
*ctx
,
708 struct gl_buffer_object
*src
,
709 struct gl_buffer_object
*dst
,
710 GLintptr readOffset
, GLintptr writeOffset
,
713 void (*InvalidateBufferSubData
)( struct gl_context
*ctx
,
714 struct gl_buffer_object
*obj
,
718 /* Returns pointer to the start of the mapped range.
719 * May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
721 void * (*MapBufferRange
)( struct gl_context
*ctx
, GLintptr offset
,
722 GLsizeiptr length
, GLbitfield access
,
723 struct gl_buffer_object
*obj
,
724 gl_map_buffer_index index
);
726 void (*FlushMappedBufferRange
)(struct gl_context
*ctx
,
727 GLintptr offset
, GLsizeiptr length
,
728 struct gl_buffer_object
*obj
,
729 gl_map_buffer_index index
);
731 GLboolean (*UnmapBuffer
)( struct gl_context
*ctx
,
732 struct gl_buffer_object
*obj
,
733 gl_map_buffer_index index
);
737 * \name Functions for GL_APPLE_object_purgeable
740 /* variations on ObjectPurgeable */
741 GLenum (*BufferObjectPurgeable
)(struct gl_context
*ctx
,
742 struct gl_buffer_object
*obj
, GLenum option
);
743 GLenum (*RenderObjectPurgeable
)(struct gl_context
*ctx
,
744 struct gl_renderbuffer
*obj
, GLenum option
);
745 GLenum (*TextureObjectPurgeable
)(struct gl_context
*ctx
,
746 struct gl_texture_object
*obj
,
749 /* variations on ObjectUnpurgeable */
750 GLenum (*BufferObjectUnpurgeable
)(struct gl_context
*ctx
,
751 struct gl_buffer_object
*obj
,
753 GLenum (*RenderObjectUnpurgeable
)(struct gl_context
*ctx
,
754 struct gl_renderbuffer
*obj
,
756 GLenum (*TextureObjectUnpurgeable
)(struct gl_context
*ctx
,
757 struct gl_texture_object
*obj
,
762 * \name Functions for GL_EXT_framebuffer_{object,blit,discard}.
765 struct gl_framebuffer
* (*NewFramebuffer
)(struct gl_context
*ctx
,
767 struct gl_renderbuffer
* (*NewRenderbuffer
)(struct gl_context
*ctx
,
769 void (*BindFramebuffer
)(struct gl_context
*ctx
, GLenum target
,
770 struct gl_framebuffer
*drawFb
,
771 struct gl_framebuffer
*readFb
);
772 void (*FramebufferRenderbuffer
)(struct gl_context
*ctx
,
773 struct gl_framebuffer
*fb
,
775 struct gl_renderbuffer
*rb
);
776 void (*RenderTexture
)(struct gl_context
*ctx
,
777 struct gl_framebuffer
*fb
,
778 struct gl_renderbuffer_attachment
*att
);
779 void (*FinishRenderTexture
)(struct gl_context
*ctx
,
780 struct gl_renderbuffer
*rb
);
781 void (*ValidateFramebuffer
)(struct gl_context
*ctx
,
782 struct gl_framebuffer
*fb
);
784 void (*BlitFramebuffer
)(struct gl_context
*ctx
,
785 struct gl_framebuffer
*readFb
,
786 struct gl_framebuffer
*drawFb
,
787 GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
788 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
789 GLbitfield mask
, GLenum filter
);
790 void (*DiscardFramebuffer
)(struct gl_context
*ctx
, struct gl_framebuffer
*fb
,
791 struct gl_renderbuffer_attachment
*att
);
794 * \name Functions for GL_ARB_sample_locations
796 void (*GetProgrammableSampleCaps
)(struct gl_context
*ctx
,
797 const struct gl_framebuffer
*fb
,
798 GLuint
*bits
, GLuint
*width
, GLuint
*height
);
799 void (*EvaluateDepthValues
)(struct gl_context
*ctx
);
802 * \name Query objects
805 struct gl_query_object
* (*NewQueryObject
)(struct gl_context
*ctx
, GLuint id
);
806 void (*DeleteQuery
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
807 void (*BeginQuery
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
808 void (*QueryCounter
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
809 void (*EndQuery
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
810 void (*CheckQuery
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
811 void (*WaitQuery
)(struct gl_context
*ctx
, struct gl_query_object
*q
);
813 * \pname the value requested to be written (GL_QUERY_RESULT, etc)
814 * \ptype the type of the value requested to be written:
815 * GL_UNSIGNED_INT, GL_UNSIGNED_INT64_ARB,
816 * GL_INT, GL_INT64_ARB
818 void (*StoreQueryResult
)(struct gl_context
*ctx
, struct gl_query_object
*q
,
819 struct gl_buffer_object
*buf
, intptr_t offset
,
820 GLenum pname
, GLenum ptype
);
824 * \name Performance monitors
827 void (*InitPerfMonitorGroups
)(struct gl_context
*ctx
);
828 struct gl_perf_monitor_object
* (*NewPerfMonitor
)(struct gl_context
*ctx
);
829 void (*DeletePerfMonitor
)(struct gl_context
*ctx
,
830 struct gl_perf_monitor_object
*m
);
831 GLboolean (*BeginPerfMonitor
)(struct gl_context
*ctx
,
832 struct gl_perf_monitor_object
*m
);
834 /** Stop an active performance monitor, discarding results. */
835 void (*ResetPerfMonitor
)(struct gl_context
*ctx
,
836 struct gl_perf_monitor_object
*m
);
837 void (*EndPerfMonitor
)(struct gl_context
*ctx
,
838 struct gl_perf_monitor_object
*m
);
839 GLboolean (*IsPerfMonitorResultAvailable
)(struct gl_context
*ctx
,
840 struct gl_perf_monitor_object
*m
);
841 void (*GetPerfMonitorResult
)(struct gl_context
*ctx
,
842 struct gl_perf_monitor_object
*m
,
845 GLint
*bytesWritten
);
849 * \name Performance Query objects
852 unsigned (*InitPerfQueryInfo
)(struct gl_context
*ctx
);
853 void (*GetPerfQueryInfo
)(struct gl_context
*ctx
,
859 void (*GetPerfCounterInfo
)(struct gl_context
*ctx
,
861 unsigned counterIndex
,
867 GLuint
*data_type_enum
,
869 struct gl_perf_query_object
* (*NewPerfQueryObject
)(struct gl_context
*ctx
,
870 unsigned queryIndex
);
871 void (*DeletePerfQuery
)(struct gl_context
*ctx
,
872 struct gl_perf_query_object
*obj
);
873 bool (*BeginPerfQuery
)(struct gl_context
*ctx
,
874 struct gl_perf_query_object
*obj
);
875 void (*EndPerfQuery
)(struct gl_context
*ctx
,
876 struct gl_perf_query_object
*obj
);
877 void (*WaitPerfQuery
)(struct gl_context
*ctx
,
878 struct gl_perf_query_object
*obj
);
879 bool (*IsPerfQueryReady
)(struct gl_context
*ctx
,
880 struct gl_perf_query_object
*obj
);
881 void (*GetPerfQueryData
)(struct gl_context
*ctx
,
882 struct gl_perf_query_object
*obj
,
885 GLuint
*bytesWritten
);
890 * \name GREMEDY debug/marker functions
893 void (*EmitStringMarker
)(struct gl_context
*ctx
, const GLchar
*string
, GLsizei len
);
897 * \name Support for multiple T&L engines
902 * Set by the driver-supplied T&L engine.
904 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
906 GLuint CurrentExecPrimitive
;
909 * Current glBegin state of an in-progress compilation. May be
910 * GL_POINTS, GL_TRIANGLE_STRIP, etc. or PRIM_OUTSIDE_BEGIN_END
913 GLuint CurrentSavePrimitive
;
916 #define FLUSH_STORED_VERTICES 0x1
917 #define FLUSH_UPDATE_CURRENT 0x2
919 * Set by the driver-supplied T&L engine whenever vertices are buffered
920 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current
921 * is not updated. A bitmask of the FLUSH_x values above.
923 * The dd_function_table::FlushVertices call below may be used to resolve
926 GLbitfield NeedFlush
;
928 /** Need to call vbo_save_SaveFlushVertices() upon state change? */
929 GLboolean SaveNeedFlush
;
932 * Notify driver that the special derived value _NeedEyeCoords has
935 void (*LightingSpaceChange
)( struct gl_context
*ctx
);
940 * \name GL_ARB_sync interfaces
943 struct gl_sync_object
* (*NewSyncObject
)(struct gl_context
*);
944 void (*FenceSync
)(struct gl_context
*, struct gl_sync_object
*,
946 void (*DeleteSyncObject
)(struct gl_context
*, struct gl_sync_object
*);
947 void (*CheckSync
)(struct gl_context
*, struct gl_sync_object
*);
948 void (*ClientWaitSync
)(struct gl_context
*, struct gl_sync_object
*,
949 GLbitfield
, GLuint64
);
950 void (*ServerWaitSync
)(struct gl_context
*, struct gl_sync_object
*,
951 GLbitfield
, GLuint64
);
954 /** GL_NV_conditional_render */
955 void (*BeginConditionalRender
)(struct gl_context
*ctx
,
956 struct gl_query_object
*q
,
958 void (*EndConditionalRender
)(struct gl_context
*ctx
,
959 struct gl_query_object
*q
);
962 * \name GL_OES_draw_texture interface
965 void (*DrawTex
)(struct gl_context
*ctx
, GLfloat x
, GLfloat y
, GLfloat z
,
966 GLfloat width
, GLfloat height
);
970 * \name GL_OES_EGL_image interface
972 void (*EGLImageTargetTexture2D
)(struct gl_context
*ctx
, GLenum target
,
973 struct gl_texture_object
*texObj
,
974 struct gl_texture_image
*texImage
,
975 GLeglImageOES image_handle
);
976 void (*EGLImageTargetRenderbufferStorage
)(struct gl_context
*ctx
,
977 struct gl_renderbuffer
*rb
,
981 * \name GL_EXT_EGL_image_storage interface
983 void (*EGLImageTargetTexStorage
)(struct gl_context
*ctx
, GLenum target
,
984 struct gl_texture_object
*texObj
,
985 struct gl_texture_image
*texImage
,
986 GLeglImageOES image_handle
);
988 * \name GL_EXT_transform_feedback interface
990 struct gl_transform_feedback_object
*
991 (*NewTransformFeedback
)(struct gl_context
*ctx
, GLuint name
);
992 void (*DeleteTransformFeedback
)(struct gl_context
*ctx
,
993 struct gl_transform_feedback_object
*obj
);
994 void (*BeginTransformFeedback
)(struct gl_context
*ctx
, GLenum mode
,
995 struct gl_transform_feedback_object
*obj
);
996 void (*EndTransformFeedback
)(struct gl_context
*ctx
,
997 struct gl_transform_feedback_object
*obj
);
998 void (*PauseTransformFeedback
)(struct gl_context
*ctx
,
999 struct gl_transform_feedback_object
*obj
);
1000 void (*ResumeTransformFeedback
)(struct gl_context
*ctx
,
1001 struct gl_transform_feedback_object
*obj
);
1004 * Return the number of vertices written to a stream during the last
1005 * Begin/EndTransformFeedback block.
1007 GLsizei (*GetTransformFeedbackVertexCount
)(struct gl_context
*ctx
,
1008 struct gl_transform_feedback_object
*obj
,
1012 * \name GL_NV_texture_barrier interface
1014 void (*TextureBarrier
)(struct gl_context
*ctx
);
1017 * \name GL_ARB_sampler_objects
1019 struct gl_sampler_object
* (*NewSamplerObject
)(struct gl_context
*ctx
,
1023 * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query.
1024 * This should be equivalent to glGetInteger64v(GL_TIMESTAMP);
1026 uint64_t (*GetTimestamp
)(struct gl_context
*ctx
);
1029 * \name GL_ARB_texture_multisample
1031 void (*GetSamplePosition
)(struct gl_context
*ctx
,
1032 struct gl_framebuffer
*fb
,
1037 * \name NV_vdpau_interop interface
1039 void (*VDPAUMapSurface
)(struct gl_context
*ctx
, GLenum target
,
1040 GLenum access
, GLboolean output
,
1041 struct gl_texture_object
*texObj
,
1042 struct gl_texture_image
*texImage
,
1043 const GLvoid
*vdpSurface
, GLuint index
);
1044 void (*VDPAUUnmapSurface
)(struct gl_context
*ctx
, GLenum target
,
1045 GLenum access
, GLboolean output
,
1046 struct gl_texture_object
*texObj
,
1047 struct gl_texture_image
*texImage
,
1048 const GLvoid
*vdpSurface
, GLuint index
);
1051 * Query reset status for GL_ARB_robustness
1053 * Per \c glGetGraphicsResetStatusARB, this function should return a
1054 * non-zero value once after a reset. If a reset is non-atomic, the
1055 * non-zero status should be returned for the duration of the reset.
1057 GLenum (*GetGraphicsResetStatus
)(struct gl_context
*ctx
);
1060 * \name GL_ARB_shader_image_load_store interface.
1063 void (*MemoryBarrier
)(struct gl_context
*ctx
, GLbitfield barriers
);
1067 * GL_EXT_shader_framebuffer_fetch_non_coherent rendering barrier.
1069 * On return from this function any framebuffer contents written by
1070 * previous draw commands are guaranteed to be visible from subsequent
1071 * fragment shader invocations using the
1072 * EXT_shader_framebuffer_fetch_non_coherent interface.
1075 void (*FramebufferFetchBarrier
)(struct gl_context
*ctx
);
1079 * \name GL_ARB_compute_shader interface
1082 void (*DispatchCompute
)(struct gl_context
*ctx
, const GLuint
*num_groups
);
1083 void (*DispatchComputeIndirect
)(struct gl_context
*ctx
, GLintptr indirect
);
1087 * \name GL_ARB_compute_variable_group_size interface
1090 void (*DispatchComputeGroupSize
)(struct gl_context
*ctx
,
1091 const GLuint
*num_groups
,
1092 const GLuint
*group_size
);
1096 * Query information about memory. Device memory is e.g. VRAM. Staging
1097 * memory is e.g. GART. All sizes are in kilobytes.
1099 void (*QueryMemoryInfo
)(struct gl_context
*ctx
,
1100 struct gl_memory_info
*info
);
1103 * Indicate that this thread is being used by Mesa as a background drawing
1104 * thread for the given GL context.
1106 * If this function is called more than once from any given thread, each
1107 * subsequent call overrides the context that was passed in the previous
1108 * call. Mesa takes advantage of this to re-use a background thread to
1109 * perform drawing on behalf of multiple contexts.
1111 * Mesa may sometimes call this function from a non-background thread
1112 * (i.e. a thread that has already been bound to a context using
1113 * __DriverAPIRec::MakeCurrent()); when this happens, ctx will be equal to
1114 * the context that is bound to this thread.
1116 * Mesa will only call this function if GL multithreading is enabled.
1118 void (*SetBackgroundContext
)(struct gl_context
*ctx
,
1119 struct util_queue_monitoring
*queue_info
);
1122 * \name GL_ARB_sparse_buffer interface
1125 void (*BufferPageCommitment
)(struct gl_context
*ctx
,
1126 struct gl_buffer_object
*bufferObj
,
1127 GLintptr offset
, GLsizeiptr size
,
1132 * \name GL_ARB_bindless_texture interface
1135 GLuint64 (*NewTextureHandle
)(struct gl_context
*ctx
,
1136 struct gl_texture_object
*texObj
,
1137 struct gl_sampler_object
*sampObj
);
1138 void (*DeleteTextureHandle
)(struct gl_context
*ctx
, GLuint64 handle
);
1139 void (*MakeTextureHandleResident
)(struct gl_context
*ctx
, GLuint64 handle
,
1141 GLuint64 (*NewImageHandle
)(struct gl_context
*ctx
,
1142 struct gl_image_unit
*imgObj
);
1143 void (*DeleteImageHandle
)(struct gl_context
*ctx
, GLuint64 handle
);
1144 void (*MakeImageHandleResident
)(struct gl_context
*ctx
, GLuint64 handle
,
1145 GLenum access
, bool resident
);
1150 * \name GL_EXT_external_objects interface
1154 * Called to allocate a new memory object. Drivers will usually
1155 * allocate/return a subclass of gl_memory_object.
1157 struct gl_memory_object
* (*NewMemoryObject
)(struct gl_context
*ctx
,
1160 * Called to delete/free a memory object. Drivers should free the
1161 * object and any image data it contains.
1163 void (*DeleteMemoryObject
)(struct gl_context
*ctx
,
1164 struct gl_memory_object
*memObj
);
1167 * Set the given memory object as the texture's storage.
1169 GLboolean (*SetTextureStorageForMemoryObject
)(struct gl_context
*ctx
,
1170 struct gl_texture_object
*tex_obj
,
1171 struct gl_memory_object
*mem_obj
,
1172 GLsizei levels
, GLsizei width
,
1173 GLsizei height
, GLsizei depth
,
1177 * Use a memory object as the backing data for a buffer object
1179 GLboolean (*BufferDataMem
)(struct gl_context
*ctx
,
1182 struct gl_memory_object
*memObj
,
1185 struct gl_buffer_object
*bufObj
);
1188 * Fill uuid with an unique identifier for this driver
1190 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory
1192 void (*GetDriverUuid
)(struct gl_context
*ctx
, char *uuid
);
1195 * Fill uuid with an unique identifier for the device associated
1198 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory
1200 void (*GetDeviceUuid
)(struct gl_context
*ctx
, char *uuid
);
1205 * \name GL_EXT_external_objects_fd interface
1209 * Called to import a memory object. The caller relinquishes ownership
1210 * of fd after the call returns.
1212 * Accessing fd after ImportMemoryObjectFd returns results in undefined
1213 * behaviour. This is consistent with EXT_external_object_fd.
1215 void (*ImportMemoryObjectFd
)(struct gl_context
*ctx
,
1216 struct gl_memory_object
*memObj
,
1222 * \name GL_ARB_get_program_binary
1226 * Calls to retrieve/store a binary serialized copy of the current program.
1228 void (*GetProgramBinaryDriverSHA1
)(struct gl_context
*ctx
, uint8_t *sha1
);
1230 void (*ProgramBinarySerializeDriverBlob
)(struct gl_context
*ctx
,
1231 struct gl_shader_program
*shProg
,
1232 struct gl_program
*prog
);
1234 void (*ProgramBinaryDeserializeDriverBlob
)(struct gl_context
*ctx
,
1235 struct gl_shader_program
*shProg
,
1236 struct gl_program
*prog
);
1240 * \name GL_EXT_semaphore interface
1244 * Called to allocate a new semaphore object. Drivers will usually
1245 * allocate/return a subclass of gl_semaphore_object.
1247 struct gl_semaphore_object
* (*NewSemaphoreObject
)(struct gl_context
*ctx
,
1250 * Called to delete/free a semaphore object. Drivers should free the
1251 * object and any associated resources.
1253 void (*DeleteSemaphoreObject
)(struct gl_context
*ctx
,
1254 struct gl_semaphore_object
*semObj
);
1257 * Introduce an operation to wait for the semaphore object in the GL
1258 * server's command stream
1260 void (*ServerWaitSemaphoreObject
)(struct gl_context
*ctx
,
1261 struct gl_semaphore_object
*semObj
,
1262 GLuint numBufferBarriers
,
1263 struct gl_buffer_object
**bufObjs
,
1264 GLuint numTextureBarriers
,
1265 struct gl_texture_object
**texObjs
,
1266 const GLenum
*srcLayouts
);
1269 * Introduce an operation to signal the semaphore object in the GL
1270 * server's command stream
1272 void (*ServerSignalSemaphoreObject
)(struct gl_context
*ctx
,
1273 struct gl_semaphore_object
*semObj
,
1274 GLuint numBufferBarriers
,
1275 struct gl_buffer_object
**bufObjs
,
1276 GLuint numTextureBarriers
,
1277 struct gl_texture_object
**texObjs
,
1278 const GLenum
*dstLayouts
);
1282 * \name GL_EXT_semaphore_fd interface
1286 * Called to import a semaphore object. The caller relinquishes ownership
1287 * of fd after the call returns.
1289 * Accessing fd after ImportSemaphoreFd returns results in undefined
1290 * behaviour. This is consistent with EXT_semaphore_fd.
1292 void (*ImportSemaphoreFd
)(struct gl_context
*ctx
,
1293 struct gl_semaphore_object
*semObj
,
1298 * \name Disk shader cache functions
1302 * Called to initialize gl_program::driver_cache_blob (and size) with a
1303 * ralloc allocated buffer.
1305 * This buffer will be saved and restored as part of the gl_program
1306 * serialization and deserialization.
1308 void (*ShaderCacheSerializeDriverBlob
)(struct gl_context
*ctx
,
1309 struct gl_program
*prog
);
1313 * \name Set the number of compiler threads for ARB_parallel_shader_compile
1315 void (*SetMaxShaderCompilerThreads
)(struct gl_context
*ctx
, unsigned count
);
1316 bool (*GetShaderProgramCompletionStatus
)(struct gl_context
*ctx
,
1317 struct gl_shader_program
*shprog
);
1322 * Per-vertex functions.
1324 * These are the functions which can appear between glBegin and glEnd.
1325 * Depending on whether we're inside or outside a glBegin/End pair
1326 * and whether we're in immediate mode or building a display list, these
1327 * functions behave differently. This structure allows us to switch
1328 * between those modes more easily.
1330 * Generally, these pointers point to functions in the VBO module.
1333 void (GLAPIENTRYP ArrayElement
)( GLint
);
1334 void (GLAPIENTRYP Color3f
)( GLfloat
, GLfloat
, GLfloat
);
1335 void (GLAPIENTRYP Color3fv
)( const GLfloat
* );
1336 void (GLAPIENTRYP Color4f
)( GLfloat
, GLfloat
, GLfloat
, GLfloat
);
1337 void (GLAPIENTRYP Color4fv
)( const GLfloat
* );
1338 void (GLAPIENTRYP EdgeFlag
)( GLboolean
);
1339 void (GLAPIENTRYP EvalCoord1f
)( GLfloat
);
1340 void (GLAPIENTRYP EvalCoord1fv
)( const GLfloat
* );
1341 void (GLAPIENTRYP EvalCoord2f
)( GLfloat
, GLfloat
);
1342 void (GLAPIENTRYP EvalCoord2fv
)( const GLfloat
* );
1343 void (GLAPIENTRYP EvalPoint1
)( GLint
);
1344 void (GLAPIENTRYP EvalPoint2
)( GLint
, GLint
);
1345 void (GLAPIENTRYP FogCoordfEXT
)( GLfloat
);
1346 void (GLAPIENTRYP FogCoordfvEXT
)( const GLfloat
* );
1347 void (GLAPIENTRYP Indexf
)( GLfloat
);
1348 void (GLAPIENTRYP Indexfv
)( const GLfloat
* );
1349 void (GLAPIENTRYP Materialfv
)( GLenum face
, GLenum pname
, const GLfloat
* );
1350 void (GLAPIENTRYP MultiTexCoord1fARB
)( GLenum
, GLfloat
);
1351 void (GLAPIENTRYP MultiTexCoord1fvARB
)( GLenum
, const GLfloat
* );
1352 void (GLAPIENTRYP MultiTexCoord2fARB
)( GLenum
, GLfloat
, GLfloat
);
1353 void (GLAPIENTRYP MultiTexCoord2fvARB
)( GLenum
, const GLfloat
* );
1354 void (GLAPIENTRYP MultiTexCoord3fARB
)( GLenum
, GLfloat
, GLfloat
, GLfloat
);
1355 void (GLAPIENTRYP MultiTexCoord3fvARB
)( GLenum
, const GLfloat
* );
1356 void (GLAPIENTRYP MultiTexCoord4fARB
)( GLenum
, GLfloat
, GLfloat
, GLfloat
, GLfloat
);
1357 void (GLAPIENTRYP MultiTexCoord4fvARB
)( GLenum
, const GLfloat
* );
1358 void (GLAPIENTRYP Normal3f
)( GLfloat
, GLfloat
, GLfloat
);
1359 void (GLAPIENTRYP Normal3fv
)( const GLfloat
* );
1360 void (GLAPIENTRYP SecondaryColor3fEXT
)( GLfloat
, GLfloat
, GLfloat
);
1361 void (GLAPIENTRYP SecondaryColor3fvEXT
)( const GLfloat
* );
1362 void (GLAPIENTRYP TexCoord1f
)( GLfloat
);
1363 void (GLAPIENTRYP TexCoord1fv
)( const GLfloat
* );
1364 void (GLAPIENTRYP TexCoord2f
)( GLfloat
, GLfloat
);
1365 void (GLAPIENTRYP TexCoord2fv
)( const GLfloat
* );
1366 void (GLAPIENTRYP TexCoord3f
)( GLfloat
, GLfloat
, GLfloat
);
1367 void (GLAPIENTRYP TexCoord3fv
)( const GLfloat
* );
1368 void (GLAPIENTRYP TexCoord4f
)( GLfloat
, GLfloat
, GLfloat
, GLfloat
);
1369 void (GLAPIENTRYP TexCoord4fv
)( const GLfloat
* );
1370 void (GLAPIENTRYP Vertex2f
)( GLfloat
, GLfloat
);
1371 void (GLAPIENTRYP Vertex2fv
)( const GLfloat
* );
1372 void (GLAPIENTRYP Vertex3f
)( GLfloat
, GLfloat
, GLfloat
);
1373 void (GLAPIENTRYP Vertex3fv
)( const GLfloat
* );
1374 void (GLAPIENTRYP Vertex4f
)( GLfloat
, GLfloat
, GLfloat
, GLfloat
);
1375 void (GLAPIENTRYP Vertex4fv
)( const GLfloat
* );
1376 void (GLAPIENTRYP CallList
)( GLuint
);
1377 void (GLAPIENTRYP CallLists
)( GLsizei
, GLenum
, const GLvoid
* );
1378 void (GLAPIENTRYP Begin
)( GLenum
);
1379 void (GLAPIENTRYP End
)( void );
1380 void (GLAPIENTRYP PrimitiveRestartNV
)( void );
1381 /* Originally for GL_NV_vertex_program, now used only dlist.c and friends */
1382 void (GLAPIENTRYP VertexAttrib1fNV
)( GLuint index
, GLfloat x
);
1383 void (GLAPIENTRYP VertexAttrib1fvNV
)( GLuint index
, const GLfloat
*v
);
1384 void (GLAPIENTRYP VertexAttrib2fNV
)( GLuint index
, GLfloat x
, GLfloat y
);
1385 void (GLAPIENTRYP VertexAttrib2fvNV
)( GLuint index
, const GLfloat
*v
);
1386 void (GLAPIENTRYP VertexAttrib3fNV
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
);
1387 void (GLAPIENTRYP VertexAttrib3fvNV
)( GLuint index
, const GLfloat
*v
);
1388 void (GLAPIENTRYP VertexAttrib4fNV
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
);
1389 void (GLAPIENTRYP VertexAttrib4fvNV
)( GLuint index
, const GLfloat
*v
);
1390 /* GL_ARB_vertex_program */
1391 void (GLAPIENTRYP VertexAttrib1fARB
)( GLuint index
, GLfloat x
);
1392 void (GLAPIENTRYP VertexAttrib1fvARB
)( GLuint index
, const GLfloat
*v
);
1393 void (GLAPIENTRYP VertexAttrib2fARB
)( GLuint index
, GLfloat x
, GLfloat y
);
1394 void (GLAPIENTRYP VertexAttrib2fvARB
)( GLuint index
, const GLfloat
*v
);
1395 void (GLAPIENTRYP VertexAttrib3fARB
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
);
1396 void (GLAPIENTRYP VertexAttrib3fvARB
)( GLuint index
, const GLfloat
*v
);
1397 void (GLAPIENTRYP VertexAttrib4fARB
)( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
);
1398 void (GLAPIENTRYP VertexAttrib4fvARB
)( GLuint index
, const GLfloat
*v
);
1400 /* GL_EXT_gpu_shader4 / GL 3.0 */
1401 void (GLAPIENTRYP VertexAttribI1i
)( GLuint index
, GLint x
);
1402 void (GLAPIENTRYP VertexAttribI2i
)( GLuint index
, GLint x
, GLint y
);
1403 void (GLAPIENTRYP VertexAttribI3i
)( GLuint index
, GLint x
, GLint y
, GLint z
);
1404 void (GLAPIENTRYP VertexAttribI4i
)( GLuint index
, GLint x
, GLint y
, GLint z
, GLint w
);
1405 void (GLAPIENTRYP VertexAttribI2iv
)( GLuint index
, const GLint
*v
);
1406 void (GLAPIENTRYP VertexAttribI3iv
)( GLuint index
, const GLint
*v
);
1407 void (GLAPIENTRYP VertexAttribI4iv
)( GLuint index
, const GLint
*v
);
1409 void (GLAPIENTRYP VertexAttribI1ui
)( GLuint index
, GLuint x
);
1410 void (GLAPIENTRYP VertexAttribI2ui
)( GLuint index
, GLuint x
, GLuint y
);
1411 void (GLAPIENTRYP VertexAttribI3ui
)( GLuint index
, GLuint x
, GLuint y
, GLuint z
);
1412 void (GLAPIENTRYP VertexAttribI4ui
)( GLuint index
, GLuint x
, GLuint y
, GLuint z
, GLuint w
);
1413 void (GLAPIENTRYP VertexAttribI2uiv
)( GLuint index
, const GLuint
*v
);
1414 void (GLAPIENTRYP VertexAttribI3uiv
)( GLuint index
, const GLuint
*v
);
1415 void (GLAPIENTRYP VertexAttribI4uiv
)( GLuint index
, const GLuint
*v
);
1417 /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
1418 void (GLAPIENTRYP VertexP2ui
)( GLenum type
, GLuint value
);
1419 void (GLAPIENTRYP VertexP2uiv
)( GLenum type
, const GLuint
*value
);
1421 void (GLAPIENTRYP VertexP3ui
)( GLenum type
, GLuint value
);
1422 void (GLAPIENTRYP VertexP3uiv
)( GLenum type
, const GLuint
*value
);
1424 void (GLAPIENTRYP VertexP4ui
)( GLenum type
, GLuint value
);
1425 void (GLAPIENTRYP VertexP4uiv
)( GLenum type
, const GLuint
*value
);
1427 void (GLAPIENTRYP TexCoordP1ui
)( GLenum type
, GLuint coords
);
1428 void (GLAPIENTRYP TexCoordP1uiv
)( GLenum type
, const GLuint
*coords
);
1430 void (GLAPIENTRYP TexCoordP2ui
)( GLenum type
, GLuint coords
);
1431 void (GLAPIENTRYP TexCoordP2uiv
)( GLenum type
, const GLuint
*coords
);
1433 void (GLAPIENTRYP TexCoordP3ui
)( GLenum type
, GLuint coords
);
1434 void (GLAPIENTRYP TexCoordP3uiv
)( GLenum type
, const GLuint
*coords
);
1436 void (GLAPIENTRYP TexCoordP4ui
)( GLenum type
, GLuint coords
);
1437 void (GLAPIENTRYP TexCoordP4uiv
)( GLenum type
, const GLuint
*coords
);
1439 void (GLAPIENTRYP MultiTexCoordP1ui
)( GLenum texture
, GLenum type
, GLuint coords
);
1440 void (GLAPIENTRYP MultiTexCoordP1uiv
)( GLenum texture
, GLenum type
, const GLuint
*coords
);
1441 void (GLAPIENTRYP MultiTexCoordP2ui
)( GLenum texture
, GLenum type
, GLuint coords
);
1442 void (GLAPIENTRYP MultiTexCoordP2uiv
)( GLenum texture
, GLenum type
, const GLuint
*coords
);
1443 void (GLAPIENTRYP MultiTexCoordP3ui
)( GLenum texture
, GLenum type
, GLuint coords
);
1444 void (GLAPIENTRYP MultiTexCoordP3uiv
)( GLenum texture
, GLenum type
, const GLuint
*coords
);
1445 void (GLAPIENTRYP MultiTexCoordP4ui
)( GLenum texture
, GLenum type
, GLuint coords
);
1446 void (GLAPIENTRYP MultiTexCoordP4uiv
)( GLenum texture
, GLenum type
, const GLuint
*coords
);
1448 void (GLAPIENTRYP NormalP3ui
)( GLenum type
, GLuint coords
);
1449 void (GLAPIENTRYP NormalP3uiv
)( GLenum type
, const GLuint
*coords
);
1451 void (GLAPIENTRYP ColorP3ui
)( GLenum type
, GLuint color
);
1452 void (GLAPIENTRYP ColorP3uiv
)( GLenum type
, const GLuint
*color
);
1454 void (GLAPIENTRYP ColorP4ui
)( GLenum type
, GLuint color
);
1455 void (GLAPIENTRYP ColorP4uiv
)( GLenum type
, const GLuint
*color
);
1457 void (GLAPIENTRYP SecondaryColorP3ui
)( GLenum type
, GLuint color
);
1458 void (GLAPIENTRYP SecondaryColorP3uiv
)( GLenum type
, const GLuint
*color
);
1460 void (GLAPIENTRYP VertexAttribP1ui
)( GLuint index
, GLenum type
,
1461 GLboolean normalized
, GLuint value
);
1462 void (GLAPIENTRYP VertexAttribP2ui
)( GLuint index
, GLenum type
,
1463 GLboolean normalized
, GLuint value
);
1464 void (GLAPIENTRYP VertexAttribP3ui
)( GLuint index
, GLenum type
,
1465 GLboolean normalized
, GLuint value
);
1466 void (GLAPIENTRYP VertexAttribP4ui
)( GLuint index
, GLenum type
,
1467 GLboolean normalized
, GLuint value
);
1468 void (GLAPIENTRYP VertexAttribP1uiv
)( GLuint index
, GLenum type
,
1469 GLboolean normalized
,
1470 const GLuint
*value
);
1471 void (GLAPIENTRYP VertexAttribP2uiv
)( GLuint index
, GLenum type
,
1472 GLboolean normalized
,
1473 const GLuint
*value
);
1474 void (GLAPIENTRYP VertexAttribP3uiv
)( GLuint index
, GLenum type
,
1475 GLboolean normalized
,
1476 const GLuint
*value
);
1477 void (GLAPIENTRYP VertexAttribP4uiv
)( GLuint index
, GLenum type
,
1478 GLboolean normalized
,
1479 const GLuint
*value
);
1481 /* GL_ARB_vertex_attrib_64bit / GL 4.1 */
1482 void (GLAPIENTRYP VertexAttribL1d
)( GLuint index
, GLdouble x
);
1483 void (GLAPIENTRYP VertexAttribL2d
)( GLuint index
, GLdouble x
, GLdouble y
);
1484 void (GLAPIENTRYP VertexAttribL3d
)( GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
);
1485 void (GLAPIENTRYP VertexAttribL4d
)( GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
);
1488 void (GLAPIENTRYP VertexAttribL1dv
)( GLuint index
, const GLdouble
*v
);
1489 void (GLAPIENTRYP VertexAttribL2dv
)( GLuint index
, const GLdouble
*v
);
1490 void (GLAPIENTRYP VertexAttribL3dv
)( GLuint index
, const GLdouble
*v
);
1491 void (GLAPIENTRYP VertexAttribL4dv
)( GLuint index
, const GLdouble
*v
);
1493 void (GLAPIENTRYP VertexAttribL1ui64ARB
)( GLuint index
, GLuint64EXT x
);
1494 void (GLAPIENTRYP VertexAttribL1ui64vARB
)( GLuint index
, const GLuint64EXT
*v
);
1498 #endif /* DD_INCLUDED */