/**
* Compute the bucket for this key.
*/
-static INLINE unsigned
+static inline unsigned
svga_screen_cache_bucket(const struct svga_host_surface_cache_key *key)
{
return util_hash_crc32(key, sizeof *key) % SVGA_HOST_SURFACE_CACHE_BUCKETS;
* found, remove it from the cache and return the surface pointer.
* Return NULL otherwise.
*/
-static INLINE struct svga_winsys_surface *
+static struct svga_winsys_surface *
svga_screen_cache_lookup(struct svga_screen *svgascreen,
const struct svga_host_surface_cache_key *key)
{
/**
* Transfers a handle reference.
*/
-static INLINE void
+static void
svga_screen_cache_add(struct svga_screen *svgascreen,
const struct svga_host_surface_cache_key *key,
struct svga_winsys_surface **p_handle)
assert(key->cachable);
- assert(handle);
if (!handle)
return;
handle = sws->surface_create(sws,
key->flags,
key->format,
+ key->cachable ?
+ 0 : SVGA_SURFACE_USAGE_SHARED,
key->size,
key->numFaces,
key->numMipLevels);