Lines Matching refs:bufferObj
77 vbo_use_minmax_cache(struct gl_buffer_object *bufferObj)
79 if (bufferObj->UsageHistory & (USAGE_TEXTURE_BUFFER |
87 if ((bufferObj->Mappings[MAP_USER].AccessFlags &
97 vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj)
99 _mesa_hash_table_destroy(bufferObj->MinMaxCache, vbo_minmax_cache_delete_entry);
100 bufferObj->MinMaxCache = NULL;
105 vbo_get_minmax_cached(struct gl_buffer_object *bufferObj,
114 if (!bufferObj->MinMaxCache)
116 if (!vbo_use_minmax_cache(bufferObj))
119 simple_mtx_lock(&bufferObj->MinMaxCacheMutex);
121 if (bufferObj->MinMaxCacheDirty) {
129 unsigned optimism = bufferObj->Size;
130 if (bufferObj->MinMaxCacheMissIndices > optimism &&
131 bufferObj->MinMaxCacheHitIndices < bufferObj->MinMaxCacheMissIndices - optimism) {
132 bufferObj->UsageHistory |= USAGE_DISABLE_MINMAX_CACHE;
133 vbo_delete_minmax_cache(bufferObj);
137 _mesa_hash_table_clear(bufferObj->MinMaxCache, vbo_minmax_cache_delete_entry);
138 bufferObj->MinMaxCacheDirty = false;
146 result = _mesa_hash_table_search_pre_hashed(bufferObj->MinMaxCache, hash, &key);
159 unsigned new_hit_count = bufferObj->MinMaxCacheHitIndices + count;
161 if (new_hit_count >= bufferObj->MinMaxCacheHitIndices)
162 bufferObj->MinMaxCacheHitIndices = new_hit_count;
164 bufferObj->MinMaxCacheHitIndices = ~(unsigned)0;
166 bufferObj->MinMaxCacheMissIndices += count;
170 simple_mtx_unlock(&bufferObj->MinMaxCacheMutex);
177 struct gl_buffer_object *bufferObj,
185 if (!vbo_use_minmax_cache(bufferObj))
188 simple_mtx_lock(&bufferObj->MinMaxCacheMutex);
190 if (!bufferObj->MinMaxCache) {
191 bufferObj->MinMaxCache =
195 if (!bufferObj->MinMaxCache)
210 table_entry = _mesa_hash_table_search_pre_hashed(bufferObj->MinMaxCache,
221 table_entry = _mesa_hash_table_insert_pre_hashed(bufferObj->MinMaxCache,
227 simple_mtx_unlock(&bufferObj->MinMaxCacheMutex);