cso_context.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
00004  * All Rights Reserved.
00005  *
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  *
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00021  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00022  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00023  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00024  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  *
00026  **************************************************************************/
00027 
00028 
00029 #ifndef CSO_CONTEXT_H
00030 #define CSO_CONTEXT_H
00031 
00032 #include "pipe/p_context.h"
00033 #include "pipe/p_state.h"
00034 #include "pipe/p_error.h"
00035 
00036 
00037 #ifdef  __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 struct cso_context;
00042 
00043 struct cso_context *cso_create_context( struct pipe_context *pipe );
00044 
00045 void cso_release_all( struct cso_context *ctx );
00046 
00047 void cso_destroy_context( struct cso_context *cso );
00048 
00049 
00050 
00051 enum pipe_error cso_set_blend( struct cso_context *cso,
00052                                const struct pipe_blend_state *blend );
00053 void cso_save_blend(struct cso_context *cso);
00054 void cso_restore_blend(struct cso_context *cso);
00055 
00056 
00057 
00058 enum pipe_error cso_set_depth_stencil_alpha( struct cso_context *cso,
00059                                              const struct pipe_depth_stencil_alpha_state *dsa );
00060 void cso_save_depth_stencil_alpha(struct cso_context *cso);
00061 void cso_restore_depth_stencil_alpha(struct cso_context *cso);
00062 
00063 
00064 
00065 enum pipe_error cso_set_rasterizer( struct cso_context *cso,
00066                                     const struct pipe_rasterizer_state *rasterizer );
00067 void cso_save_rasterizer(struct cso_context *cso);
00068 void cso_restore_rasterizer(struct cso_context *cso);
00069 
00070 
00071 
00072 enum pipe_error cso_set_samplers( struct cso_context *cso,
00073                                   unsigned count,
00074                                   const struct pipe_sampler_state **states );
00075 void cso_save_samplers(struct cso_context *cso);
00076 void cso_restore_samplers(struct cso_context *cso);
00077 
00078 /* Alternate interface to support state trackers that like to modify
00079  * samplers one at a time:
00080  */
00081 enum pipe_error cso_single_sampler( struct cso_context *cso,
00082                                     unsigned nr,
00083                                     const struct pipe_sampler_state *states );
00084 
00085 void cso_single_sampler_done( struct cso_context *cso );
00086 
00087 
00088 
00089 enum pipe_error cso_set_sampler_textures( struct cso_context *cso,
00090                                           uint count,
00091                                           struct pipe_texture **textures );
00092 void cso_save_sampler_textures( struct cso_context *cso );
00093 void cso_restore_sampler_textures( struct cso_context *cso );
00094 
00095 
00096 
00097 /* These aren't really sensible -- most of the time the api provides
00098  * object semantics for shaders anyway, and the cases where it doesn't
00099  * (eg mesa's internall-generated texenv programs), it will be up to
00100  * the state tracker to implement their own specialized caching.
00101  */
00102 enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
00103                                                void *handle );
00104 void cso_delete_fragment_shader(struct cso_context *ctx, void *handle );
00105 /*
00106 enum pipe_error cso_set_fragment_shader( struct cso_context *cso,
00107                                          const struct pipe_shader_state *shader );
00108 */
00109 void cso_save_fragment_shader(struct cso_context *cso);
00110 void cso_restore_fragment_shader(struct cso_context *cso);
00111 
00112 
00113 enum pipe_error cso_set_vertex_shader_handle(struct cso_context *ctx,
00114                                              void *handle );
00115 void cso_delete_vertex_shader(struct cso_context *ctx, void *handle );
00116 /*
00117 enum pipe_error cso_set_vertex_shader( struct cso_context *cso,
00118                                        const struct pipe_shader_state *shader );
00119 */
00120 void cso_save_vertex_shader(struct cso_context *cso);
00121 void cso_restore_vertex_shader(struct cso_context *cso);
00122 
00123 
00124 
00125 enum pipe_error cso_set_framebuffer(struct cso_context *cso,
00126                                     const struct pipe_framebuffer_state *fb);
00127 void cso_save_framebuffer(struct cso_context *cso);
00128 void cso_restore_framebuffer(struct cso_context *cso);
00129 
00130 
00131 enum pipe_error cso_set_viewport(struct cso_context *cso,
00132                                  const struct pipe_viewport_state *vp);
00133 void cso_save_viewport(struct cso_context *cso);
00134 void cso_restore_viewport(struct cso_context *cso);
00135 
00136 
00137 enum pipe_error cso_set_blend_color(struct cso_context *cso,
00138                                     const struct pipe_blend_color *bc);
00139 
00140 
00141 #ifdef  __cplusplus
00142 }
00143 #endif
00144 
00145 #endif

Generated on Tue Sep 29 06:25:14 2009 for Gallium3D by  doxygen 1.5.4