Lines Matching refs:bufferObj
76 vbo_use_minmax_cache(struct gl_buffer_object *bufferObj) in vbo_use_minmax_cache() argument
78 if (bufferObj->UsageHistory & (USAGE_TEXTURE_BUFFER | in vbo_use_minmax_cache()
86 if ((bufferObj->Mappings[MAP_USER].AccessFlags & in vbo_use_minmax_cache()
96 vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj) in vbo_delete_minmax_cache() argument
98 _mesa_hash_table_destroy(bufferObj->MinMaxCache, vbo_minmax_cache_delete_entry); in vbo_delete_minmax_cache()
99 bufferObj->MinMaxCache = NULL; in vbo_delete_minmax_cache()
104 vbo_get_minmax_cached(struct gl_buffer_object *bufferObj, in vbo_get_minmax_cached() argument
113 if (!bufferObj->MinMaxCache) in vbo_get_minmax_cached()
115 if (!vbo_use_minmax_cache(bufferObj)) in vbo_get_minmax_cached()
118 simple_mtx_lock(&bufferObj->Mutex); in vbo_get_minmax_cached()
120 if (bufferObj->MinMaxCacheDirty) { in vbo_get_minmax_cached()
128 unsigned optimism = bufferObj->Size; in vbo_get_minmax_cached()
129 if (bufferObj->MinMaxCacheMissIndices > optimism && in vbo_get_minmax_cached()
130 bufferObj->MinMaxCacheHitIndices < bufferObj->MinMaxCacheMissIndices - optimism) { in vbo_get_minmax_cached()
131 bufferObj->UsageHistory |= USAGE_DISABLE_MINMAX_CACHE; in vbo_get_minmax_cached()
132 vbo_delete_minmax_cache(bufferObj); in vbo_get_minmax_cached()
136 _mesa_hash_table_clear(bufferObj->MinMaxCache, vbo_minmax_cache_delete_entry); in vbo_get_minmax_cached()
137 bufferObj->MinMaxCacheDirty = false; in vbo_get_minmax_cached()
145 result = _mesa_hash_table_search_pre_hashed(bufferObj->MinMaxCache, hash, &key); in vbo_get_minmax_cached()
158 unsigned new_hit_count = bufferObj->MinMaxCacheHitIndices + count; in vbo_get_minmax_cached()
160 if (new_hit_count >= bufferObj->MinMaxCacheHitIndices) in vbo_get_minmax_cached()
161 bufferObj->MinMaxCacheHitIndices = new_hit_count; in vbo_get_minmax_cached()
163 bufferObj->MinMaxCacheHitIndices = ~(unsigned)0; in vbo_get_minmax_cached()
165 bufferObj->MinMaxCacheMissIndices += count; in vbo_get_minmax_cached()
169 simple_mtx_unlock(&bufferObj->Mutex); in vbo_get_minmax_cached()
176 struct gl_buffer_object *bufferObj, in vbo_minmax_cache_store() argument
184 if (!vbo_use_minmax_cache(bufferObj)) in vbo_minmax_cache_store()
187 simple_mtx_lock(&bufferObj->Mutex); in vbo_minmax_cache_store()
189 if (!bufferObj->MinMaxCache) { in vbo_minmax_cache_store()
190 bufferObj->MinMaxCache = in vbo_minmax_cache_store()
194 if (!bufferObj->MinMaxCache) in vbo_minmax_cache_store()
209 table_entry = _mesa_hash_table_search_pre_hashed(bufferObj->MinMaxCache, in vbo_minmax_cache_store()
220 table_entry = _mesa_hash_table_insert_pre_hashed(bufferObj->MinMaxCache, in vbo_minmax_cache_store()
226 simple_mtx_unlock(&bufferObj->Mutex); in vbo_minmax_cache_store()