Mesa (main): vulkan: Re-order pipeline hashing
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 8 23:15:40 UTC 2022
Module: Mesa
Branch: main
Commit: a73c4d5098caa089689a1640fd453eb20940f31f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a73c4d5098caa089689a1640fd453eb20940f31f
Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date: Thu Jul 7 13:56:08 2022 -0500
vulkan: Re-order pipeline hashing
Match the order in vkPipelineShaderStageCreateInfo
Reviewed-by: Caio Oliveira <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
---
src/vulkan/runtime/vk_pipeline.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/vulkan/runtime/vk_pipeline.c b/src/vulkan/runtime/vk_pipeline.c
index ecef45f3c75..a5042a9615f 100644
--- a/src/vulkan/runtime/vk_pipeline.c
+++ b/src/vulkan/runtime/vk_pipeline.c
@@ -125,6 +125,10 @@ vk_pipeline_hash_shader_stage(const VkPipelineShaderStageCreateInfo *info,
struct mesa_sha1 ctx;
_mesa_sha1_init(&ctx);
+
+ assert(util_bitcount(info->stage) == 1);
+ _mesa_sha1_update(&ctx, &info->stage, sizeof(info->stage));
+
if (module) {
_mesa_sha1_update(&ctx, module->sha1, sizeof(module->sha1));
} else if (minfo) {
@@ -142,9 +146,6 @@ vk_pipeline_hash_shader_stage(const VkPipelineShaderStageCreateInfo *info,
_mesa_sha1_update(&ctx, info->pName, strlen(info->pName));
- assert(util_bitcount(info->stage) == 1);
- _mesa_sha1_update(&ctx, &info->stage, sizeof(info->stage));
-
if (info->pSpecializationInfo) {
_mesa_sha1_update(&ctx, info->pSpecializationInfo->pMapEntries,
info->pSpecializationInfo->mapEntryCount *
More information about the mesa-commit
mailing list