summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_tile_cache.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-07-29 07:40:50 +0100
committerKeith Whitwell <[email protected]>2009-08-18 16:55:10 +0100
commit80c78472ad43f4288c9ef5076074ba9d31a39885 (patch)
tree9059164cd806a1ed09f7a2ab1a7281d42e891bd3 /src/gallium/drivers/softpipe/sp_tile_cache.h
parent99ec78d9462d2a553982d0ea15d538b36b1c123b (diff)
softpipe: split texture and surface tile caches
These do similar jobs but with largely disjoint code. Will want to evolve them separately going forward.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tile_cache.h')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.h42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h
index ac2aae58758..3b0be274d5e 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.h
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.h
@@ -51,10 +51,8 @@ union tile_address {
struct {
unsigned x:6; /* 4096 / TILE_SIZE */
unsigned y:6; /* 4096 / TILE_SIZE */
- unsigned z:12; /* 4096 -- z not tiled */
- unsigned face:3;
- unsigned level:4;
unsigned invalid:1;
+ unsigned pad:19;
} bits;
unsigned value;
};
@@ -88,19 +86,12 @@ struct softpipe_tile_cache
struct pipe_transfer *transfer;
void *transfer_map;
- struct pipe_texture *texture; /**< if caching a texture */
- unsigned timestamp;
-
struct softpipe_cached_tile entries[NUM_ENTRIES];
uint clear_flags[(MAX_WIDTH / TILE_SIZE) * (MAX_HEIGHT / TILE_SIZE) / 32];
float clear_color[4]; /**< for color bufs */
uint clear_val; /**< for z+stencil, or packed color clear value */
boolean depth_stencil; /**< Is the surface a depth/stencil format? */
- struct pipe_transfer *tex_trans;
- void *tex_trans_map;
- int tex_face, tex_level, tex_z;
-
struct softpipe_cached_tile tile; /**< scratch tile for clears */
struct softpipe_cached_tile *last_tile; /**< most recently retrieved tile */
@@ -127,13 +118,6 @@ extern void
sp_tile_cache_unmap_transfers(struct softpipe_tile_cache *tc);
extern void
-sp_tile_cache_set_texture(struct softpipe_tile_cache *tc,
- struct pipe_texture *texture);
-
-void
-sp_tile_cache_validate_texture(struct softpipe_tile_cache *tc);
-
-extern void
sp_flush_tile_cache(struct softpipe_tile_cache *tc);
extern void
@@ -144,47 +128,27 @@ extern struct softpipe_cached_tile *
sp_find_cached_tile(struct softpipe_tile_cache *tc,
union tile_address addr );
-extern const struct softpipe_cached_tile *
-sp_find_cached_tile_tex(struct softpipe_tile_cache *tc,
- union tile_address addr );
static INLINE const union tile_address
tile_address( unsigned x,
- unsigned y,
- unsigned z,
- unsigned face,
- unsigned level )
+ unsigned y )
{
union tile_address addr;
addr.value = 0;
addr.bits.x = x / TILE_SIZE;
addr.bits.y = y / TILE_SIZE;
- addr.bits.z = z;
- addr.bits.face = face;
- addr.bits.level = level;
return addr;
}
/* Quickly retrieve tile if it matches last lookup.
*/
-static INLINE const struct softpipe_cached_tile *
-sp_get_cached_tile_tex(struct softpipe_tile_cache *tc,
- union tile_address addr )
-{
- if (tc->last_tile->addr.value == addr.value)
- return tc->last_tile;
-
- return sp_find_cached_tile_tex( tc, addr );
-}
-
-
static INLINE struct softpipe_cached_tile *
sp_get_cached_tile(struct softpipe_tile_cache *tc,
int x, int y )
{
- union tile_address addr = tile_address( x, y, 0, 0, 0 );
+ union tile_address addr = tile_address( x, y );
if (tc->last_tile->addr.value == addr.value)
return tc->last_tile;