mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 05:48:07 +02:00
radv: use blake3 for hashing pipeline layouts
This should also be faster. 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
51c6910ba7
commit
4994c0fa94
3 changed files with 7 additions and 9 deletions
|
|
@ -9,7 +9,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util/mesa-sha1.h"
|
||||
#include "ac_descriptors.h"
|
||||
#include "radv_buffer.h"
|
||||
#include "radv_buffer_view.h"
|
||||
|
|
@ -532,19 +531,19 @@ radv_pipeline_layout_add_set(struct radv_pipeline_layout *layout, uint32_t set_i
|
|||
void
|
||||
radv_pipeline_layout_hash(struct radv_pipeline_layout *layout)
|
||||
{
|
||||
struct mesa_sha1 ctx;
|
||||
struct mesa_blake3 ctx;
|
||||
|
||||
_mesa_sha1_init(&ctx);
|
||||
_mesa_blake3_init(&ctx);
|
||||
for (uint32_t i = 0; i < layout->num_sets; i++) {
|
||||
struct radv_descriptor_set_layout *set_layout = layout->set[i].layout;
|
||||
|
||||
if (!set_layout)
|
||||
continue;
|
||||
|
||||
_mesa_sha1_update(&ctx, set_layout->hash, sizeof(set_layout->hash));
|
||||
_mesa_blake3_update(&ctx, set_layout->hash, sizeof(set_layout->hash));
|
||||
}
|
||||
_mesa_sha1_update(&ctx, &layout->push_constant_size, sizeof(layout->push_constant_size));
|
||||
_mesa_sha1_final(&ctx, layout->sha1);
|
||||
_mesa_blake3_update(&ctx, &layout->push_constant_size, sizeof(layout->push_constant_size));
|
||||
_mesa_blake3_final(&ctx, layout->hash);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#define RADV_DESCRIPTOR_SET_H
|
||||
|
||||
#include "util/mesa-blake3.h"
|
||||
#include "util/mesa-sha1.h"
|
||||
|
||||
#include "radv_constants.h"
|
||||
|
||||
|
|
@ -186,7 +185,7 @@ struct radv_pipeline_layout {
|
|||
|
||||
bool independent_sets;
|
||||
|
||||
unsigned char sha1[20];
|
||||
blake3_hash hash;
|
||||
};
|
||||
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_pipeline_layout, base, VkPipelineLayout, VK_OBJECT_TYPE_PIPELINE_LAYOUT)
|
||||
|
|
|
|||
|
|
@ -1280,7 +1280,7 @@ radv_pipeline_hash(const struct radv_device *device, const struct radv_pipeline_
|
|||
{
|
||||
_mesa_sha1_update(ctx, device->cache_hash, sizeof(device->cache_hash));
|
||||
if (pipeline_layout)
|
||||
_mesa_sha1_update(ctx, pipeline_layout->sha1, sizeof(pipeline_layout->sha1));
|
||||
_mesa_sha1_update(ctx, pipeline_layout->hash, sizeof(pipeline_layout->hash));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue