aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline_cache.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-01-24 21:21:09 +0000
committerEmil Velikov <[email protected]>2017-03-15 11:18:43 +0000
commita9a4028fd7136ee2ee7bf0efa8179e7a6312f008 (patch)
tree453980dcab1abb0de018129f4b6a5fd6de8f8218 /src/intel/vulkan/anv_pipeline_cache.c
parentc96127e873584e6ea3808d5cdb661d2135de1ff2 (diff)
util/sha1: rework _mesa_sha1_{init,final}
Rather than having an extra memory allocation [that we currently do not and act accordingly] just make the API take an pointer to a stack allocated instance. This and follow-up steps will effectively make the _mesa_sha1_foo simple define/inlines around their SHA1 counterparts. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Grazvydas Ignotas <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pipeline_cache.c')
-rw-r--r--src/intel/vulkan/anv_pipeline_cache.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index a8ea80f51f5..0b677a49f3d 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -205,23 +205,23 @@ anv_hash_shader(unsigned char *hash, const void *key, size_t key_size,
const struct anv_pipeline_layout *pipeline_layout,
const VkSpecializationInfo *spec_info)
{
- struct mesa_sha1 *ctx;
+ struct mesa_sha1 ctx;
- ctx = _mesa_sha1_init();
- _mesa_sha1_update(ctx, key, key_size);
- _mesa_sha1_update(ctx, module->sha1, sizeof(module->sha1));
- _mesa_sha1_update(ctx, entrypoint, strlen(entrypoint));
+ _mesa_sha1_init(&ctx);
+ _mesa_sha1_update(&ctx, key, key_size);
+ _mesa_sha1_update(&ctx, module->sha1, sizeof(module->sha1));
+ _mesa_sha1_update(&ctx, entrypoint, strlen(entrypoint));
if (pipeline_layout) {
- _mesa_sha1_update(ctx, pipeline_layout->sha1,
+ _mesa_sha1_update(&ctx, pipeline_layout->sha1,
sizeof(pipeline_layout->sha1));
}
/* hash in shader stage, pipeline layout? */
if (spec_info) {
- _mesa_sha1_update(ctx, spec_info->pMapEntries,
+ _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);
+ _mesa_sha1_update(&ctx, spec_info->pData, spec_info->dataSize);
}
- _mesa_sha1_final(ctx, hash);
+ _mesa_sha1_final(&ctx, hash);
}
static struct anv_shader_bin *