diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-11-24 21:13:18 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-11-24 21:15:35 +0000 |
commit | f1ce37f74aff4854071fe5740b055718b2c0c789 (patch) | |
tree | 126a8e27f9d0f2cf718176387727eac9b69640db /src/gallium/drivers/svga/svga_screen_cache.h | |
parent | 4509f3cbad2972b6fe4a722ed07904666122a759 (diff) | |
download | external_mesa3d-f1ce37f74aff4854071fe5740b055718b2c0c789.zip external_mesa3d-f1ce37f74aff4854071fe5740b055718b2c0c789.tar.gz external_mesa3d-f1ce37f74aff4854071fe5740b055718b2c0c789.tar.bz2 |
svga: cache textures as well as buffers
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen_cache.h')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_cache.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h index 1bbe987..b745769 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.h +++ b/src/gallium/drivers/svga/svga_screen_cache.h @@ -36,10 +36,18 @@ #include "util/u_double_list.h" -/* TODO: Reduce this once we don't allocate an index buffer per draw call */ +/* Guess the storage size of cached surfaces and try and keep it under + * this amount: + */ +#define SVGA_HOST_SURFACE_CACHE_BYTES 16*1024*1024 + +/* Maximum number of discrete surfaces in the cache: + */ #define SVGA_HOST_SURFACE_CACHE_SIZE 1024 -#define SVGA_HOST_SURFACE_CACHE_BUCKETS 64 +/* Number of hash buckets: + */ +#define SVGA_HOST_SURFACE_CACHE_BUCKETS 256 struct svga_winsys_surface; @@ -50,11 +58,12 @@ struct svga_screen; */ struct svga_host_surface_cache_key { - SVGA3dSurfaceFlags flags; - SVGA3dSurfaceFormat format; SVGA3dSize size; - uint32_t numFaces; - uint32_t numMipLevels; + uint32_t flags:8; + uint32_t format:8; + uint32_t numFaces:8; + uint32_t numMipLevels:7; + uint32_t cachable:1; /* False if this is a shared surface */ }; |