diff options
author | Kenneth Graunke <[email protected]> | 2018-08-19 10:08:05 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:08 -0800 |
commit | 04e8c5bb439d7263df96ce32282b729d770a748c (patch) | |
tree | 7293485c7f82aa224a6576f2ce503ceb9bd42bf3 /src/gallium/drivers/iris/iris_resolve.c | |
parent | d209cc51709c2511b7d063388ef79689958bb65b (diff) |
iris: precompute hashes for cache tracking
saves a touch of cpu overhead in the new resolve tracking
Diffstat (limited to 'src/gallium/drivers/iris/iris_resolve.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_resolve.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index 20b25c7b76b..7b68876643b 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -193,8 +193,8 @@ void iris_cache_flush_for_read(struct iris_batch *batch, struct iris_bo *bo) { - if (_mesa_hash_table_search(batch->cache.render, bo) || - _mesa_set_search(batch->cache.depth, bo)) + if (_mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo) || + _mesa_set_search_pre_hashed(batch->cache.depth, bo->hash, bo)) iris_flush_depth_and_render_caches(batch); } @@ -210,7 +210,7 @@ iris_cache_flush_for_render(struct iris_batch *batch, enum isl_format format, enum isl_aux_usage aux_usage) { - if (_mesa_set_search(batch->cache.depth, bo)) + if (_mesa_set_search_pre_hashed(batch->cache.depth, bo->hash, bo)) iris_flush_depth_and_render_caches(batch); /* Check to see if this bo has been used by a previous rendering operation @@ -236,7 +236,8 @@ iris_cache_flush_for_render(struct iris_batch *batch, * and flush on format changes too. We can always relax this later if we * find it to be a performance problem. */ - struct hash_entry *entry = _mesa_hash_table_search(batch->cache.render, bo); + struct hash_entry *entry = + _mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo); if (entry && entry->data != format_aux_tuple(format, aux_usage)) iris_flush_depth_and_render_caches(batch); } @@ -248,7 +249,8 @@ iris_render_cache_add_bo(struct iris_batch *batch, enum isl_aux_usage aux_usage) { #ifndef NDEBUG - struct hash_entry *entry = _mesa_hash_table_search(batch->cache.render, bo); + struct hash_entry *entry = + _mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo); if (entry) { /* Otherwise, someone didn't do a flush_for_render and that would be * very bad indeed. @@ -257,20 +259,20 @@ iris_render_cache_add_bo(struct iris_batch *batch, } #endif - _mesa_hash_table_insert(batch->cache.render, bo, - format_aux_tuple(format, aux_usage)); + _mesa_hash_table_insert_pre_hashed(batch->cache.render, bo->hash, bo, + format_aux_tuple(format, aux_usage)); } void iris_cache_flush_for_depth(struct iris_batch *batch, struct iris_bo *bo) { - if (_mesa_hash_table_search(batch->cache.render, bo)) + if (_mesa_hash_table_search_pre_hashed(batch->cache.render, bo->hash, bo)) iris_flush_depth_and_render_caches(batch); } void iris_depth_cache_add_bo(struct iris_batch *batch, struct iris_bo *bo) { - _mesa_set_add(batch->cache.depth, bo); + _mesa_set_add_pre_hashed(batch->cache.depth, bo->hash, bo); } |