radv/rt: Use vk_pipeline_hash_shader_stage for RT stages
authorKonstantin Seurer <konstantin.seurer@gmail.com>
Sat, 4 Mar 2023 15:51:40 +0000 (16:51 +0100)
committerMarge Bot <emma+marge@anholt.net>
Sun, 12 Mar 2023 13:18:15 +0000 (13:18 +0000)
Fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.non_graphics.shader_module_info_rt.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707>

src/amd/vulkan/radv_pipeline_cache.c

index 68863ca..4ae8dcd 100644 (file)
@@ -31,6 +31,7 @@
 #include "radv_private.h"
 #include "radv_shader.h"
 #include "aco_interface.h"
+#include "vk_pipeline.h"
 
 struct cache_entry {
    union {
@@ -152,26 +153,9 @@ radv_hash_rt_stages(struct mesa_sha1 *ctx, const VkPipelineShaderStageCreateInfo
                     unsigned stage_count)
 {
    for (unsigned i = 0; i < stage_count; ++i) {
-      RADV_FROM_HANDLE(vk_shader_module, module, stages[i].module);
-      const VkSpecializationInfo *spec_info = stages[i].pSpecializationInfo;
-
-      const VkPipelineShaderStageModuleIdentifierCreateInfoEXT *iinfo = vk_find_struct_const(
-         stages[i].pNext, PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT);
-
-      if (module) {
-         _mesa_sha1_update(ctx, module->sha1, sizeof(module->sha1));
-      } else {
-         assert(iinfo);
-         assert(iinfo->identifierSize <= VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT);
-         _mesa_sha1_update(ctx, iinfo->pIdentifier, iinfo->identifierSize);
-      }
-
-      _mesa_sha1_update(ctx, stages[i].pName, strlen(stages[i].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 hash[20];
+      vk_pipeline_hash_shader_stage(&stages[i], NULL, hash);
+      _mesa_sha1_update(ctx, hash, sizeof(hash));
    }
 }