Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / auxiliary / cso_cache / cso_context.h
index 6aa619abf5637ed48b2b0f4a498a934f17ba426b..69630e98bae151073a21e3f8c5a4c0784e04c4a0 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
+#include "pipe/p_defines.h"
 
 
 #ifdef __cplusplus
@@ -41,54 +42,100 @@ struct cso_context;
 
 struct cso_context *cso_create_context( struct pipe_context *pipe );
 
-void cso_set_blend( struct cso_context *cso,
-                    const struct pipe_blend_state *blend );
+void cso_release_all( struct cso_context *ctx );
 
-void cso_unset_blend(struct cso_context *cso);
+void cso_destroy_context( struct cso_context *cso );
+
+
+
+enum pipe_error cso_set_blend( struct cso_context *cso,
+                               const struct pipe_blend_state *blend );
+void cso_save_blend(struct cso_context *cso);
+void cso_restore_blend(struct cso_context *cso);
 
-void cso_set_depth_stencil_alpha( struct cso_context *cso,
-                                  const struct pipe_depth_stencil_alpha_state *dsa );
 
-void cso_unset_depth_stencil_alpha( struct cso_context *cso );
 
-void cso_set_rasterizer( struct cso_context *cso,
-                         const struct pipe_rasterizer_state *rasterizer );
+enum pipe_error cso_set_depth_stencil_alpha( struct cso_context *cso,
+                                             const struct pipe_depth_stencil_alpha_state *dsa );
+void cso_save_depth_stencil_alpha(struct cso_context *cso);
+void cso_restore_depth_stencil_alpha(struct cso_context *cso);
 
-void cso_unset_rasterizer( struct cso_context *cso );
 
-void cso_set_samplers( struct cso_context *cso,
-                       unsigned count,
-                       const struct pipe_sampler_state **states );
 
-void cso_unset_samplers( struct cso_context *cso );
+enum pipe_error cso_set_rasterizer( struct cso_context *cso,
+                                    const struct pipe_rasterizer_state *rasterizer );
+void cso_save_rasterizer(struct cso_context *cso);
+void cso_restore_rasterizer(struct cso_context *cso);
 
 
+
+enum pipe_error cso_set_samplers( struct cso_context *cso,
+                                  unsigned count,
+                                  const struct pipe_sampler_state **states );
+void cso_save_samplers(struct cso_context *cso);
+void cso_restore_samplers(struct cso_context *cso);
+
 /* Alternate interface to support state trackers that like to modify
  * samplers one at a time:
  */
-void cso_single_sampler( struct cso_context *cso,
-                         unsigned nr,
-                         const struct pipe_sampler_state *states );
+enum pipe_error cso_single_sampler( struct cso_context *cso,
+                                    unsigned nr,
+                                    const struct pipe_sampler_state *states );
 
 void cso_single_sampler_done( struct cso_context *cso );
 
 
+
+enum pipe_error cso_set_sampler_textures( struct cso_context *cso,
+                                          uint count,
+                                          struct pipe_texture **textures );
+void cso_save_sampler_textures( struct cso_context *cso );
+void cso_restore_sampler_textures( struct cso_context *cso );
+
+
+
 /* These aren't really sensible -- most of the time the api provides
  * object semantics for shaders anyway, and the cases where it doesn't
  * (eg mesa's internall-generated texenv programs), it will be up to
  * the state tracker to implement their own specialized caching.
  */
-void cso_set_fragment_shader( struct cso_context *cso,
-                              const struct pipe_shader_state *shader );
+enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
+                                               void *handle );
+void cso_delete_fragment_shader(struct cso_context *ctx, void *handle );
+/*
+enum pipe_error cso_set_fragment_shader( struct cso_context *cso,
+                                         const struct pipe_shader_state *shader );
+*/
+void cso_save_fragment_shader(struct cso_context *cso);
+void cso_restore_fragment_shader(struct cso_context *cso);
 
-void cso_unset_fragment_shader( struct cso_context *cso );
 
-void cso_set_vertex_shader( struct cso_context *cso,
-                            const struct pipe_shader_state *shader );
+enum pipe_error cso_set_vertex_shader_handle(struct cso_context *ctx,
+                                             void *handle );
+void cso_delete_vertex_shader(struct cso_context *ctx, void *handle );
+/*
+enum pipe_error cso_set_vertex_shader( struct cso_context *cso,
+                                       const struct pipe_shader_state *shader );
+*/
+void cso_save_vertex_shader(struct cso_context *cso);
+void cso_restore_vertex_shader(struct cso_context *cso);
 
-void cso_unset_vertex_shader( struct cso_context *cso );
 
-void cso_destroy_context( struct cso_context *cso );
+
+enum pipe_error cso_set_framebuffer(struct cso_context *cso,
+                                    const struct pipe_framebuffer_state *fb);
+void cso_save_framebuffer(struct cso_context *cso);
+void cso_restore_framebuffer(struct cso_context *cso);
+
+
+enum pipe_error cso_set_viewport(struct cso_context *cso,
+                                 const struct pipe_viewport_state *vp);
+void cso_save_viewport(struct cso_context *cso);
+void cso_restore_viewport(struct cso_context *cso);
+
+
+enum pipe_error cso_set_blend_color(struct cso_context *cso,
+                                    const struct pipe_blend_color *bc);
 
 
 #ifdef __cplusplus