From 0877be34f50b1ca46420cfdcecd433005fd04bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 12 Mar 2026 22:00:41 -0400 Subject: [PATCH] Rename SHA1_* names to BLAKE3_* Acked-by: Alyssa Rosenzweig Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/broadcom/vulkan/v3dv_descriptor_set.c | 40 ++++++++++----------- src/freedreno/vulkan/tu_descriptor_set.cc | 28 +++++++-------- src/intel/vulkan_hasvk/anv_descriptor_set.c | 30 ++++++++-------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_descriptor_set.c b/src/broadcom/vulkan/v3dv_descriptor_set.c index 083aa0d9161..c76119af050 100644 --- a/src/broadcom/vulkan/v3dv_descriptor_set.c +++ b/src/broadcom/vulkan/v3dv_descriptor_set.c @@ -276,18 +276,18 @@ v3dv_descriptor_map_get_texture_shader_state(struct v3dv_device *device, return reloc; } -#define SHA1_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); +#define BLAKE3_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); static void sha1_update_ycbcr_conversion(blake3_hasher *ctx, const struct vk_ycbcr_conversion_state *conversion) { - SHA1_UPDATE_VALUE(ctx, conversion->format); - SHA1_UPDATE_VALUE(ctx, conversion->ycbcr_model); - SHA1_UPDATE_VALUE(ctx, conversion->ycbcr_range); - SHA1_UPDATE_VALUE(ctx, conversion->mapping); - SHA1_UPDATE_VALUE(ctx, conversion->chroma_offsets); - SHA1_UPDATE_VALUE(ctx, conversion->chroma_reconstruction); + BLAKE3_UPDATE_VALUE(ctx, conversion->format); + BLAKE3_UPDATE_VALUE(ctx, conversion->ycbcr_model); + BLAKE3_UPDATE_VALUE(ctx, conversion->ycbcr_range); + BLAKE3_UPDATE_VALUE(ctx, conversion->mapping); + BLAKE3_UPDATE_VALUE(ctx, conversion->chroma_offsets); + BLAKE3_UPDATE_VALUE(ctx, conversion->chroma_reconstruction); } static void @@ -295,14 +295,14 @@ sha1_update_descriptor_set_binding_layout(blake3_hasher *ctx, const struct v3dv_descriptor_set_binding_layout *layout, const struct v3dv_descriptor_set_layout *set_layout) { - SHA1_UPDATE_VALUE(ctx, layout->type); - SHA1_UPDATE_VALUE(ctx, layout->array_size); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_index); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_count); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_index); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_offset); - SHA1_UPDATE_VALUE(ctx, layout->immutable_samplers_offset); - SHA1_UPDATE_VALUE(ctx, layout->plane_stride); + BLAKE3_UPDATE_VALUE(ctx, layout->type); + BLAKE3_UPDATE_VALUE(ctx, layout->array_size); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_index); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_count); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_index); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_offset); + BLAKE3_UPDATE_VALUE(ctx, layout->immutable_samplers_offset); + BLAKE3_UPDATE_VALUE(ctx, layout->plane_stride); if (layout->immutable_samplers_offset) { const struct v3dv_sampler *immutable_samplers = @@ -320,11 +320,11 @@ static void sha1_update_descriptor_set_layout(blake3_hasher *ctx, const struct v3dv_descriptor_set_layout *layout) { - SHA1_UPDATE_VALUE(ctx, layout->flags); - SHA1_UPDATE_VALUE(ctx, layout->binding_count); - SHA1_UPDATE_VALUE(ctx, layout->shader_stages); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_count); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_count); + BLAKE3_UPDATE_VALUE(ctx, layout->flags); + BLAKE3_UPDATE_VALUE(ctx, layout->binding_count); + BLAKE3_UPDATE_VALUE(ctx, layout->shader_stages); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_count); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_count); for (uint16_t i = 0; i < layout->binding_count; i++) sha1_update_descriptor_set_binding_layout(ctx, &layout->binding[i], layout); diff --git a/src/freedreno/vulkan/tu_descriptor_set.cc b/src/freedreno/vulkan/tu_descriptor_set.cc index 2de9664ccf9..25905e40510 100644 --- a/src/freedreno/vulkan/tu_descriptor_set.cc +++ b/src/freedreno/vulkan/tu_descriptor_set.cc @@ -451,15 +451,15 @@ tu_GetDescriptorSetLayoutBindingOffsetEXT( /* Note: we must hash any values used in tu_lower_io(). */ -#define SHA1_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); +#define BLAKE3_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); static void sha1_update_ycbcr_sampler(blake3_hasher *ctx, const struct vk_ycbcr_conversion_state *sampler) { - SHA1_UPDATE_VALUE(ctx, sampler->ycbcr_model); - SHA1_UPDATE_VALUE(ctx, sampler->ycbcr_range); - SHA1_UPDATE_VALUE(ctx, sampler->format); + BLAKE3_UPDATE_VALUE(ctx, sampler->ycbcr_model); + BLAKE3_UPDATE_VALUE(ctx, sampler->ycbcr_range); + BLAKE3_UPDATE_VALUE(ctx, sampler->format); } static void @@ -467,12 +467,12 @@ sha1_update_descriptor_set_binding_layout(blake3_hasher *ctx, const struct tu_descriptor_set_binding_layout *layout, const struct tu_descriptor_set_layout *set_layout) { - SHA1_UPDATE_VALUE(ctx, layout->type); - SHA1_UPDATE_VALUE(ctx, layout->offset); - SHA1_UPDATE_VALUE(ctx, layout->size); - SHA1_UPDATE_VALUE(ctx, layout->array_size); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_offset); - SHA1_UPDATE_VALUE(ctx, layout->immutable_samplers_offset); + BLAKE3_UPDATE_VALUE(ctx, layout->type); + BLAKE3_UPDATE_VALUE(ctx, layout->offset); + BLAKE3_UPDATE_VALUE(ctx, layout->size); + BLAKE3_UPDATE_VALUE(ctx, layout->array_size); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_offset); + BLAKE3_UPDATE_VALUE(ctx, layout->immutable_samplers_offset); const struct tu_sampler *samplers = tu_immutable_samplers(set_layout, layout); @@ -488,9 +488,9 @@ sha1_update_descriptor_set_binding_layout(blake3_hasher *ctx, if (samplers) { for (unsigned i = 0; i < layout->array_size; i++) { if (samplers[i].vk.flags & VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT) { - SHA1_UPDATE_VALUE(ctx, i); - SHA1_UPDATE_VALUE(ctx, samplers[i].vk.address_mode_u); - SHA1_UPDATE_VALUE(ctx, samplers[i].vk.address_mode_v); + BLAKE3_UPDATE_VALUE(ctx, i); + BLAKE3_UPDATE_VALUE(ctx, samplers[i].vk.address_mode_u); + BLAKE3_UPDATE_VALUE(ctx, samplers[i].vk.address_mode_v); } } } @@ -501,7 +501,7 @@ static void sha1_update_descriptor_set_layout(blake3_hasher *ctx, const struct tu_descriptor_set_layout *layout) { - SHA1_UPDATE_VALUE(ctx, layout->has_variable_descriptors); + BLAKE3_UPDATE_VALUE(ctx, layout->has_variable_descriptors); for (uint16_t i = 0; i < layout->binding_count; i++) sha1_update_descriptor_set_binding_layout(ctx, &layout->binding[i], diff --git a/src/intel/vulkan_hasvk/anv_descriptor_set.c b/src/intel/vulkan_hasvk/anv_descriptor_set.c index a646d27ef8b..3890fa5da8e 100644 --- a/src/intel/vulkan_hasvk/anv_descriptor_set.c +++ b/src/intel/vulkan_hasvk/anv_descriptor_set.c @@ -698,7 +698,7 @@ void anv_DestroyDescriptorSetLayout( anv_descriptor_set_layout_unref(device, set_layout); } -#define SHA1_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); +#define BLAKE3_UPDATE_VALUE(ctx, x) _mesa_blake3_update(ctx, &(x), sizeof(x)); static void sha1_update_immutable_sampler(blake3_hasher *ctx, @@ -716,14 +716,14 @@ static void sha1_update_descriptor_set_binding_layout(blake3_hasher *ctx, const struct anv_descriptor_set_binding_layout *layout) { - SHA1_UPDATE_VALUE(ctx, layout->flags); - SHA1_UPDATE_VALUE(ctx, layout->data); - SHA1_UPDATE_VALUE(ctx, layout->max_plane_count); - SHA1_UPDATE_VALUE(ctx, layout->array_size); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_index); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_index); - SHA1_UPDATE_VALUE(ctx, layout->buffer_view_index); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_offset); + BLAKE3_UPDATE_VALUE(ctx, layout->flags); + BLAKE3_UPDATE_VALUE(ctx, layout->data); + BLAKE3_UPDATE_VALUE(ctx, layout->max_plane_count); + BLAKE3_UPDATE_VALUE(ctx, layout->array_size); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_index); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_index); + BLAKE3_UPDATE_VALUE(ctx, layout->buffer_view_index); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_offset); if (layout->immutable_samplers) { for (uint16_t i = 0; i < layout->array_size; i++) @@ -735,12 +735,12 @@ static void sha1_update_descriptor_set_layout(blake3_hasher *ctx, const struct anv_descriptor_set_layout *layout) { - SHA1_UPDATE_VALUE(ctx, layout->binding_count); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_count); - SHA1_UPDATE_VALUE(ctx, layout->shader_stages); - SHA1_UPDATE_VALUE(ctx, layout->buffer_view_count); - SHA1_UPDATE_VALUE(ctx, layout->dynamic_offset_count); - SHA1_UPDATE_VALUE(ctx, layout->descriptor_buffer_size); + BLAKE3_UPDATE_VALUE(ctx, layout->binding_count); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_count); + BLAKE3_UPDATE_VALUE(ctx, layout->shader_stages); + BLAKE3_UPDATE_VALUE(ctx, layout->buffer_view_count); + BLAKE3_UPDATE_VALUE(ctx, layout->dynamic_offset_count); + BLAKE3_UPDATE_VALUE(ctx, layout->descriptor_buffer_size); for (uint16_t i = 0; i < layout->binding_count; i++) sha1_update_descriptor_set_binding_layout(ctx, &layout->binding[i]);