mesa: Move vbo draw functions into dd_function_table.
[mesa.git] / src / mesa / main / dd.h
1 /**
2 * \file dd.h
3 * Device driver interfaces.
4 */
5
6 /*
7 * Mesa 3-D graphics library
8 *
9 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
10 *
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:
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
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.
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_bitmap_atlas;
39 struct gl_buffer_object;
40 struct gl_context;
41 struct gl_display_list;
42 struct gl_framebuffer;
43 struct gl_image_unit;
44 struct gl_pixelstore_attrib;
45 struct gl_program;
46 struct gl_renderbuffer;
47 struct gl_renderbuffer_attachment;
48 struct gl_shader;
49 struct gl_shader_program;
50 struct gl_texture_image;
51 struct gl_texture_object;
52 struct gl_memory_info;
53 struct util_queue_monitoring;
54 struct _mesa_prim;
55 struct _mesa_index_buffer;
56
57 /* GL_ARB_vertex_buffer_object */
58 /* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
59 * NULL) if buffer is unavailable for immediate mapping.
60 *
61 * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
62 * would require more book-keeping in the driver than seems necessary
63 * at this point.
64 *
65 * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
66 * want to provoke the driver to throw away the old storage, we will
67 * respect the contents of already referenced data.
68 */
69 #define MESA_MAP_NOWAIT_BIT 0x4000
70
71
72 /**
73 * Device driver function table.
74 * Core Mesa uses these function pointers to call into device drivers.
75 * Most of these functions directly correspond to OpenGL state commands.
76 * Core Mesa will call these functions after error checking has been done
77 * so that the drivers don't have to worry about error testing.
78 *
79 * Vertex transformation/clipping/lighting is patched into the T&L module.
80 * Rasterization functions are patched into the swrast module.
81 *
82 * Note: when new functions are added here, the drivers/common/driverfuncs.c
83 * file should be updated too!!!
84 */
85 struct dd_function_table {
86 /**
87 * Return a string as needed by glGetString().
88 * Only the GL_RENDERER query must be implemented. Otherwise, NULL can be
89 * returned.
90 */
91 const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
92
93 /**
94 * Notify the driver after Mesa has made some internal state changes.
95 *
96 * This is in addition to any state change callbacks Mesa may already have
97 * made.
98 */
99 void (*UpdateState)(struct gl_context *ctx);
100
101 /**
102 * This is called whenever glFinish() is called.
103 */
104 void (*Finish)( struct gl_context *ctx );
105
106 /**
107 * This is called whenever glFlush() is called.
108 */
109 void (*Flush)( struct gl_context *ctx );
110
111 /**
112 * Clear the color/depth/stencil/accum buffer(s).
113 * \param buffers a bitmask of BUFFER_BIT_* flags indicating which
114 * renderbuffers need to be cleared.
115 */
116 void (*Clear)( struct gl_context *ctx, GLbitfield buffers );
117
118 /**
119 * Execute glRasterPos, updating the ctx->Current.Raster fields
120 */
121 void (*RasterPos)( struct gl_context *ctx, const GLfloat v[4] );
122
123 /**
124 * \name Image-related functions
125 */
126 /*@{*/
127
128 /**
129 * Called by glDrawPixels().
130 * \p unpack describes how to unpack the source image data.
131 */
132 void (*DrawPixels)( struct gl_context *ctx,
133 GLint x, GLint y, GLsizei width, GLsizei height,
134 GLenum format, GLenum type,
135 const struct gl_pixelstore_attrib *unpack,
136 const GLvoid *pixels );
137
138 /**
139 * Called by glReadPixels().
140 */
141 void (*ReadPixels)( struct gl_context *ctx,
142 GLint x, GLint y, GLsizei width, GLsizei height,
143 GLenum format, GLenum type,
144 const struct gl_pixelstore_attrib *unpack,
145 GLvoid *dest );
146
147 /**
148 * Called by glCopyPixels().
149 */
150 void (*CopyPixels)( struct gl_context *ctx, GLint srcx, GLint srcy,
151 GLsizei width, GLsizei height,
152 GLint dstx, GLint dsty, GLenum type );
153
154 /**
155 * Called by glBitmap().
156 */
157 void (*Bitmap)( struct gl_context *ctx,
158 GLint x, GLint y, GLsizei width, GLsizei height,
159 const struct gl_pixelstore_attrib *unpack,
160 const GLubyte *bitmap );
161
162 /**
163 * Called by display list code for optimized glCallLists/glBitmap rendering
164 * The driver must support texture rectangles of width 1024 or more.
165 */
166 void (*DrawAtlasBitmaps)(struct gl_context *ctx,
167 const struct gl_bitmap_atlas *atlas,
168 GLuint count, const GLubyte *ids);
169 /*@}*/
170
171
172 /**
173 * \name Texture image functions
174 */
175 /*@{*/
176
177 /**
178 * Choose actual hardware texture format given the texture target, the
179 * user-provided source image format and type and the desired internal
180 * format. In some cases, srcFormat and srcType can be GL_NONE.
181 * Note: target may be GL_TEXTURE_CUBE_MAP, but never
182 * GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ].
183 * Called by glTexImage(), etc.
184 */
185 mesa_format (*ChooseTextureFormat)(struct gl_context *ctx,
186 GLenum target, GLint internalFormat,
187 GLenum srcFormat, GLenum srcType );
188
189 /**
190 * Queries different driver parameters for a particular target and format.
191 * Since ARB_internalformat_query2 introduced several new query parameters
192 * over ARB_internalformat_query, having one driver hook for each parameter
193 * is no longer feasible. So this is the generic entry-point for calls
194 * to glGetInternalFormativ and glGetInternalFormati64v, after Mesa has
195 * checked errors and default values.
196 *
197 * \param ctx GL context
198 * \param target GL target enum
199 * \param internalFormat GL format enum
200 * \param pname GL enum that specifies the info to query.
201 * \param params Buffer to hold the result of the query.
202 */
203 void (*QueryInternalFormat)(struct gl_context *ctx,
204 GLenum target,
205 GLenum internalFormat,
206 GLenum pname,
207 GLint *params);
208
209 /**
210 * Called by glTexImage[123]D() and glCopyTexImage[12]D()
211 * Allocate texture memory and copy the user's image to the buffer.
212 * The gl_texture_image fields, etc. will be fully initialized.
213 * The parameters are the same as glTexImage3D(), plus:
214 * \param dims 1, 2, or 3 indicating glTexImage1/2/3D()
215 * \param packing describes how to unpack the source data.
216 * \param texImage is the destination texture image.
217 */
218 void (*TexImage)(struct gl_context *ctx, GLuint dims,
219 struct gl_texture_image *texImage,
220 GLenum format, GLenum type, const GLvoid *pixels,
221 const struct gl_pixelstore_attrib *packing);
222
223 /**
224 * Called by glTexSubImage[123]D().
225 * Replace a subset of the target texture with new texel data.
226 */
227 void (*TexSubImage)(struct gl_context *ctx, GLuint dims,
228 struct gl_texture_image *texImage,
229 GLint xoffset, GLint yoffset, GLint zoffset,
230 GLsizei width, GLsizei height, GLint depth,
231 GLenum format, GLenum type,
232 const GLvoid *pixels,
233 const struct gl_pixelstore_attrib *packing);
234
235
236 /**
237 * Called by glGetTexImage(), glGetTextureSubImage().
238 */
239 void (*GetTexSubImage)(struct gl_context *ctx,
240 GLint xoffset, GLint yoffset, GLint zoffset,
241 GLsizei width, GLsizei height, GLsizei depth,
242 GLenum format, GLenum type, GLvoid *pixels,
243 struct gl_texture_image *texImage);
244
245 /**
246 * Called by glClearTex[Sub]Image
247 *
248 * Clears a rectangular region of the image to a given value. The
249 * clearValue argument is either NULL or points to a single texel to use as
250 * the clear value in the same internal format as the texture image. If it
251 * is NULL then the texture should be cleared to zeroes.
252 */
253 void (*ClearTexSubImage)(struct gl_context *ctx,
254 struct gl_texture_image *texImage,
255 GLint xoffset, GLint yoffset, GLint zoffset,
256 GLsizei width, GLsizei height, GLsizei depth,
257 const GLvoid *clearValue);
258
259 /**
260 * Called by glCopyTex[Sub]Image[123]D().
261 *
262 * This function should copy a rectangular region in the rb to a single
263 * destination slice, specified by @slice. In the case of 1D array
264 * textures (where one GL call can potentially affect multiple destination
265 * slices), core mesa takes care of calling this function multiple times,
266 * once for each scanline to be copied.
267 */
268 void (*CopyTexSubImage)(struct gl_context *ctx, GLuint dims,
269 struct gl_texture_image *texImage,
270 GLint xoffset, GLint yoffset, GLint slice,
271 struct gl_renderbuffer *rb,
272 GLint x, GLint y,
273 GLsizei width, GLsizei height);
274 /**
275 * Called by glCopyImageSubData().
276 *
277 * This function should copy one 2-D slice from src_teximage or
278 * src_renderbuffer to dst_teximage or dst_renderbuffer. Either the
279 * teximage or renderbuffer pointer will be non-null to indicate which
280 * is the real src/dst.
281 *
282 * If one of the textures is 3-D or is a 1-D or 2-D array
283 * texture, this function will be called multiple times: once for each
284 * slice. If one of the textures is a cube map, this function will be
285 * called once for each face to be copied.
286 */
287 void (*CopyImageSubData)(struct gl_context *ctx,
288 struct gl_texture_image *src_teximage,
289 struct gl_renderbuffer *src_renderbuffer,
290 int src_x, int src_y, int src_z,
291 struct gl_texture_image *dst_teximage,
292 struct gl_renderbuffer *dst_renderbuffer,
293 int dst_x, int dst_y, int dst_z,
294 int src_width, int src_height);
295
296 /**
297 * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
298 * Note that if the texture is a cube map, the <target> parameter will
299 * indicate which cube face to generate (GL_POSITIVE/NEGATIVE_X/Y/Z).
300 * texObj->BaseLevel is the level from which to generate the remaining
301 * mipmap levels.
302 */
303 void (*GenerateMipmap)(struct gl_context *ctx, GLenum target,
304 struct gl_texture_object *texObj);
305
306 /**
307 * Called by glTexImage, glCompressedTexImage, glCopyTexImage
308 * and glTexStorage to check if the dimensions of the texture image
309 * are too large.
310 * \param target any GL_PROXY_TEXTURE_x target
311 * \return GL_TRUE if the image is OK, GL_FALSE if too large
312 */
313 GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
314 GLuint numLevels, GLint level,
315 mesa_format format, GLuint numSamples,
316 GLint width, GLint height,
317 GLint depth);
318 /*@}*/
319
320
321 /**
322 * \name Compressed texture functions
323 */
324 /*@{*/
325
326 /**
327 * Called by glCompressedTexImage[123]D().
328 */
329 void (*CompressedTexImage)(struct gl_context *ctx, GLuint dims,
330 struct gl_texture_image *texImage,
331 GLsizei imageSize, const GLvoid *data);
332
333 /**
334 * Called by glCompressedTexSubImage[123]D().
335 */
336 void (*CompressedTexSubImage)(struct gl_context *ctx, GLuint dims,
337 struct gl_texture_image *texImage,
338 GLint xoffset, GLint yoffset, GLint zoffset,
339 GLsizei width, GLsizei height, GLsizei depth,
340 GLenum format,
341 GLsizei imageSize, const GLvoid *data);
342 /*@}*/
343
344 /**
345 * \name Texture object / image functions
346 */
347 /*@{*/
348
349 /**
350 * Called by glBindTexture() and glBindTextures().
351 */
352 void (*BindTexture)( struct gl_context *ctx, GLuint texUnit,
353 GLenum target, struct gl_texture_object *tObj );
354
355 /**
356 * Called to allocate a new texture object. Drivers will usually
357 * allocate/return a subclass of gl_texture_object.
358 */
359 struct gl_texture_object * (*NewTextureObject)(struct gl_context *ctx,
360 GLuint name, GLenum target);
361 /**
362 * Called to delete/free a texture object. Drivers should free the
363 * object and any image data it contains.
364 */
365 void (*DeleteTexture)(struct gl_context *ctx,
366 struct gl_texture_object *texObj);
367
368 /** Called to allocate a new texture image object. */
369 struct gl_texture_image * (*NewTextureImage)(struct gl_context *ctx);
370
371 /** Called to free a texture image object returned by NewTextureImage() */
372 void (*DeleteTextureImage)(struct gl_context *ctx,
373 struct gl_texture_image *);
374
375 /** Called to allocate memory for a single texture image */
376 GLboolean (*AllocTextureImageBuffer)(struct gl_context *ctx,
377 struct gl_texture_image *texImage);
378
379 /** Free the memory for a single texture image */
380 void (*FreeTextureImageBuffer)(struct gl_context *ctx,
381 struct gl_texture_image *texImage);
382
383 /** Map a slice of a texture image into user space.
384 * Note: for GL_TEXTURE_1D_ARRAY, height must be 1, y must be 0 and slice
385 * indicates the 1D array index.
386 * \param texImage the texture image
387 * \param slice the 3D image slice or array texture slice
388 * \param x, y, w, h region of interest
389 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
390 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
391 * \param mapOut returns start of mapping of region of interest
392 * \param rowStrideOut returns row stride (in bytes). In the case of a
393 * compressed texture, this is the byte stride between one row of blocks
394 * and another.
395 */
396 void (*MapTextureImage)(struct gl_context *ctx,
397 struct gl_texture_image *texImage,
398 GLuint slice,
399 GLuint x, GLuint y, GLuint w, GLuint h,
400 GLbitfield mode,
401 GLubyte **mapOut, GLint *rowStrideOut);
402
403 void (*UnmapTextureImage)(struct gl_context *ctx,
404 struct gl_texture_image *texImage,
405 GLuint slice);
406
407 /** For GL_ARB_texture_storage. Allocate memory for whole mipmap stack.
408 * All the gl_texture_images in the texture object will have their
409 * dimensions, format, etc. initialized already.
410 */
411 GLboolean (*AllocTextureStorage)(struct gl_context *ctx,
412 struct gl_texture_object *texObj,
413 GLsizei levels, GLsizei width,
414 GLsizei height, GLsizei depth);
415
416 /** Called as part of glTextureView to add views to origTexObj */
417 GLboolean (*TextureView)(struct gl_context *ctx,
418 struct gl_texture_object *texObj,
419 struct gl_texture_object *origTexObj);
420
421 /**
422 * Map a renderbuffer into user space.
423 * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
424 * GL_MAP_INVALIDATE_RANGE_BIT (if writing)
425 */
426 void (*MapRenderbuffer)(struct gl_context *ctx,
427 struct gl_renderbuffer *rb,
428 GLuint x, GLuint y, GLuint w, GLuint h,
429 GLbitfield mode,
430 GLubyte **mapOut, GLint *rowStrideOut);
431
432 void (*UnmapRenderbuffer)(struct gl_context *ctx,
433 struct gl_renderbuffer *rb);
434
435 /**
436 * Optional driver entrypoint that binds a non-texture renderbuffer's
437 * contents to a texture image.
438 */
439 GLboolean (*BindRenderbufferTexImage)(struct gl_context *ctx,
440 struct gl_renderbuffer *rb,
441 struct gl_texture_image *texImage);
442 /*@}*/
443
444
445 /**
446 * \name Vertex/fragment program functions
447 */
448 /*@{*/
449 /** Allocate a new program */
450 struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target,
451 GLuint id, bool is_arb_asm);
452 /** Delete a program */
453 void (*DeleteProgram)(struct gl_context *ctx, struct gl_program *prog);
454 /**
455 * Allocate a program to associate with the new ATI fragment shader (optional)
456 */
457 struct gl_program * (*NewATIfs)(struct gl_context *ctx,
458 struct ati_fragment_shader *curProg);
459 /**
460 * Notify driver that a program string (and GPU code) has been specified
461 * or modified. Return GL_TRUE or GL_FALSE to indicate if the program is
462 * supported by the driver.
463 */
464 GLboolean (*ProgramStringNotify)(struct gl_context *ctx, GLenum target,
465 struct gl_program *prog);
466
467 /**
468 * Notify driver that the sampler uniforms for the current program have
469 * changed. On some drivers, this may require shader recompiles.
470 */
471 void (*SamplerUniformChange)(struct gl_context *ctx, GLenum target,
472 struct gl_program *prog);
473
474 /** Query if program can be loaded onto hardware */
475 GLboolean (*IsProgramNative)(struct gl_context *ctx, GLenum target,
476 struct gl_program *prog);
477
478 /*@}*/
479
480 /**
481 * \name GLSL shader/program functions.
482 */
483 /*@{*/
484 /**
485 * Called when a shader program is linked.
486 *
487 * This gives drivers an opportunity to clone the IR and make their
488 * own transformations on it for the purposes of code generation.
489 */
490 GLboolean (*LinkShader)(struct gl_context *ctx,
491 struct gl_shader_program *shader);
492 /*@}*/
493
494
495 /**
496 * \name Draw functions.
497 */
498 /*@{*/
499 /**
500 * For indirect array drawing:
501 *
502 * typedef struct {
503 * GLuint count;
504 * GLuint primCount;
505 * GLuint first;
506 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise
507 * } DrawArraysIndirectCommand;
508 *
509 * For indirect indexed drawing:
510 *
511 * typedef struct {
512 * GLuint count;
513 * GLuint primCount;
514 * GLuint firstIndex;
515 * GLint baseVertex;
516 * GLuint baseInstance; // in GL 4.2 and later, must be zero otherwise
517 * } DrawElementsIndirectCommand;
518 */
519
520 /**
521 * Draw a number of primitives.
522 * \param prims array [nr_prims] describing what to draw (prim type,
523 * vertex count, first index, instance count, etc).
524 * \param ib index buffer for indexed drawing, NULL for array drawing
525 * \param index_bounds_valid are min_index and max_index valid?
526 * \param min_index lowest vertex index used
527 * \param max_index highest vertex index used
528 * \param tfb_vertcount if non-null, indicates which transform feedback
529 * object has the vertex count.
530 * \param tfb_stream If called via DrawTransformFeedbackStream, specifies
531 * the vertex stream buffer from which to get the vertex
532 * count.
533 * \param indirect If any prims are indirect, this specifies the buffer
534 * to find the "DrawArrays/ElementsIndirectCommand" data.
535 * This may be deprecated in the future
536 */
537 void (*Draw)(struct gl_context *ctx,
538 const struct _mesa_prim *prims, GLuint nr_prims,
539 const struct _mesa_index_buffer *ib,
540 GLboolean index_bounds_valid,
541 GLuint min_index, GLuint max_index,
542 struct gl_transform_feedback_object *tfb_vertcount,
543 unsigned tfb_stream, struct gl_buffer_object *indirect);
544
545
546 /**
547 * Draw a primitive, getting the vertex count, instance count, start
548 * vertex, etc. from a buffer object.
549 * \param mode GL_POINTS, GL_LINES, GL_TRIANGLE_STRIP, etc.
550 * \param indirect_data buffer to get "DrawArrays/ElementsIndirectCommand"
551 * data
552 * \param indirect_offset offset of first primitive in indrect_data buffer
553 * \param draw_count number of primitives to draw
554 * \param stride stride, in bytes, between
555 * "DrawArrays/ElementsIndirectCommand" objects
556 * \param indirect_draw_count_buffer if non-NULL specifies a buffer to get
557 * the real draw_count value. Used for
558 * GL_ARB_indirect_parameters.
559 * \param indirect_draw_count_offset offset to the draw_count value in
560 * indirect_draw_count_buffer
561 * \param ib index buffer for indexed drawing, NULL otherwise.
562 */
563 void (*DrawIndirect)(struct gl_context *ctx, GLuint mode,
564 struct gl_buffer_object *indirect_data,
565 GLsizeiptr indirect_offset, unsigned draw_count,
566 unsigned stride,
567 struct gl_buffer_object *indirect_draw_count_buffer,
568 GLsizeiptr indirect_draw_count_offset,
569 const struct _mesa_index_buffer *ib);
570 /*@}*/
571
572
573 /**
574 * \name State-changing functions.
575 *
576 * \note drawing functions are above.
577 *
578 * These functions are called by their corresponding OpenGL API functions.
579 * They are \e also called by the gl_PopAttrib() function!!!
580 * May add more functions like these to the device driver in the future.
581 */
582 /*@{*/
583 /** Specify the alpha test function */
584 void (*AlphaFunc)(struct gl_context *ctx, GLenum func, GLfloat ref);
585 /** Set the blend color */
586 void (*BlendColor)(struct gl_context *ctx, const GLfloat color[4]);
587 /** Set the blend equation */
588 void (*BlendEquationSeparate)(struct gl_context *ctx,
589 GLenum modeRGB, GLenum modeA);
590 /** Specify pixel arithmetic */
591 void (*BlendFuncSeparate)(struct gl_context *ctx,
592 GLenum sfactorRGB, GLenum dfactorRGB,
593 GLenum sfactorA, GLenum dfactorA);
594 /** Specify a plane against which all geometry is clipped */
595 void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *eq);
596 /** Enable and disable writing of frame buffer color components */
597 void (*ColorMask)(struct gl_context *ctx, GLboolean rmask, GLboolean gmask,
598 GLboolean bmask, GLboolean amask );
599 /** Cause a material color to track the current color */
600 void (*ColorMaterial)(struct gl_context *ctx, GLenum face, GLenum mode);
601 /** Specify whether front- or back-facing facets can be culled */
602 void (*CullFace)(struct gl_context *ctx, GLenum mode);
603 /** Define front- and back-facing polygons */
604 void (*FrontFace)(struct gl_context *ctx, GLenum mode);
605 /** Specify the value used for depth buffer comparisons */
606 void (*DepthFunc)(struct gl_context *ctx, GLenum func);
607 /** Enable or disable writing into the depth buffer */
608 void (*DepthMask)(struct gl_context *ctx, GLboolean flag);
609 /** Specify mapping of depth values from NDC to window coordinates */
610 void (*DepthRange)(struct gl_context *ctx);
611 /** Specify the current buffer for writing */
612 void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
613 /** Specify the buffers for writing for fragment programs*/
614 void (*DrawBuffers)(struct gl_context *ctx, GLsizei n, const GLenum *buffers);
615 /** Enable or disable server-side gl capabilities */
616 void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
617 /** Specify fog parameters */
618 void (*Fogfv)(struct gl_context *ctx, GLenum pname, const GLfloat *params);
619 /** Set light source parameters.
620 * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
621 * been transformed to eye-space.
622 */
623 void (*Lightfv)(struct gl_context *ctx, GLenum light,
624 GLenum pname, const GLfloat *params );
625 /** Set the lighting model parameters */
626 void (*LightModelfv)(struct gl_context *ctx, GLenum pname,
627 const GLfloat *params);
628 /** Specify the line stipple pattern */
629 void (*LineStipple)(struct gl_context *ctx, GLint factor, GLushort pattern );
630 /** Specify the width of rasterized lines */
631 void (*LineWidth)(struct gl_context *ctx, GLfloat width);
632 /** Specify a logical pixel operation for color index rendering */
633 void (*LogicOpcode)(struct gl_context *ctx, enum gl_logicop_mode opcode);
634 void (*PointParameterfv)(struct gl_context *ctx, GLenum pname,
635 const GLfloat *params);
636 /** Specify the diameter of rasterized points */
637 void (*PointSize)(struct gl_context *ctx, GLfloat size);
638 /** Select a polygon rasterization mode */
639 void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
640 /** Set the scale and units used to calculate depth values */
641 void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units, GLfloat clamp);
642 /** Set the polygon stippling pattern */
643 void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
644 /* Specifies the current buffer for reading */
645 void (*ReadBuffer)( struct gl_context *ctx, GLenum buffer );
646 /** Set rasterization mode */
647 void (*RenderMode)(struct gl_context *ctx, GLenum mode );
648 /** Define the scissor box */
649 void (*Scissor)(struct gl_context *ctx);
650 /** Select flat or smooth shading */
651 void (*ShadeModel)(struct gl_context *ctx, GLenum mode);
652 /** OpenGL 2.0 two-sided StencilFunc */
653 void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func,
654 GLint ref, GLuint mask);
655 /** OpenGL 2.0 two-sided StencilMask */
656 void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask);
657 /** OpenGL 2.0 two-sided StencilOp */
658 void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail,
659 GLenum zfail, GLenum zpass);
660 /** Control the generation of texture coordinates */
661 void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname,
662 const GLfloat *params);
663 /** Set texture environment parameters */
664 void (*TexEnv)(struct gl_context *ctx, GLenum target, GLenum pname,
665 const GLfloat *param);
666 /** Set texture parameter (callee gets param value from the texObj) */
667 void (*TexParameter)(struct gl_context *ctx,
668 struct gl_texture_object *texObj, GLenum pname);
669 /** Set the viewport */
670 void (*Viewport)(struct gl_context *ctx);
671 /*@}*/
672
673
674 /**
675 * \name Vertex/pixel buffer object functions
676 */
677 /*@{*/
678 struct gl_buffer_object * (*NewBufferObject)(struct gl_context *ctx,
679 GLuint buffer);
680
681 void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
682
683 GLboolean (*BufferData)(struct gl_context *ctx, GLenum target,
684 GLsizeiptrARB size, const GLvoid *data, GLenum usage,
685 GLenum storageFlags, struct gl_buffer_object *obj);
686
687 void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
688 GLsizeiptrARB size, const GLvoid *data,
689 struct gl_buffer_object *obj );
690
691 void (*GetBufferSubData)( struct gl_context *ctx,
692 GLintptrARB offset, GLsizeiptrARB size,
693 GLvoid *data, struct gl_buffer_object *obj );
694
695 void (*ClearBufferSubData)( struct gl_context *ctx,
696 GLintptr offset, GLsizeiptr size,
697 const GLvoid *clearValue,
698 GLsizeiptr clearValueSize,
699 struct gl_buffer_object *obj );
700
701 void (*CopyBufferSubData)( struct gl_context *ctx,
702 struct gl_buffer_object *src,
703 struct gl_buffer_object *dst,
704 GLintptr readOffset, GLintptr writeOffset,
705 GLsizeiptr size );
706
707 void (*InvalidateBufferSubData)( struct gl_context *ctx,
708 struct gl_buffer_object *obj,
709 GLintptr offset,
710 GLsizeiptr length );
711
712 /* Returns pointer to the start of the mapped range.
713 * May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
714 */
715 void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
716 GLsizeiptr length, GLbitfield access,
717 struct gl_buffer_object *obj,
718 gl_map_buffer_index index);
719
720 void (*FlushMappedBufferRange)(struct gl_context *ctx,
721 GLintptr offset, GLsizeiptr length,
722 struct gl_buffer_object *obj,
723 gl_map_buffer_index index);
724
725 GLboolean (*UnmapBuffer)( struct gl_context *ctx,
726 struct gl_buffer_object *obj,
727 gl_map_buffer_index index);
728 /*@}*/
729
730 /**
731 * \name Functions for GL_APPLE_object_purgeable
732 */
733 /*@{*/
734 /* variations on ObjectPurgeable */
735 GLenum (*BufferObjectPurgeable)(struct gl_context *ctx,
736 struct gl_buffer_object *obj, GLenum option);
737 GLenum (*RenderObjectPurgeable)(struct gl_context *ctx,
738 struct gl_renderbuffer *obj, GLenum option);
739 GLenum (*TextureObjectPurgeable)(struct gl_context *ctx,
740 struct gl_texture_object *obj,
741 GLenum option);
742
743 /* variations on ObjectUnpurgeable */
744 GLenum (*BufferObjectUnpurgeable)(struct gl_context *ctx,
745 struct gl_buffer_object *obj,
746 GLenum option);
747 GLenum (*RenderObjectUnpurgeable)(struct gl_context *ctx,
748 struct gl_renderbuffer *obj,
749 GLenum option);
750 GLenum (*TextureObjectUnpurgeable)(struct gl_context *ctx,
751 struct gl_texture_object *obj,
752 GLenum option);
753 /*@}*/
754
755 /**
756 * \name Functions for GL_EXT_framebuffer_{object,blit,discard}.
757 */
758 /*@{*/
759 struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx,
760 GLuint name);
761 struct gl_renderbuffer * (*NewRenderbuffer)(struct gl_context *ctx,
762 GLuint name);
763 void (*BindFramebuffer)(struct gl_context *ctx, GLenum target,
764 struct gl_framebuffer *drawFb,
765 struct gl_framebuffer *readFb);
766 void (*FramebufferRenderbuffer)(struct gl_context *ctx,
767 struct gl_framebuffer *fb,
768 GLenum attachment,
769 struct gl_renderbuffer *rb);
770 void (*RenderTexture)(struct gl_context *ctx,
771 struct gl_framebuffer *fb,
772 struct gl_renderbuffer_attachment *att);
773 void (*FinishRenderTexture)(struct gl_context *ctx,
774 struct gl_renderbuffer *rb);
775 void (*ValidateFramebuffer)(struct gl_context *ctx,
776 struct gl_framebuffer *fb);
777 /*@}*/
778 void (*BlitFramebuffer)(struct gl_context *ctx,
779 struct gl_framebuffer *readFb,
780 struct gl_framebuffer *drawFb,
781 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
782 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
783 GLbitfield mask, GLenum filter);
784 void (*DiscardFramebuffer)(struct gl_context *ctx,
785 GLenum target, GLsizei numAttachments,
786 const GLenum *attachments);
787
788 /**
789 * \name Query objects
790 */
791 /*@{*/
792 struct gl_query_object * (*NewQueryObject)(struct gl_context *ctx, GLuint id);
793 void (*DeleteQuery)(struct gl_context *ctx, struct gl_query_object *q);
794 void (*BeginQuery)(struct gl_context *ctx, struct gl_query_object *q);
795 void (*QueryCounter)(struct gl_context *ctx, struct gl_query_object *q);
796 void (*EndQuery)(struct gl_context *ctx, struct gl_query_object *q);
797 void (*CheckQuery)(struct gl_context *ctx, struct gl_query_object *q);
798 void (*WaitQuery)(struct gl_context *ctx, struct gl_query_object *q);
799 /*
800 * \pname the value requested to be written (GL_QUERY_RESULT, etc)
801 * \ptype the type of the value requested to be written:
802 * GL_UNSIGNED_INT, GL_UNSIGNED_INT64_ARB,
803 * GL_INT, GL_INT64_ARB
804 */
805 void (*StoreQueryResult)(struct gl_context *ctx, struct gl_query_object *q,
806 struct gl_buffer_object *buf, intptr_t offset,
807 GLenum pname, GLenum ptype);
808 /*@}*/
809
810 /**
811 * \name Performance monitors
812 */
813 /*@{*/
814 void (*InitPerfMonitorGroups)(struct gl_context *ctx);
815 struct gl_perf_monitor_object * (*NewPerfMonitor)(struct gl_context *ctx);
816 void (*DeletePerfMonitor)(struct gl_context *ctx,
817 struct gl_perf_monitor_object *m);
818 GLboolean (*BeginPerfMonitor)(struct gl_context *ctx,
819 struct gl_perf_monitor_object *m);
820
821 /** Stop an active performance monitor, discarding results. */
822 void (*ResetPerfMonitor)(struct gl_context *ctx,
823 struct gl_perf_monitor_object *m);
824 void (*EndPerfMonitor)(struct gl_context *ctx,
825 struct gl_perf_monitor_object *m);
826 GLboolean (*IsPerfMonitorResultAvailable)(struct gl_context *ctx,
827 struct gl_perf_monitor_object *m);
828 void (*GetPerfMonitorResult)(struct gl_context *ctx,
829 struct gl_perf_monitor_object *m,
830 GLsizei dataSize,
831 GLuint *data,
832 GLint *bytesWritten);
833 /*@}*/
834
835 /**
836 * \name Performance Query objects
837 */
838 /*@{*/
839 unsigned (*InitPerfQueryInfo)(struct gl_context *ctx);
840 void (*GetPerfQueryInfo)(struct gl_context *ctx,
841 unsigned queryIndex,
842 const char **name,
843 GLuint *dataSize,
844 GLuint *numCounters,
845 GLuint *numActive);
846 void (*GetPerfCounterInfo)(struct gl_context *ctx,
847 unsigned queryIndex,
848 unsigned counterIndex,
849 const char **name,
850 const char **desc,
851 GLuint *offset,
852 GLuint *data_size,
853 GLuint *type_enum,
854 GLuint *data_type_enum,
855 GLuint64 *raw_max);
856 struct gl_perf_query_object * (*NewPerfQueryObject)(struct gl_context *ctx,
857 unsigned queryIndex);
858 void (*DeletePerfQuery)(struct gl_context *ctx,
859 struct gl_perf_query_object *obj);
860 bool (*BeginPerfQuery)(struct gl_context *ctx,
861 struct gl_perf_query_object *obj);
862 void (*EndPerfQuery)(struct gl_context *ctx,
863 struct gl_perf_query_object *obj);
864 void (*WaitPerfQuery)(struct gl_context *ctx,
865 struct gl_perf_query_object *obj);
866 bool (*IsPerfQueryReady)(struct gl_context *ctx,
867 struct gl_perf_query_object *obj);
868 void (*GetPerfQueryData)(struct gl_context *ctx,
869 struct gl_perf_query_object *obj,
870 GLsizei dataSize,
871 GLuint *data,
872 GLuint *bytesWritten);
873 /*@}*/
874
875
876 /**
877 * \name GREMEDY debug/marker functions
878 */
879 /*@{*/
880 void (*EmitStringMarker)(struct gl_context *ctx, const GLchar *string, GLsizei len);
881 /*@}*/
882
883 /**
884 * \name Support for multiple T&L engines
885 */
886 /*@{*/
887
888 /**
889 * Set by the driver-supplied T&L engine.
890 *
891 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
892 */
893 GLuint CurrentExecPrimitive;
894
895 /**
896 * Current glBegin state of an in-progress compilation. May be
897 * GL_POINTS, GL_TRIANGLE_STRIP, etc. or PRIM_OUTSIDE_BEGIN_END
898 * or PRIM_UNKNOWN.
899 */
900 GLuint CurrentSavePrimitive;
901
902
903 #define FLUSH_STORED_VERTICES 0x1
904 #define FLUSH_UPDATE_CURRENT 0x2
905 /**
906 * Set by the driver-supplied T&L engine whenever vertices are buffered
907 * between glBegin()/glEnd() objects or __struct gl_contextRec::Current
908 * is not updated. A bitmask of the FLUSH_x values above.
909 *
910 * The dd_function_table::FlushVertices call below may be used to resolve
911 * these conditions.
912 */
913 GLbitfield NeedFlush;
914
915 /** Need to call vbo_save_SaveFlushVertices() upon state change? */
916 GLboolean SaveNeedFlush;
917
918 /**
919 * Notify driver that the special derived value _NeedEyeCoords has
920 * changed.
921 */
922 void (*LightingSpaceChange)( struct gl_context *ctx );
923
924 /**@}*/
925
926 /**
927 * \name GL_ARB_sync interfaces
928 */
929 /*@{*/
930 struct gl_sync_object * (*NewSyncObject)(struct gl_context *);
931 void (*FenceSync)(struct gl_context *, struct gl_sync_object *,
932 GLenum, GLbitfield);
933 void (*DeleteSyncObject)(struct gl_context *, struct gl_sync_object *);
934 void (*CheckSync)(struct gl_context *, struct gl_sync_object *);
935 void (*ClientWaitSync)(struct gl_context *, struct gl_sync_object *,
936 GLbitfield, GLuint64);
937 void (*ServerWaitSync)(struct gl_context *, struct gl_sync_object *,
938 GLbitfield, GLuint64);
939 /*@}*/
940
941 /** GL_NV_conditional_render */
942 void (*BeginConditionalRender)(struct gl_context *ctx,
943 struct gl_query_object *q,
944 GLenum mode);
945 void (*EndConditionalRender)(struct gl_context *ctx,
946 struct gl_query_object *q);
947
948 /**
949 * \name GL_OES_draw_texture interface
950 */
951 /*@{*/
952 void (*DrawTex)(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
953 GLfloat width, GLfloat height);
954 /*@}*/
955
956 /**
957 * \name GL_OES_EGL_image interface
958 */
959 void (*EGLImageTargetTexture2D)(struct gl_context *ctx, GLenum target,
960 struct gl_texture_object *texObj,
961 struct gl_texture_image *texImage,
962 GLeglImageOES image_handle);
963 void (*EGLImageTargetRenderbufferStorage)(struct gl_context *ctx,
964 struct gl_renderbuffer *rb,
965 void *image_handle);
966
967 /**
968 * \name GL_EXT_transform_feedback interface
969 */
970 struct gl_transform_feedback_object *
971 (*NewTransformFeedback)(struct gl_context *ctx, GLuint name);
972 void (*DeleteTransformFeedback)(struct gl_context *ctx,
973 struct gl_transform_feedback_object *obj);
974 void (*BeginTransformFeedback)(struct gl_context *ctx, GLenum mode,
975 struct gl_transform_feedback_object *obj);
976 void (*EndTransformFeedback)(struct gl_context *ctx,
977 struct gl_transform_feedback_object *obj);
978 void (*PauseTransformFeedback)(struct gl_context *ctx,
979 struct gl_transform_feedback_object *obj);
980 void (*ResumeTransformFeedback)(struct gl_context *ctx,
981 struct gl_transform_feedback_object *obj);
982
983 /**
984 * Return the number of vertices written to a stream during the last
985 * Begin/EndTransformFeedback block.
986 */
987 GLsizei (*GetTransformFeedbackVertexCount)(struct gl_context *ctx,
988 struct gl_transform_feedback_object *obj,
989 GLuint stream);
990
991 /**
992 * \name GL_NV_texture_barrier interface
993 */
994 void (*TextureBarrier)(struct gl_context *ctx);
995
996 /**
997 * \name GL_ARB_sampler_objects
998 */
999 struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
1000 GLuint name);
1001
1002 /**
1003 * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query.
1004 * This should be equivalent to glGetInteger64v(GL_TIMESTAMP);
1005 */
1006 uint64_t (*GetTimestamp)(struct gl_context *ctx);
1007
1008 /**
1009 * \name GL_ARB_texture_multisample
1010 */
1011 void (*GetSamplePosition)(struct gl_context *ctx,
1012 struct gl_framebuffer *fb,
1013 GLuint index,
1014 GLfloat *outValue);
1015
1016 /**
1017 * \name NV_vdpau_interop interface
1018 */
1019 void (*VDPAUMapSurface)(struct gl_context *ctx, GLenum target,
1020 GLenum access, GLboolean output,
1021 struct gl_texture_object *texObj,
1022 struct gl_texture_image *texImage,
1023 const GLvoid *vdpSurface, GLuint index);
1024 void (*VDPAUUnmapSurface)(struct gl_context *ctx, GLenum target,
1025 GLenum access, GLboolean output,
1026 struct gl_texture_object *texObj,
1027 struct gl_texture_image *texImage,
1028 const GLvoid *vdpSurface, GLuint index);
1029
1030 /**
1031 * Query reset status for GL_ARB_robustness
1032 *
1033 * Per \c glGetGraphicsResetStatusARB, this function should return a
1034 * non-zero value once after a reset. If a reset is non-atomic, the
1035 * non-zero status should be returned for the duration of the reset.
1036 */
1037 GLenum (*GetGraphicsResetStatus)(struct gl_context *ctx);
1038
1039 /**
1040 * \name GL_ARB_shader_image_load_store interface.
1041 */
1042 /** @{ */
1043 void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers);
1044 /** @} */
1045
1046 /**
1047 * GL_EXT_shader_framebuffer_fetch_non_coherent rendering barrier.
1048 *
1049 * On return from this function any framebuffer contents written by
1050 * previous draw commands are guaranteed to be visible from subsequent
1051 * fragment shader invocations using the
1052 * EXT_shader_framebuffer_fetch_non_coherent interface.
1053 */
1054 /** @{ */
1055 void (*FramebufferFetchBarrier)(struct gl_context *ctx);
1056 /** @} */
1057
1058 /**
1059 * \name GL_ARB_compute_shader interface
1060 */
1061 /*@{*/
1062 void (*DispatchCompute)(struct gl_context *ctx, const GLuint *num_groups);
1063 void (*DispatchComputeIndirect)(struct gl_context *ctx, GLintptr indirect);
1064 /*@}*/
1065
1066 /**
1067 * \name GL_ARB_compute_variable_group_size interface
1068 */
1069 /*@{*/
1070 void (*DispatchComputeGroupSize)(struct gl_context *ctx,
1071 const GLuint *num_groups,
1072 const GLuint *group_size);
1073 /*@}*/
1074
1075 /**
1076 * Query information about memory. Device memory is e.g. VRAM. Staging
1077 * memory is e.g. GART. All sizes are in kilobytes.
1078 */
1079 void (*QueryMemoryInfo)(struct gl_context *ctx,
1080 struct gl_memory_info *info);
1081
1082 /**
1083 * Indicate that this thread is being used by Mesa as a background drawing
1084 * thread for the given GL context.
1085 *
1086 * If this function is called more than once from any given thread, each
1087 * subsequent call overrides the context that was passed in the previous
1088 * call. Mesa takes advantage of this to re-use a background thread to
1089 * perform drawing on behalf of multiple contexts.
1090 *
1091 * Mesa may sometimes call this function from a non-background thread
1092 * (i.e. a thread that has already been bound to a context using
1093 * __DriverAPIRec::MakeCurrent()); when this happens, ctx will be equal to
1094 * the context that is bound to this thread.
1095 *
1096 * Mesa will only call this function if GL multithreading is enabled.
1097 */
1098 void (*SetBackgroundContext)(struct gl_context *ctx,
1099 struct util_queue_monitoring *queue_info);
1100
1101 /**
1102 * \name GL_ARB_sparse_buffer interface
1103 */
1104 /*@{*/
1105 void (*BufferPageCommitment)(struct gl_context *ctx,
1106 struct gl_buffer_object *bufferObj,
1107 GLintptr offset, GLsizeiptr size,
1108 GLboolean commit);
1109 /*@}*/
1110
1111 /**
1112 * \name GL_ARB_bindless_texture interface
1113 */
1114 /*@{*/
1115 GLuint64 (*NewTextureHandle)(struct gl_context *ctx,
1116 struct gl_texture_object *texObj,
1117 struct gl_sampler_object *sampObj);
1118 void (*DeleteTextureHandle)(struct gl_context *ctx, GLuint64 handle);
1119 void (*MakeTextureHandleResident)(struct gl_context *ctx, GLuint64 handle,
1120 bool resident);
1121 GLuint64 (*NewImageHandle)(struct gl_context *ctx,
1122 struct gl_image_unit *imgObj);
1123 void (*DeleteImageHandle)(struct gl_context *ctx, GLuint64 handle);
1124 void (*MakeImageHandleResident)(struct gl_context *ctx, GLuint64 handle,
1125 GLenum access, bool resident);
1126 /*@}*/
1127
1128
1129 /**
1130 * \name GL_EXT_external_objects interface
1131 */
1132 /*@{*/
1133 /**
1134 * Called to allocate a new memory object. Drivers will usually
1135 * allocate/return a subclass of gl_memory_object.
1136 */
1137 struct gl_memory_object * (*NewMemoryObject)(struct gl_context *ctx,
1138 GLuint name);
1139 /**
1140 * Called to delete/free a memory object. Drivers should free the
1141 * object and any image data it contains.
1142 */
1143 void (*DeleteMemoryObject)(struct gl_context *ctx,
1144 struct gl_memory_object *memObj);
1145
1146 /**
1147 * Set the given memory object as the texture's storage.
1148 */
1149 GLboolean (*SetTextureStorageForMemoryObject)(struct gl_context *ctx,
1150 struct gl_texture_object *tex_obj,
1151 struct gl_memory_object *mem_obj,
1152 GLsizei levels, GLsizei width,
1153 GLsizei height, GLsizei depth,
1154 GLuint64 offset);
1155
1156 /**
1157 * Use a memory object as the backing data for a buffer object
1158 */
1159 GLboolean (*BufferDataMem)(struct gl_context *ctx,
1160 GLenum target,
1161 GLsizeiptrARB size,
1162 struct gl_memory_object *memObj,
1163 GLuint64 offset,
1164 GLenum usage,
1165 struct gl_buffer_object *bufObj);
1166
1167 /**
1168 * Fill uuid with an unique identifier for this driver
1169 *
1170 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory
1171 */
1172 void (*GetDriverUuid)(struct gl_context *ctx, char *uuid);
1173
1174 /**
1175 * Fill uuid with an unique identifier for the device associated
1176 * to this driver
1177 *
1178 * uuid must point to GL_UUID_SIZE_EXT bytes of available memory
1179 */
1180 void (*GetDeviceUuid)(struct gl_context *ctx, char *uuid);
1181
1182 /*@}*/
1183
1184 /**
1185 * \name GL_EXT_external_objects_fd interface
1186 */
1187 /*@{*/
1188 /**
1189 * Called to import a memory object. The caller relinquishes ownership
1190 * of fd after the call returns.
1191 *
1192 * Accessing fd after ImportMemoryObjectFd returns results in undefined
1193 * behaviour. This is consistent with EXT_external_object_fd.
1194 */
1195 void (*ImportMemoryObjectFd)(struct gl_context *ctx,
1196 struct gl_memory_object *memObj,
1197 GLuint64 size,
1198 int fd);
1199 /*@}*/
1200
1201 /**
1202 * \name GL_ARB_get_program_binary
1203 */
1204 /*@{*/
1205 /**
1206 * Calls to retrieve/store a binary serialized copy of the current program.
1207 */
1208 void (*GetProgramBinaryDriverSHA1)(struct gl_context *ctx, uint8_t *sha1);
1209
1210 void (*ProgramBinarySerializeDriverBlob)(struct gl_context *ctx,
1211 struct gl_program *prog);
1212
1213 void (*ProgramBinaryDeserializeDriverBlob)(struct gl_context *ctx,
1214 struct gl_shader_program *shProg,
1215 struct gl_program *prog);
1216 /*@}*/
1217
1218 /**
1219 * \name GL_EXT_semaphore interface
1220 */
1221 /*@{*/
1222 /**
1223 * Called to allocate a new semaphore object. Drivers will usually
1224 * allocate/return a subclass of gl_semaphore_object.
1225 */
1226 struct gl_semaphore_object * (*NewSemaphoreObject)(struct gl_context *ctx,
1227 GLuint name);
1228 /**
1229 * Called to delete/free a semaphore object. Drivers should free the
1230 * object and any associated resources.
1231 */
1232 void (*DeleteSemaphoreObject)(struct gl_context *ctx,
1233 struct gl_semaphore_object *semObj);
1234
1235 /**
1236 * Introduce an operation to wait for the semaphore object in the GL
1237 * server's command stream
1238 */
1239 void (*ServerWaitSemaphoreObject)(struct gl_context *ctx,
1240 struct gl_semaphore_object *semObj,
1241 GLuint numBufferBarriers,
1242 struct gl_buffer_object **bufObjs,
1243 GLuint numTextureBarriers,
1244 struct gl_texture_object **texObjs,
1245 const GLenum *srcLayouts);
1246
1247 /**
1248 * Introduce an operation to signal the semaphore object in the GL
1249 * server's command stream
1250 */
1251 void (*ServerSignalSemaphoreObject)(struct gl_context *ctx,
1252 struct gl_semaphore_object *semObj,
1253 GLuint numBufferBarriers,
1254 struct gl_buffer_object **bufObjs,
1255 GLuint numTextureBarriers,
1256 struct gl_texture_object **texObjs,
1257 const GLenum *dstLayouts);
1258 /*@}*/
1259
1260 /**
1261 * \name GL_EXT_semaphore_fd interface
1262 */
1263 /*@{*/
1264 /**
1265 * Called to import a semaphore object. The caller relinquishes ownership
1266 * of fd after the call returns.
1267 *
1268 * Accessing fd after ImportSemaphoreFd returns results in undefined
1269 * behaviour. This is consistent with EXT_semaphore_fd.
1270 */
1271 void (*ImportSemaphoreFd)(struct gl_context *ctx,
1272 struct gl_semaphore_object *semObj,
1273 int fd);
1274 /*@}*/
1275 };
1276
1277
1278 /**
1279 * Per-vertex functions.
1280 *
1281 * These are the functions which can appear between glBegin and glEnd.
1282 * Depending on whether we're inside or outside a glBegin/End pair
1283 * and whether we're in immediate mode or building a display list, these
1284 * functions behave differently. This structure allows us to switch
1285 * between those modes more easily.
1286 *
1287 * Generally, these pointers point to functions in the VBO module.
1288 */
1289 typedef struct {
1290 void (GLAPIENTRYP ArrayElement)( GLint );
1291 void (GLAPIENTRYP Color3f)( GLfloat, GLfloat, GLfloat );
1292 void (GLAPIENTRYP Color3fv)( const GLfloat * );
1293 void (GLAPIENTRYP Color4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1294 void (GLAPIENTRYP Color4fv)( const GLfloat * );
1295 void (GLAPIENTRYP EdgeFlag)( GLboolean );
1296 void (GLAPIENTRYP EvalCoord1f)( GLfloat );
1297 void (GLAPIENTRYP EvalCoord1fv)( const GLfloat * );
1298 void (GLAPIENTRYP EvalCoord2f)( GLfloat, GLfloat );
1299 void (GLAPIENTRYP EvalCoord2fv)( const GLfloat * );
1300 void (GLAPIENTRYP EvalPoint1)( GLint );
1301 void (GLAPIENTRYP EvalPoint2)( GLint, GLint );
1302 void (GLAPIENTRYP FogCoordfEXT)( GLfloat );
1303 void (GLAPIENTRYP FogCoordfvEXT)( const GLfloat * );
1304 void (GLAPIENTRYP Indexf)( GLfloat );
1305 void (GLAPIENTRYP Indexfv)( const GLfloat * );
1306 void (GLAPIENTRYP Materialfv)( GLenum face, GLenum pname, const GLfloat * );
1307 void (GLAPIENTRYP MultiTexCoord1fARB)( GLenum, GLfloat );
1308 void (GLAPIENTRYP MultiTexCoord1fvARB)( GLenum, const GLfloat * );
1309 void (GLAPIENTRYP MultiTexCoord2fARB)( GLenum, GLfloat, GLfloat );
1310 void (GLAPIENTRYP MultiTexCoord2fvARB)( GLenum, const GLfloat * );
1311 void (GLAPIENTRYP MultiTexCoord3fARB)( GLenum, GLfloat, GLfloat, GLfloat );
1312 void (GLAPIENTRYP MultiTexCoord3fvARB)( GLenum, const GLfloat * );
1313 void (GLAPIENTRYP MultiTexCoord4fARB)( GLenum, GLfloat, GLfloat, GLfloat, GLfloat );
1314 void (GLAPIENTRYP MultiTexCoord4fvARB)( GLenum, const GLfloat * );
1315 void (GLAPIENTRYP Normal3f)( GLfloat, GLfloat, GLfloat );
1316 void (GLAPIENTRYP Normal3fv)( const GLfloat * );
1317 void (GLAPIENTRYP SecondaryColor3fEXT)( GLfloat, GLfloat, GLfloat );
1318 void (GLAPIENTRYP SecondaryColor3fvEXT)( const GLfloat * );
1319 void (GLAPIENTRYP TexCoord1f)( GLfloat );
1320 void (GLAPIENTRYP TexCoord1fv)( const GLfloat * );
1321 void (GLAPIENTRYP TexCoord2f)( GLfloat, GLfloat );
1322 void (GLAPIENTRYP TexCoord2fv)( const GLfloat * );
1323 void (GLAPIENTRYP TexCoord3f)( GLfloat, GLfloat, GLfloat );
1324 void (GLAPIENTRYP TexCoord3fv)( const GLfloat * );
1325 void (GLAPIENTRYP TexCoord4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1326 void (GLAPIENTRYP TexCoord4fv)( const GLfloat * );
1327 void (GLAPIENTRYP Vertex2f)( GLfloat, GLfloat );
1328 void (GLAPIENTRYP Vertex2fv)( const GLfloat * );
1329 void (GLAPIENTRYP Vertex3f)( GLfloat, GLfloat, GLfloat );
1330 void (GLAPIENTRYP Vertex3fv)( const GLfloat * );
1331 void (GLAPIENTRYP Vertex4f)( GLfloat, GLfloat, GLfloat, GLfloat );
1332 void (GLAPIENTRYP Vertex4fv)( const GLfloat * );
1333 void (GLAPIENTRYP CallList)( GLuint );
1334 void (GLAPIENTRYP CallLists)( GLsizei, GLenum, const GLvoid * );
1335 void (GLAPIENTRYP Begin)( GLenum );
1336 void (GLAPIENTRYP End)( void );
1337 void (GLAPIENTRYP PrimitiveRestartNV)( void );
1338 /* Originally for GL_NV_vertex_program, now used only dlist.c and friends */
1339 void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x );
1340 void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v );
1341 void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y );
1342 void (GLAPIENTRYP VertexAttrib2fvNV)( GLuint index, const GLfloat *v );
1343 void (GLAPIENTRYP VertexAttrib3fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1344 void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
1345 void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1346 void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
1347 /* GL_ARB_vertex_program */
1348 void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
1349 void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
1350 void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
1351 void (GLAPIENTRYP VertexAttrib2fvARB)( GLuint index, const GLfloat *v );
1352 void (GLAPIENTRYP VertexAttrib3fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z );
1353 void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
1354 void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1355 void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
1356
1357 /* GL_EXT_gpu_shader4 / GL 3.0 */
1358 void (GLAPIENTRYP VertexAttribI1i)( GLuint index, GLint x);
1359 void (GLAPIENTRYP VertexAttribI2i)( GLuint index, GLint x, GLint y);
1360 void (GLAPIENTRYP VertexAttribI3i)( GLuint index, GLint x, GLint y, GLint z);
1361 void (GLAPIENTRYP VertexAttribI4i)( GLuint index, GLint x, GLint y, GLint z, GLint w);
1362 void (GLAPIENTRYP VertexAttribI2iv)( GLuint index, const GLint *v);
1363 void (GLAPIENTRYP VertexAttribI3iv)( GLuint index, const GLint *v);
1364 void (GLAPIENTRYP VertexAttribI4iv)( GLuint index, const GLint *v);
1365
1366 void (GLAPIENTRYP VertexAttribI1ui)( GLuint index, GLuint x);
1367 void (GLAPIENTRYP VertexAttribI2ui)( GLuint index, GLuint x, GLuint y);
1368 void (GLAPIENTRYP VertexAttribI3ui)( GLuint index, GLuint x, GLuint y, GLuint z);
1369 void (GLAPIENTRYP VertexAttribI4ui)( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1370 void (GLAPIENTRYP VertexAttribI2uiv)( GLuint index, const GLuint *v);
1371 void (GLAPIENTRYP VertexAttribI3uiv)( GLuint index, const GLuint *v);
1372 void (GLAPIENTRYP VertexAttribI4uiv)( GLuint index, const GLuint *v);
1373
1374 /* GL_ARB_vertex_type_10_10_10_2_rev / GL3.3 */
1375 void (GLAPIENTRYP VertexP2ui)( GLenum type, GLuint value );
1376 void (GLAPIENTRYP VertexP2uiv)( GLenum type, const GLuint *value);
1377
1378 void (GLAPIENTRYP VertexP3ui)( GLenum type, GLuint value );
1379 void (GLAPIENTRYP VertexP3uiv)( GLenum type, const GLuint *value);
1380
1381 void (GLAPIENTRYP VertexP4ui)( GLenum type, GLuint value );
1382 void (GLAPIENTRYP VertexP4uiv)( GLenum type, const GLuint *value);
1383
1384 void (GLAPIENTRYP TexCoordP1ui)( GLenum type, GLuint coords );
1385 void (GLAPIENTRYP TexCoordP1uiv)( GLenum type, const GLuint *coords );
1386
1387 void (GLAPIENTRYP TexCoordP2ui)( GLenum type, GLuint coords );
1388 void (GLAPIENTRYP TexCoordP2uiv)( GLenum type, const GLuint *coords );
1389
1390 void (GLAPIENTRYP TexCoordP3ui)( GLenum type, GLuint coords );
1391 void (GLAPIENTRYP TexCoordP3uiv)( GLenum type, const GLuint *coords );
1392
1393 void (GLAPIENTRYP TexCoordP4ui)( GLenum type, GLuint coords );
1394 void (GLAPIENTRYP TexCoordP4uiv)( GLenum type, const GLuint *coords );
1395
1396 void (GLAPIENTRYP MultiTexCoordP1ui)( GLenum texture, GLenum type, GLuint coords );
1397 void (GLAPIENTRYP MultiTexCoordP1uiv)( GLenum texture, GLenum type, const GLuint *coords );
1398 void (GLAPIENTRYP MultiTexCoordP2ui)( GLenum texture, GLenum type, GLuint coords );
1399 void (GLAPIENTRYP MultiTexCoordP2uiv)( GLenum texture, GLenum type, const GLuint *coords );
1400 void (GLAPIENTRYP MultiTexCoordP3ui)( GLenum texture, GLenum type, GLuint coords );
1401 void (GLAPIENTRYP MultiTexCoordP3uiv)( GLenum texture, GLenum type, const GLuint *coords );
1402 void (GLAPIENTRYP MultiTexCoordP4ui)( GLenum texture, GLenum type, GLuint coords );
1403 void (GLAPIENTRYP MultiTexCoordP4uiv)( GLenum texture, GLenum type, const GLuint *coords );
1404
1405 void (GLAPIENTRYP NormalP3ui)( GLenum type, GLuint coords );
1406 void (GLAPIENTRYP NormalP3uiv)( GLenum type, const GLuint *coords );
1407
1408 void (GLAPIENTRYP ColorP3ui)( GLenum type, GLuint color );
1409 void (GLAPIENTRYP ColorP3uiv)( GLenum type, const GLuint *color );
1410
1411 void (GLAPIENTRYP ColorP4ui)( GLenum type, GLuint color );
1412 void (GLAPIENTRYP ColorP4uiv)( GLenum type, const GLuint *color );
1413
1414 void (GLAPIENTRYP SecondaryColorP3ui)( GLenum type, GLuint color );
1415 void (GLAPIENTRYP SecondaryColorP3uiv)( GLenum type, const GLuint *color );
1416
1417 void (GLAPIENTRYP VertexAttribP1ui)( GLuint index, GLenum type,
1418 GLboolean normalized, GLuint value);
1419 void (GLAPIENTRYP VertexAttribP2ui)( GLuint index, GLenum type,
1420 GLboolean normalized, GLuint value);
1421 void (GLAPIENTRYP VertexAttribP3ui)( GLuint index, GLenum type,
1422 GLboolean normalized, GLuint value);
1423 void (GLAPIENTRYP VertexAttribP4ui)( GLuint index, GLenum type,
1424 GLboolean normalized, GLuint value);
1425 void (GLAPIENTRYP VertexAttribP1uiv)( GLuint index, GLenum type,
1426 GLboolean normalized,
1427 const GLuint *value);
1428 void (GLAPIENTRYP VertexAttribP2uiv)( GLuint index, GLenum type,
1429 GLboolean normalized,
1430 const GLuint *value);
1431 void (GLAPIENTRYP VertexAttribP3uiv)( GLuint index, GLenum type,
1432 GLboolean normalized,
1433 const GLuint *value);
1434 void (GLAPIENTRYP VertexAttribP4uiv)( GLuint index, GLenum type,
1435 GLboolean normalized,
1436 const GLuint *value);
1437
1438 /* GL_ARB_vertex_attrib_64bit / GL 4.1 */
1439 void (GLAPIENTRYP VertexAttribL1d)( GLuint index, GLdouble x);
1440 void (GLAPIENTRYP VertexAttribL2d)( GLuint index, GLdouble x, GLdouble y);
1441 void (GLAPIENTRYP VertexAttribL3d)( GLuint index, GLdouble x, GLdouble y, GLdouble z);
1442 void (GLAPIENTRYP VertexAttribL4d)( GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1443
1444
1445 void (GLAPIENTRYP VertexAttribL1dv)( GLuint index, const GLdouble *v);
1446 void (GLAPIENTRYP VertexAttribL2dv)( GLuint index, const GLdouble *v);
1447 void (GLAPIENTRYP VertexAttribL3dv)( GLuint index, const GLdouble *v);
1448 void (GLAPIENTRYP VertexAttribL4dv)( GLuint index, const GLdouble *v);
1449
1450 void (GLAPIENTRYP VertexAttribL1ui64ARB)( GLuint index, GLuint64EXT x);
1451 void (GLAPIENTRYP VertexAttribL1ui64vARB)( GLuint index, const GLuint64EXT *v);
1452 } GLvertexformat;
1453
1454
1455 #endif /* DD_INCLUDED */