mesa/main: Make FEATURE_histogram follow feature conventions.
[mesa.git] / src / mesa / main / dd.h
index ce33905af132c225f12de9d817f2289e8b16282c..ce5e158626616b0573671a76476775f22beec131 100644 (file)
 /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
 
 struct gl_pixelstore_attrib;
-struct mesa_display_list;
+struct gl_display_list;
+
+#if FEATURE_ARB_vertex_buffer_object
+/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
+ * NULL) if buffer is unavailable for immediate mapping.
+ *
+ * Does GL_MAP_INVALIDATE_RANGE_BIT do this?  It seems so, but it
+ * would require more book-keeping in the driver than seems necessary
+ * at this point.
+ *
+ * Does GL_MAP_INVALDIATE_BUFFER_BIT do this?  Not really -- we don't
+ * want to provoke the driver to throw away the old storage, we will
+ * respect the contents of already referenced data.
+ */
+#define MESA_MAP_NOWAIT_BIT       0x0040
+#endif
+
 
 /**
  * Device driver function table.
@@ -110,6 +126,11 @@ struct dd_function_table {
    void (*Accum)( GLcontext *ctx, GLenum op, GLfloat value );
 
 
+   /**
+    * Execute glRasterPos, updating the ctx->Current.Raster fields
+    */
+   void (*RasterPos)( GLcontext *ctx, const GLfloat v[4] );
+
    /**
     * \name Image-related functions
     */
@@ -327,6 +348,12 @@ struct dd_function_table {
                               GLint x, GLint y,
                               GLsizei width, GLsizei height );
 
+   /**
+    * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
+    */
+   void (*GenerateMipmap)(GLcontext *ctx, GLenum target,
+                          struct gl_texture_object *texObj);
+
    /**
     * Called by glTexImage[123]D when user specifies a proxy texture
     * target.  
@@ -575,9 +602,6 @@ struct dd_function_table {
    /** Notify driver that a program string has been specified. */
    void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, 
                               struct gl_program *prog);
-   /** Get value of a program register during program execution. */
-   void (*GetProgramRegister)(GLcontext *ctx, enum register_file file,
-                              GLuint index, GLfloat val[4]);
 
    /** Query if program can be loaded onto hardware */
    GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, 
@@ -742,6 +766,8 @@ struct dd_function_table {
    /** Return the value or values of a selected parameter */
    GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result);
    /** Return the value or values of a selected parameter */
+   GLboolean (*GetInteger64v)(GLcontext *ctx, GLenum pname, GLint64 *result);
+   /** Return the value or values of a selected parameter */
    GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result);
    /*@}*/
    
@@ -759,9 +785,9 @@ struct dd_function_table {
    
    void (*DeleteBuffer)( GLcontext *ctx, struct gl_buffer_object *obj );
 
-   void (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
-                      const GLvoid *data, GLenum usage,
-                      struct gl_buffer_object *obj );
+   GLboolean (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
+                            const GLvoid *data, GLenum usage,
+                            struct gl_buffer_object *obj );
 
    void (*BufferSubData)( GLcontext *ctx, GLenum target, GLintptrARB offset,
                          GLsizeiptrARB size, const GLvoid *data,
@@ -774,6 +800,22 @@ struct dd_function_table {
    void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access,
                        struct gl_buffer_object *obj );
 
+   void (*CopyBufferSubData)( GLcontext *ctx,
+                              struct gl_buffer_object *src,
+                              struct gl_buffer_object *dst,
+                              GLintptr readOffset, GLintptr writeOffset,
+                              GLsizeiptr size );
+
+   /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
+    */
+   void * (*MapBufferRange)( GLcontext *ctx, GLenum target,
+                             GLintptr offset, GLsizeiptr length, GLbitfield access,
+                             struct gl_buffer_object *obj);
+
+   void (*FlushMappedBufferRange) (GLcontext *ctx, GLenum target, 
+                                   GLintptr offset, GLsizeiptr length,
+                                   struct gl_buffer_object *obj);
+
    GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target,
                             struct gl_buffer_object *obj );
    /*@}*/
@@ -797,6 +839,8 @@ struct dd_function_table {
                          struct gl_renderbuffer_attachment *att);
    void (*FinishRenderTexture)(GLcontext *ctx,
                                struct gl_renderbuffer_attachment *att);
+   void (*ValidateFramebuffer)(GLcontext *ctx,
+                               struct gl_framebuffer *fb);
    /*@}*/
 #endif
 #if FEATURE_EXT_framebuffer_blit
@@ -811,9 +855,11 @@ struct dd_function_table {
     */
    /*@{*/
    struct gl_query_object * (*NewQueryObject)(GLcontext *ctx, GLuint id);
-   void (*BeginQuery)(GLcontext *ctx, GLenum target,
-                      struct gl_query_object *q);
-   void (*EndQuery)(GLcontext *ctx, GLenum target, struct gl_query_object *q);
+   void (*DeleteQuery)(GLcontext *ctx, struct gl_query_object *q);
+   void (*BeginQuery)(GLcontext *ctx, struct gl_query_object *q);
+   void (*EndQuery)(GLcontext *ctx, struct gl_query_object *q);
+   void (*CheckQuery)(GLcontext *ctx, struct gl_query_object *q);
+   void (*WaitQuery)(GLcontext *ctx, struct gl_query_object *q);
    /*@}*/
 
 
@@ -862,6 +908,8 @@ struct dd_function_table {
                            GLsizei *length, GLcharARB *sourceOut);
    void (*GetUniformfv)(GLcontext *ctx, GLuint program, GLint location,
                         GLfloat *params);
+   void (*GetUniformiv)(GLcontext *ctx, GLuint program, GLint location,
+                        GLint *params);
    GLint (*GetUniformLocation)(GLcontext *ctx, GLuint program,
                                const GLcharARB *name);
    GLboolean (*IsProgram)(GLcontext *ctx, GLuint name);
@@ -871,7 +919,7 @@ struct dd_function_table {
    void (*Uniform)(GLcontext *ctx, GLint location, GLsizei count,
                    const GLvoid *values, GLenum type);
    void (*UniformMatrix)(GLcontext *ctx, GLint cols, GLint rows,
-                         GLenum matrixType, GLint location, GLsizei count,
+                         GLint location, GLsizei count,
                          GLboolean transpose, const GLfloat *values);
    void (*UseProgram)(GLcontext *ctx, GLuint program);
    void (*ValidateProgram)(GLcontext *ctx, GLuint program);
@@ -904,9 +952,9 @@ struct dd_function_table {
    void (*ValidateTnlModule)( GLcontext *ctx, GLuint new_state );
 
 
-#define PRIM_OUTSIDE_BEGIN_END   GL_POLYGON+1
-#define PRIM_INSIDE_UNKNOWN_PRIM GL_POLYGON+2
-#define PRIM_UNKNOWN             GL_POLYGON+3
+#define PRIM_OUTSIDE_BEGIN_END   (GL_POLYGON+1)
+#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2)
+#define PRIM_UNKNOWN             (GL_POLYGON+3)
 
    /**
     * Set by the driver-supplied T&L engine.  
@@ -937,6 +985,12 @@ struct dd_function_table {
    GLuint NeedFlush;
    GLuint SaveNeedFlush;
 
+
+   /* Called prior to any of the GLvertexformat functions being
+    * called.  Paired with Driver.FlushVertices().
+    */
+   void (*BeginVertices)( GLcontext *ctx );
+
    /**
     * If inside glBegin()/glEnd(), it should ASSERT(0).  Otherwise, if
     * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
@@ -982,7 +1036,7 @@ struct dd_function_table {
     * Notify the T&L component before and after calling a display list.
     */
    void (*BeginCallList)( GLcontext *ctx, 
-                         struct mesa_display_list *dlist );
+                         struct gl_display_list *dlist );
    /**
     * Called by glEndCallList().
     *
@@ -990,6 +1044,22 @@ struct dd_function_table {
     */
    void (*EndCallList)( GLcontext *ctx );
 
+
+#if FEATURE_ARB_sync
+   /**
+    * \name GL_ARB_sync interfaces
+    */
+   /*@{*/
+   struct gl_sync_object * (*NewSyncObject)(GLcontext *, GLenum);
+   void (*FenceSync)(GLcontext *, struct gl_sync_object *, GLenum, GLbitfield);
+   void (*DeleteSyncObject)(GLcontext *, struct gl_sync_object *);
+   void (*CheckSync)(GLcontext *, struct gl_sync_object *);
+   void (*ClientWaitSync)(GLcontext *, struct gl_sync_object *,
+                         GLbitfield, GLuint64);
+   void (*ServerWaitSync)(GLcontext *, struct gl_sync_object *,
+                         GLbitfield, GLuint64);
+   /*@}*/
+#endif
 };
 
 
@@ -1098,6 +1168,25 @@ typedef struct {
    void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
                              GLuint end, GLsizei count,
                              GLenum type, const GLvoid *indices );
+   void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
+                                           GLenum type,
+                                           const GLvoid **indices,
+                                           GLsizei primcount);
+   void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
+                                             GLenum type,
+                                             const GLvoid *indices,
+                                             GLint basevertex );
+   void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
+                                                  GLuint end, GLsizei count,
+                                                  GLenum type,
+                                                  const GLvoid *indices,
+                                                  GLint basevertex);
+   void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
+                                                  const GLsizei *count,
+                                                  GLenum type,
+                                                  const GLvoid **indices,
+                                                  GLsizei primcount,
+                                                  const GLint *basevertex);
    /*@}*/
 
    /**