/**************************************************************************
*
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
-/* Authors: Zack Rusin <zack@tungstengraphics.com>
+/* Authors: Zack Rusin <zackr@vmware.com>
*/
#include "util/u_debug.h"
return hash_key((item), item_size);
}
-static INLINE struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
+static inline struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
{
struct cso_hash *hash;
hash = sc->hashes[type];
FREE(state);
}
-static void delete_fs_state(void *state, void *data)
-{
- struct cso_fragment_shader *cso = (struct cso_fragment_shader *)state;
- if (cso->delete_state)
- cso->delete_state(cso->context, cso->data);
- FREE(state);
-}
-
-static void delete_vs_state(void *state, void *data)
-{
- struct cso_vertex_shader *cso = (struct cso_vertex_shader *)state;
- if (cso->delete_state)
- cso->delete_state(cso->context, cso->data);
- FREE(state);
-}
-
static void delete_velements(void *state, void *data)
{
struct cso_velements *cso = (struct cso_velements *)state;
FREE(state);
}
-static INLINE void delete_cso(void *state, enum cso_cache_type type)
+static inline void delete_cso(void *state, enum cso_cache_type type)
{
switch (type) {
case CSO_BLEND:
case CSO_RASTERIZER:
delete_rasterizer_state(state, 0);
break;
- case CSO_FRAGMENT_SHADER:
- delete_fs_state(state, 0);
- break;
- case CSO_VERTEX_SHADER:
- delete_vs_state(state, 0);
- break;
case CSO_VELEMENTS:
delete_velements(state, 0);
break;
}
-static INLINE void sanitize_hash(struct cso_cache *sc,
+static inline void sanitize_hash(struct cso_cache *sc,
struct cso_hash *hash,
enum cso_cache_type type,
int max_size)
}
-static INLINE void sanitize_cb(struct cso_hash *hash, enum cso_cache_type type,
+static inline void sanitize_cb(struct cso_hash *hash, enum cso_cache_type type,
int max_size, void *user_data)
{
/* if we're approach the maximum size, remove fourth of the entries
/* delete driver data */
cso_for_each_state(sc, CSO_BLEND, delete_blend_state, 0);
cso_for_each_state(sc, CSO_DEPTH_STENCIL_ALPHA, delete_depth_stencil_state, 0);
- cso_for_each_state(sc, CSO_FRAGMENT_SHADER, delete_fs_state, 0);
- cso_for_each_state(sc, CSO_VERTEX_SHADER, delete_vs_state, 0);
cso_for_each_state(sc, CSO_RASTERIZER, delete_rasterizer_state, 0);
cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0);
cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0);