sp_tile_cache.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 
00028 #ifndef SP_TILE_CACHE_H
00029 #define SP_TILE_CACHE_H
00030 
00031 #define TILE_CLEAR_OPTIMIZATION 1
00032 
00033 
00034 #include "pipe/p_compiler.h"
00035 
00036 
00037 struct softpipe_context;
00038 struct softpipe_tile_cache;
00039 
00040 
00044 #define TILE_SIZE 64
00045 
00046 
00047 
00048 struct softpipe_cached_tile
00049 {
00050    int x, y;           
00051    int z, face, level; 
00052    union {
00053       float color[TILE_SIZE][TILE_SIZE][4];
00054       uint color32[TILE_SIZE][TILE_SIZE];
00055       uint depth32[TILE_SIZE][TILE_SIZE];
00056       ushort depth16[TILE_SIZE][TILE_SIZE];
00057       ubyte stencil8[TILE_SIZE][TILE_SIZE];
00058       ubyte any[1];
00059    } data;
00060 };
00061 
00062 
00063 extern struct softpipe_tile_cache *
00064 sp_create_tile_cache( struct pipe_screen *screen );
00065 
00066 extern void
00067 sp_destroy_tile_cache(struct softpipe_tile_cache *tc);
00068 
00069 extern void
00070 sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
00071                           struct pipe_surface *sps);
00072 
00073 extern struct pipe_surface *
00074 sp_tile_cache_get_surface(struct softpipe_tile_cache *tc);
00075 
00076 extern void
00077 sp_tile_cache_map_surfaces(struct softpipe_tile_cache *tc);
00078 
00079 extern void
00080 sp_tile_cache_unmap_surfaces(struct softpipe_tile_cache *tc);
00081 
00082 extern void
00083 sp_tile_cache_set_texture(struct pipe_context *pipe,
00084                           struct softpipe_tile_cache *tc,
00085                           struct pipe_texture *texture);
00086 
00087 extern void
00088 sp_flush_tile_cache(struct softpipe_context *softpipe,
00089                     struct softpipe_tile_cache *tc);
00090 
00091 extern void
00092 sp_tile_cache_clear(struct softpipe_tile_cache *tc, uint clearValue);
00093 
00094 extern struct softpipe_cached_tile *
00095 sp_get_cached_tile(struct softpipe_context *softpipe,
00096                    struct softpipe_tile_cache *tc, int x, int y);
00097 
00098 extern const struct softpipe_cached_tile *
00099 sp_get_cached_tile_tex(struct pipe_context *pipe,
00100                        struct softpipe_tile_cache *tc, int x, int y, int z,
00101                        int face, int level);
00102 
00103 
00104 #endif /* SP_TILE_CACHE_H */
00105 

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