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