Mesa (main): tu: Use vk_pipeline_hash_shader_stage()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 28 09:37:16 UTC 2022


Module: Mesa
Branch: main
Commit: 02384ca13cde7d2b20423054d88f796643de065a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=02384ca13cde7d2b20423054d88f796643de065a

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Wed Jun 22 18:10:12 2022 +0200

tu: Use vk_pipeline_hash_shader_stage()

Acked-by: Emma Anholt <emma at anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17186>

---

 src/freedreno/vulkan/tu_pipeline.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 815ce4d4206..62f502c0234 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -37,6 +37,7 @@
 #include "util/mesa-sha1.h"
 #include "util/u_atomic.h"
 #include "vk_format.h"
+#include "vk_pipeline.h"
 #include "vk_util.h"
 
 #include "tu_cs.h"
@@ -2572,17 +2573,10 @@ tu_hash_stage(struct mesa_sha1 *ctx,
               const VkPipelineShaderStageCreateInfo *stage,
               const struct tu_shader_key *key)
 {
-   VK_FROM_HANDLE(vk_shader_module, module, stage->module);
-   const VkSpecializationInfo *spec_info = stage->pSpecializationInfo;
-
-   _mesa_sha1_update(ctx, module->sha1, sizeof(module->sha1));
-   _mesa_sha1_update(ctx, stage->pName, strlen(stage->pName));
-   if (spec_info && spec_info->mapEntryCount) {
-      _mesa_sha1_update(ctx, spec_info->pMapEntries,
-                        spec_info->mapEntryCount * sizeof spec_info->pMapEntries[0]);
-      _mesa_sha1_update(ctx, spec_info->pData, spec_info->dataSize);
-   }
+   unsigned char stage_hash[SHA1_DIGEST_LENGTH];
 
+   vk_pipeline_hash_shader_stage(stage, stage_hash);
+   _mesa_sha1_update(ctx, stage_hash, sizeof(stage_hash));
    _mesa_sha1_update(ctx, key, sizeof(*key));
 }
 



More information about the mesa-commit mailing list