mesa/cs: Add DispatchCompute() to driver function table.
[mesa.git] / src / mesa / main / dd.h
index ac317e39950a262decb5ff6ff5f0b731c702a08e..a329d9c5340f192882f68ee5fa05eae997a639c6 100644 (file)
@@ -238,6 +238,20 @@ struct dd_function_table {
                         GLenum format, GLenum type, GLvoid *pixels,
                         struct gl_texture_image *texImage );
 
+   /**
+    * Called by glClearTex[Sub]Image
+    *
+    * Clears a rectangular region of the image to a given value. The
+    * clearValue argument is either NULL or points to a single texel to use as
+    * the clear value in the same internal format as the texture image. If it
+    * is NULL then the texture should be cleared to zeroes.
+    */
+   void (*ClearTexSubImage)(struct gl_context *ctx,
+                            struct gl_texture_image *texImage,
+                            GLint xoffset, GLint yoffset, GLint zoffset,
+                            GLsizei width, GLsizei height, GLsizei depth,
+                            const GLvoid *clearValue);
+
    /**
     * Called by glCopyTex[Sub]Image[123]D().
     *
@@ -254,6 +268,22 @@ struct dd_function_table {
                            GLint x, GLint y,
                            GLsizei width, GLsizei height);
 
+   /**
+    * Called by glCopyImageSubData().
+    *
+    * This function should copy one 2-D slice from srcTexImage to
+    * dstTexImage.  If one of the textures is 3-D or is a 1-D or 2-D array
+    * texture, this function will be called multiple times: once for each
+    * slice.  If one of the textures is a cube map, this function will be
+    * called once for each face to be copied.
+    */
+   void (*CopyImageSubData)(struct gl_context *ctx,
+                            struct gl_texture_image *src_image,
+                            int src_x, int src_y, int src_z,
+                            struct gl_texture_image *dstTexImage,
+                            int dst_x, int dst_y, int dst_z,
+                            int src_width, int src_height);
+
    /**
     * Called by glGenerateMipmap() or when GL_GENERATE_MIPMAP_SGIS is enabled.
     * Note that if the texture is a cube map, the <target> parameter will
@@ -314,10 +344,10 @@ struct dd_function_table {
    /*@{*/
 
    /**
-    * Called by glBindTexture().
+    * Called by glBindTexture() and glBindTextures().
     */
-   void (*BindTexture)( struct gl_context *ctx, GLenum target,
-                        struct gl_texture_object *tObj );
+   void (*BindTexture)( struct gl_context *ctx, GLuint texUnit,
+                        GLenum target, struct gl_texture_object *tObj );
 
    /**
     * Called to allocate a new texture object.  Drivers will usually
@@ -385,6 +415,22 @@ struct dd_function_table {
                             struct gl_texture_object *texObj,
                             struct gl_texture_object *origTexObj);
 
+   /** Sets the given buffer object as the texture's storage.  The given
+    * texture must have target GL_TEXTURE_1D, GL_TEXTURE_2D,
+    * GL_TEXTURE_RECTANGLE, and GL_TEXTURE_2D_ARRAY; have only a single
+    * mipmap level; be immutable; and must not have any assigned storage.
+    * The format and dimensions of the gl_texture_object will already be
+    * initialized.
+    *
+    * This function is used by the meta PBO texture upload path.
+    */
+   bool (*SetTextureStorageForBufferObject)(struct gl_context *ctx,
+                                            struct gl_texture_object *texObj,
+                                            struct gl_buffer_object *bufferObj,
+                                            uint32_t buffer_offset,
+                                            uint32_t row_stride,
+                                            bool read_only);
+
    /**
     * Map a renderbuffer into user space.
     * \param mode  bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and
@@ -399,6 +445,13 @@ struct dd_function_table {
    void (*UnmapRenderbuffer)(struct gl_context *ctx,
                             struct gl_renderbuffer *rb);
 
+   /**
+    * Optional driver entrypoint that binds a non-texture renderbuffer's
+    * contents to a texture image.
+    */
+   GLboolean (*BindRenderbufferTexImage)(struct gl_context *ctx,
+                                         struct gl_renderbuffer *rb,
+                                         struct gl_texture_image *texImage);
    /*@}*/
 
 
@@ -526,7 +579,7 @@ struct dd_function_table {
    /** Select a polygon rasterization mode */
    void (*PolygonMode)(struct gl_context *ctx, GLenum face, GLenum mode);
    /** Set the scale and units used to calculate depth values */
-   void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units);
+   void (*PolygonOffset)(struct gl_context *ctx, GLfloat factor, GLfloat units, GLfloat clamp);
    /** Set the polygon stippling pattern */
    void (*PolygonStipple)(struct gl_context *ctx, const GLubyte *mask );
    /* Specifies the current buffer for reading */
@@ -564,17 +617,14 @@ struct dd_function_table {
     * \name Vertex/pixel buffer object functions
     */
    /*@{*/
-   void (*BindBuffer)( struct gl_context *ctx, GLenum target,
-                      struct gl_buffer_object *obj );
-
    struct gl_buffer_object * (*NewBufferObject)(struct gl_context *ctx,
-                                                GLuint buffer, GLenum target);
+                                                GLuint buffer);
    
    void (*DeleteBuffer)( struct gl_context *ctx, struct gl_buffer_object *obj );
 
    GLboolean (*BufferData)(struct gl_context *ctx, GLenum target,
                            GLsizeiptrARB size, const GLvoid *data, GLenum usage,
-                           struct gl_buffer_object *obj);
+                           GLenum storageFlags, struct gl_buffer_object *obj);
 
    void (*BufferSubData)( struct gl_context *ctx, GLintptrARB offset,
                          GLsizeiptrARB size, const GLvoid *data,
@@ -601,14 +651,17 @@ struct dd_function_table {
     */
    void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
                              GLsizeiptr length, GLbitfield access,
-                             struct gl_buffer_object *obj);
+                             struct gl_buffer_object *obj,
+                             gl_map_buffer_index index);
 
    void (*FlushMappedBufferRange)(struct gl_context *ctx,
                                   GLintptr offset, GLsizeiptr length,
-                                  struct gl_buffer_object *obj);
+                                  struct gl_buffer_object *obj,
+                                  gl_map_buffer_index index);
 
    GLboolean (*UnmapBuffer)( struct gl_context *ctx,
-                            struct gl_buffer_object *obj );
+                            struct gl_buffer_object *obj,
+                             gl_map_buffer_index index);
    /*@}*/
 
    /**
@@ -660,6 +713,8 @@ struct dd_function_table {
                                struct gl_framebuffer *fb);
    /*@}*/
    void (*BlitFramebuffer)(struct gl_context *ctx,
+                           struct gl_framebuffer *readFb,
+                           struct gl_framebuffer *drawFb,
                            GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
                            GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
                            GLbitfield mask, GLenum filter);
@@ -721,8 +776,7 @@ struct dd_function_table {
    struct gl_shader *(*NewShader)(struct gl_context *ctx,
                                   GLuint name, GLenum type);
    void (*DeleteShader)(struct gl_context *ctx, struct gl_shader *shader);
-   struct gl_shader_program *(*NewShaderProgram)(struct gl_context *ctx,
-                                                 GLuint name);
+   struct gl_shader_program *(*NewShaderProgram)(GLuint name);
    void (*DeleteShaderProgram)(struct gl_context *ctx,
                                struct gl_shader_program *shProg);
    void (*UseProgram)(struct gl_context *ctx, struct gl_shader_program *shProg);
@@ -770,7 +824,7 @@ struct dd_function_table {
    void (*BeginVertices)( struct gl_context *ctx );
 
    /**
-    * If inside glBegin()/glEnd(), it should ASSERT(0).  Otherwise, if
+    * If inside glBegin()/glEnd(), it should assert(0).  Otherwise, if
     * FLUSH_STORED_VERTICES bit in \p flags is set flushes any buffered
     * vertices, if FLUSH_UPDATE_CURRENT bit is set updates
     * __struct gl_contextRec::Current and gl_light_attrib::Material
@@ -951,6 +1005,13 @@ struct dd_function_table {
 
    void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers);
    /** @} */
+
+   /**
+    * \name GL_ARB_compute_shader interface
+    */
+   /*@{*/
+   void (*DispatchCompute)(struct gl_context *ctx, const GLuint *num_groups);
+   /*@}*/
 };