pb_bufmgr.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * Copyright 2007 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 
00049 #ifndef PB_BUFMGR_H_
00050 #define PB_BUFMGR_H_
00051 
00052 
00053 #include "pipe/p_compiler.h"
00054 #include "pipe/p_error.h"
00055 
00056 
00057 #ifdef __cplusplus
00058 extern "C" {
00059 #endif
00060 
00061 
00062 struct pb_desc;
00063 struct pipe_buffer;
00064 struct pipe_winsys;
00065 
00066 
00070 struct pb_manager
00071 {
00072    void
00073    (*destroy)( struct pb_manager *mgr );
00074 
00075    struct pb_buffer *
00076    (*create_buffer)( struct pb_manager *mgr, 
00077                      size_t size,
00078                      const struct pb_desc *desc);
00079 
00086    void
00087    (*flush)( struct pb_manager *mgr );
00088 };
00089 
00090 
00096 struct pb_manager *
00097 pb_malloc_bufmgr_create(void);
00098 
00099 
00108 struct pb_manager *
00109 pool_bufmgr_create(struct pb_manager *provider, 
00110                    size_t n, size_t size,
00111                    const struct pb_desc *desc);
00112 
00113 
00121 struct pb_manager *
00122 mm_bufmgr_create(struct pb_manager *provider, 
00123                  size_t size, size_t align2);
00124 
00130 struct pb_manager *
00131 mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, 
00132                              size_t size, size_t align2);
00133 
00134 
00138 struct pb_manager *
00139 pb_slab_manager_create(struct pb_manager *provider,
00140                        size_t bufSize,
00141                        size_t slabSize,
00142                        const struct pb_desc *desc);
00143 
00148 struct pb_manager *
00149 pb_slab_range_manager_create(struct pb_manager *provider,
00150                              size_t minBufSize,
00151                              size_t maxBufSize,
00152                              size_t slabSize,
00153                              const struct pb_desc *desc);
00154 
00155 
00161 struct pb_manager *
00162 pb_cache_manager_create(struct pb_manager *provider, 
00163                         unsigned usecs); 
00164 
00165 
00175 struct pb_manager *
00176 fenced_bufmgr_create(struct pb_manager *provider,
00177                      struct pipe_winsys *winsys);
00178 
00179 
00180 struct pb_manager *
00181 pb_alt_manager_create(struct pb_manager *provider1, 
00182                       struct pb_manager *provider2);
00183 
00184 
00190 struct pb_manager *
00191 pb_debug_manager_create(struct pb_manager *provider, size_t band_size); 
00192 
00193 
00194 #ifdef __cplusplus
00195 }
00196 #endif
00197 
00198 #endif /*PB_BUFMGR_H_*/

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