Eliminate struct pipe_region.
[mesa.git] / src / mesa / pipe / p_context.h
index 33d187815805efc233f90303d04ac28112c414db..2420d02213ff7868a48a03079819432458561aaf 100644 (file)
 #include "p_state.h"
 
 struct pipe_state_cache;
+
+
 /**
- * Software pipeline rendering context.  Basically a collection of
- * state setting functions, plus VBO drawing entrypoint.
+ * Gallium rendering context.  Basically:
+ *  - state setting functions
+ *  - VBO drawing functions
+ *  - surface functions
+ *  - device queries
  */
 struct pipe_context {
    struct pipe_winsys *winsys;
 
+   void *priv;  /** context private data (for DRI for example) */
+
    void (*destroy)( struct pipe_context * );
 
    /*
@@ -46,17 +53,12 @@ struct pipe_context {
    boolean (*is_format_supported)( struct pipe_context *pipe,
                                    uint format );
 
-   void (*max_texture_size)(struct pipe_context *pipe,
-                            unsigned textureType, /* PIPE_TEXTURE_x */
-                            unsigned *maxWidth,
-                            unsigned *maxHeight,
-                            unsigned *maxDepth);
-
    const char *(*get_name)( struct pipe_context *pipe );
 
    const char *(*get_vendor)( struct pipe_context *pipe );
 
    int (*get_param)( struct pipe_context *pipe, int param );
+   float (*get_paramf)( struct pipe_context *pipe, int param );
 
 
    /*
@@ -153,7 +155,7 @@ struct pipe_context {
 
    void (*set_texture_state)( struct pipe_context *,
                               unsigned unit,
-                              struct pipe_mipmap_tree * );
+                              struct pipe_texture * );
 
    void (*set_viewport_state)( struct pipe_context *,
                                const struct pipe_viewport_state * );
@@ -178,7 +180,7 @@ struct pipe_context {
 
    /** Get a surface which is a "view" into a texture */
    struct pipe_surface *(*get_tex_surface)(struct pipe_context *pipe,
-                                           struct pipe_mipmap_tree *texture,
+                                           struct pipe_texture *texture,
                                            unsigned face, unsigned level,
                                            unsigned zslice);
 
@@ -200,43 +202,38 @@ struct pipe_context {
 
 
    /*
-    * Memory region functions
+    * Surface functions
     */
-   ubyte *(*region_map)(struct pipe_context *pipe, struct pipe_region *r);
-
-   void (*region_unmap)(struct pipe_context *pipe, struct pipe_region *r);
-
-   void (*region_data)(struct pipe_context *pipe,
-                       struct pipe_region *dest,
-                       unsigned dest_offset,
-                       unsigned destx, unsigned desty,
-                       const void *src, unsigned src_stride,
-                       unsigned srcx, unsigned srcy,
-                       unsigned width, unsigned height);
-
-   void (*region_copy)(struct pipe_context *pipe,
-                       struct pipe_region *dest,
-                       unsigned dest_offset,
-                       unsigned destx, unsigned desty,
-                       struct pipe_region *src,        /* don't make this const - 
-                                                  need to map/unmap */
-                       unsigned src_offset,
-                       unsigned srcx, unsigned srcy,
-                       unsigned width, unsigned height);
-
-   void (*region_fill)(struct pipe_context *pipe,
-                       struct pipe_region *dst,
-                       unsigned dst_offset,
-                       unsigned dstx, unsigned dsty,
-                       unsigned width, unsigned height,
-                       unsigned value);
+   void (*surface_data)(struct pipe_context *pipe,
+                       struct pipe_surface *dest,
+                       unsigned destx, unsigned desty,
+                       const void *src, unsigned src_stride,
+                       unsigned srcx, unsigned srcy,
+                       unsigned width, unsigned height);
+
+   void (*surface_copy)(struct pipe_context *pipe,
+                       struct pipe_surface *dest,
+                       unsigned destx, unsigned desty,
+                       struct pipe_surface *src, /* don't make this const - 
+                                                    need to map/unmap */
+                       unsigned srcx, unsigned srcy,
+                       unsigned width, unsigned height);
+
+   void (*surface_fill)(struct pipe_context *pipe,
+                       struct pipe_surface *dst,
+                       unsigned dstx, unsigned dsty,
+                       unsigned width, unsigned height,
+                       unsigned value);
 
 
    /*
     * Texture functions
     */
-   boolean (*mipmap_tree_layout)( struct pipe_context *pipe,
-                                 struct pipe_mipmap_tree *mt );
+   void (*texture_create)(struct pipe_context *pipe,
+                         struct pipe_texture **pt);
+
+   void (*texture_release)(struct pipe_context *pipe,
+                          struct pipe_texture **pt);
 
 
    /* Flush rendering: