Merge branch '7.8'
[mesa.git] / src / gallium / include / pipe / p_context.h
index f3ee0954481a2a3996f5c3dfd83c10a589cf4ec4..d1b734a9f9a3247f72d84c03320e2fe90d80d814 100644 (file)
@@ -122,6 +122,11 @@ struct pipe_context {
    void (*begin_query)(struct pipe_context *pipe, struct pipe_query *q);
    void (*end_query)(struct pipe_context *pipe, struct pipe_query *q);
 
+   /**
+    * Get results of a query.
+    * \param wait  if true, this query will block until the result is ready
+    * \return TRUE if results are ready, FALSE otherwise
+    */
    boolean (*get_query_result)(struct pipe_context *pipe, 
                                struct pipe_query *q,
                                boolean wait,
@@ -172,6 +177,12 @@ struct pipe_context {
    void   (*bind_gs_state)(struct pipe_context *, void *);
    void   (*delete_gs_state)(struct pipe_context *, void *);
 
+   void * (*create_vertex_elements_state)(struct pipe_context *,
+                                          unsigned num_elements,
+                                          const struct pipe_vertex_element *);
+   void   (*bind_vertex_elements_state)(struct pipe_context *, void *);
+   void   (*delete_vertex_elements_state)(struct pipe_context *, void *);
+
    /*@}*/
 
    /**
@@ -181,8 +192,11 @@ struct pipe_context {
    void (*set_blend_color)( struct pipe_context *,
                             const struct pipe_blend_color * );
 
+   void (*set_stencil_ref)( struct pipe_context *,
+                            const struct pipe_stencil_ref * );
+
    void (*set_clip_state)( struct pipe_context *,
-                          const struct pipe_clip_state * );
+                            const struct pipe_clip_state * );
 
    void (*set_constant_buffer)( struct pipe_context *,
                                 uint shader, uint index,
@@ -200,21 +214,18 @@ struct pipe_context {
    void (*set_viewport_state)( struct pipe_context *,
                                const struct pipe_viewport_state * );
 
-   void (*set_fragment_sampler_textures)(struct pipe_context *,
-                                         unsigned num_textures,
-                                         struct pipe_texture **);
+   void (*set_fragment_sampler_views)(struct pipe_context *,
+                                      unsigned num_views,
+                                      struct pipe_sampler_view **);
 
-   void (*set_vertex_sampler_textures)(struct pipe_context *,
-                                       unsigned num_textures,
-                                       struct pipe_texture **);
+   void (*set_vertex_sampler_views)(struct pipe_context *,
+                                    unsigned num_views,
+                                    struct pipe_sampler_view **);
 
    void (*set_vertex_buffers)( struct pipe_context *,
                                unsigned num_buffers,
                                const struct pipe_vertex_buffer * );
 
-   void (*set_vertex_elements)( struct pipe_context *,
-                                unsigned num_elements,
-                                const struct pipe_vertex_element * );
    /*@}*/
 
 
@@ -295,6 +306,42 @@ struct pipe_context {
     */
    unsigned int (*is_buffer_referenced)(struct pipe_context *pipe,
                                        struct pipe_buffer *buf);
+
+   /**
+    * Create a view on a texture to be used by a shader stage.
+    */
+   struct pipe_sampler_view * (*create_sampler_view)(struct pipe_context *ctx,
+                                                     struct pipe_texture *texture,
+                                                     const struct pipe_sampler_view *templat);
+
+   void (*sampler_view_destroy)(struct pipe_context *ctx,
+                                struct pipe_sampler_view *view);
+
+
+   /**
+    * Get a transfer object for transferring data to/from a texture.
+    *
+    * Transfers are (by default) context-private and allow uploads to be
+    * interleaved with
+    */
+   struct pipe_transfer *(*get_tex_transfer)(struct pipe_context *,
+                                             struct pipe_texture *texture,
+                                             unsigned face, unsigned level,
+                                             unsigned zslice,
+                                             enum pipe_transfer_usage usage,
+                                             unsigned x, unsigned y,
+                                             unsigned w, unsigned h);
+
+   void (*tex_transfer_destroy)(struct pipe_context *,
+                                struct pipe_transfer *);
+   
+   void *(*transfer_map)( struct pipe_context *,
+                          struct pipe_transfer *transfer );
+
+   void (*transfer_unmap)( struct pipe_context *,
+                           struct pipe_transfer *transfer );
+
+
 };