Mesa (main): vulkan: Fall back to raw data objects when deserializing if ops == NULL

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 19 15:53:37 UTC 2022


Module: Mesa
Branch: main
Commit: 8b13ee75ba9f27ceac6b6180ca05d321caa13612
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b13ee75ba9f27ceac6b6180ca05d321caa13612

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Wed May 18 10:05:41 2022 -0500

vulkan: Fall back to raw data objects when deserializing if ops == NULL

This can happen if an object is serialized whose object type isn't in
the pipeline cache import ops.  In this case, we generate a raw data
object and plan to turn it into the right object type later.

Fixes: d35e78bb8536 ("vulkan/pipeline_cache: Implement deserialize for raw objects")
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16584>

---

 src/vulkan/runtime/vk_pipeline_cache.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c
index b9a3c4c0e6c..ab9379ac4c4 100644
--- a/src/vulkan/runtime/vk_pipeline_cache.c
+++ b/src/vulkan/runtime/vk_pipeline_cache.c
@@ -271,6 +271,9 @@ vk_pipeline_cache_object_deserialize(struct vk_pipeline_cache *cache,
                                      const void *data, size_t data_size,
                                      const struct vk_pipeline_cache_object_ops *ops)
 {
+   if (ops == NULL)
+      ops = &raw_data_object_ops;
+
    if (unlikely(ops->deserialize == NULL)) {
       vk_logw(VK_LOG_OBJS(cache),
               "Pipeline cache object cannot be deserialized");



More information about the mesa-commit mailing list