#include "radv_private.h"
#include "radv_shader.h"
#include "aco_interface.h"
+#include "vk_pipeline.h"
struct cache_entry {
union {
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));
}
}