brw_state.h

Go to the documentation of this file.
00001 /*
00002  Copyright (C) Intel Corp.  2006.  All Rights Reserved.
00003  Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
00004  develop this 3D driver.
00005  
00006  Permission is hereby granted, free of charge, to any person obtaining
00007  a 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, sublicense, 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
00016  portions of the Software.
00017  
00018  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00019  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00021  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
00022  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00023  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00024  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  
00026  **********************************************************************/
00027  /*
00028   * Authors:
00029   *   Keith Whitwell <keith@tungstengraphics.com>
00030   */
00031     
00032 
00033 #ifndef BRW_STATE_H
00034 #define BRW_STATE_H
00035 
00036 #include "brw_context.h"
00037 #include "brw_winsys.h"
00038 
00039 
00040 const struct brw_tracked_state brw_blend_constant_color;
00041 const struct brw_tracked_state brw_cc_unit;
00042 const struct brw_tracked_state brw_cc_vp;
00043 const struct brw_tracked_state brw_clip_prog;
00044 const struct brw_tracked_state brw_clip_unit;
00045 const struct brw_tracked_state brw_constant_buffer_state;
00046 const struct brw_tracked_state brw_constant_buffer;
00047 const struct brw_tracked_state brw_curbe_offsets;
00048 const struct brw_tracked_state brw_invarient_state;
00049 const struct brw_tracked_state brw_gs_prog;
00050 const struct brw_tracked_state brw_gs_unit;
00051 const struct brw_tracked_state brw_drawing_rect;
00052 const struct brw_tracked_state brw_line_stipple;
00053 const struct brw_tracked_state brw_pipelined_state_pointers;
00054 const struct brw_tracked_state brw_binding_table_pointers;
00055 const struct brw_tracked_state brw_depthbuffer;
00056 const struct brw_tracked_state brw_polygon_stipple_offset;
00057 const struct brw_tracked_state brw_polygon_stipple;
00058 const struct brw_tracked_state brw_program_parameters;
00059 const struct brw_tracked_state brw_recalculate_urb_fence;
00060 const struct brw_tracked_state brw_sf_prog;
00061 const struct brw_tracked_state brw_sf_unit;
00062 const struct brw_tracked_state brw_sf_vp;
00063 const struct brw_tracked_state brw_state_base_address;
00064 const struct brw_tracked_state brw_urb_fence;
00065 const struct brw_tracked_state brw_vertex_state;
00066 const struct brw_tracked_state brw_vs_prog;
00067 const struct brw_tracked_state brw_vs_unit;
00068 const struct brw_tracked_state brw_wm_prog;
00069 const struct brw_tracked_state brw_wm_samplers;
00070 const struct brw_tracked_state brw_wm_surfaces;
00071 const struct brw_tracked_state brw_wm_unit;
00072 
00073 const struct brw_tracked_state brw_psp_urb_cbs;
00074 
00075 const struct brw_tracked_state brw_active_vertprog;
00076 const struct brw_tracked_state brw_tnl_vertprog;
00077 const struct brw_tracked_state brw_pipe_control;
00078 
00079 const struct brw_tracked_state brw_clear_surface_cache;
00080 const struct brw_tracked_state brw_clear_batch_cache;
00081 
00082 /***********************************************************************
00083  * brw_state_cache.c
00084  */
00085 unsigned brw_cache_data(struct brw_cache *cache,
00086                       const void *data );
00087 
00088 unsigned brw_cache_data_sz(struct brw_cache *cache,
00089                          const void *data,
00090                          unsigned data_sz);
00091 
00092 unsigned brw_upload_cache( struct brw_cache *cache,
00093                          const void *key,
00094                          unsigned key_sz,
00095                          const void *data,
00096                          unsigned data_sz,
00097                          const void *aux,
00098                          void *aux_return );
00099 
00100 boolean brw_search_cache( struct brw_cache *cache,
00101                             const void *key,
00102                             unsigned key_size,
00103                             void *aux_return,
00104                             unsigned *offset_return);
00105 
00106 void brw_init_caches( struct brw_context *brw );
00107 void brw_destroy_caches( struct brw_context *brw );
00108 
00109 static inline struct pipe_buffer *brw_cache_buffer(struct brw_context *brw,
00110                                                           enum brw_cache_id id)
00111 {
00112    return brw->cache[id].pool->buffer;
00113 }
00114 
00115 /***********************************************************************
00116  * brw_state_batch.c
00117  */
00118 #define BRW_CACHED_BATCH_STRUCT(brw, s) brw_cached_batch_struct( brw, (s), sizeof(*(s)) )
00119 
00120 boolean brw_cached_batch_struct( struct brw_context *brw,
00121                                    const void *data,
00122                                    unsigned sz );
00123 
00124 void brw_destroy_batch_cache( struct brw_context *brw );
00125 
00126 
00127 /***********************************************************************
00128  * brw_state_pool.c
00129  */
00130 void brw_init_pools( struct brw_context *brw );
00131 void brw_destroy_pools( struct brw_context *brw );
00132 
00133 boolean brw_pool_alloc( struct brw_mem_pool *pool,
00134                           unsigned size,
00135                           unsigned alignment,
00136                           unsigned *offset_return);
00137 
00138 void brw_pool_fence( struct brw_context *brw,
00139                      struct brw_mem_pool *pool,
00140                      unsigned fence );
00141 
00142 
00143 void brw_pool_check_wrap( struct brw_context *brw,
00144                           struct brw_mem_pool *pool );
00145 
00146 void brw_clear_all_caches( struct brw_context *brw );
00147 void brw_invalidate_pools( struct brw_context *brw );
00148 void brw_clear_batch_cache_flush( struct brw_context *brw );
00149 
00150 
00151 #endif

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