diff options
author | Emil Velikov <[email protected]> | 2017-01-24 21:21:09 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-03-15 11:18:43 +0000 |
commit | a9a4028fd7136ee2ee7bf0efa8179e7a6312f008 (patch) | |
tree | 453980dcab1abb0de018129f4b6a5fd6de8f8218 /src/intel/vulkan/anv_descriptor_set.c | |
parent | c96127e873584e6ea3808d5cdb661d2135de1ff2 (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_descriptor_set.c')
-rw-r--r-- | src/intel/vulkan/anv_descriptor_set.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 175efdbcb91..56a08ce76ae 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -259,18 +259,19 @@ VkResult anv_CreatePipelineLayout( } } - struct mesa_sha1 *ctx = _mesa_sha1_init(); + struct mesa_sha1 ctx; + _mesa_sha1_init(&ctx); for (unsigned s = 0; s < layout->num_sets; s++) { - sha1_update_descriptor_set_layout(ctx, layout->set[s].layout); - _mesa_sha1_update(ctx, &layout->set[s].dynamic_offset_start, + sha1_update_descriptor_set_layout(&ctx, layout->set[s].layout); + _mesa_sha1_update(&ctx, &layout->set[s].dynamic_offset_start, sizeof(layout->set[s].dynamic_offset_start)); } - _mesa_sha1_update(ctx, &layout->num_sets, sizeof(layout->num_sets)); + _mesa_sha1_update(&ctx, &layout->num_sets, sizeof(layout->num_sets)); for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) { - _mesa_sha1_update(ctx, &layout->stage[s].has_dynamic_offsets, + _mesa_sha1_update(&ctx, &layout->stage[s].has_dynamic_offsets, sizeof(layout->stage[s].has_dynamic_offsets)); } - _mesa_sha1_final(ctx, layout->sha1); + _mesa_sha1_final(&ctx, layout->sha1); *pPipelineLayout = anv_pipeline_layout_to_handle(layout); |