mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
radv: use blake3 for hashing descriptor set layouts
It's faster than sha1, up to 28% with 1M of bindings. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9476 Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30089>
This commit is contained in:
parent
2c28ed7c5c
commit
51c6910ba7
2 changed files with 3 additions and 2 deletions
|
|
@ -370,7 +370,7 @@ radv_CreateDescriptorSetLayout(VkDevice _device, const VkDescriptorSetLayoutCrea
|
|||
* should be ok.
|
||||
*/
|
||||
uint32_t hash_offset = offsetof(struct radv_descriptor_set_layout, hash) + sizeof(set_layout->hash);
|
||||
_mesa_sha1_compute((const char *)set_layout + hash_offset, size - hash_offset, set_layout->hash);
|
||||
_mesa_blake3_compute((const char *)set_layout + hash_offset, size - hash_offset, set_layout->hash);
|
||||
|
||||
*pSetLayout = radv_descriptor_set_layout_to_handle(set_layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#ifndef RADV_DESCRIPTOR_SET_H
|
||||
#define RADV_DESCRIPTOR_SET_H
|
||||
|
||||
#include "util/mesa-blake3.h"
|
||||
#include "util/mesa-sha1.h"
|
||||
|
||||
#include "radv_constants.h"
|
||||
|
|
@ -40,7 +41,7 @@ struct radv_descriptor_set_layout {
|
|||
struct vk_descriptor_set_layout vk;
|
||||
|
||||
/* Hash of all fields below */
|
||||
uint8_t hash[SHA1_DIGEST_LENGTH];
|
||||
blake3_hash hash;
|
||||
|
||||
/* Everything below is hashed and shouldn't contain any pointers. Be careful when modifying this
|
||||
* structure.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue