Lines Matching defs:blob
34 #include "util/blob.h"
54 struct blob *blob)
59 blob_write_bytes(blob, data_obj->data, data_obj->data_size);
68 struct blob_reader *blob)
71 * happens with a brand new blob reader for error checking anyway so we
72 * can assume the blob consumes the entire reader and we don't need to
75 assert(blob->current < blob->end);
76 size_t data_size = blob->end - blob->current;
77 const void *data = blob_read_bytes(blob, data_size);
221 struct blob *blob, uint32_t *data_size)
226 assert(blob->size == align64(blob->size, VK_PIPELINE_CACHE_BLOB_ALIGN));
227 size_t start = blob->size;
229 /* Special case for if we're writing to a NULL blob (just to get the size)
235 if (blob->data == NULL && blob->fixed_allocation) {
238 blob_write_bytes(blob, NULL, *data_size);
243 if (!object->ops->serialize(object, blob)) {
249 size_t size = blob->size - start;
256 if (blob->out_of_memory) {
426 struct blob blob;
427 blob_init(&blob);
429 if (object->ops->serialize(object, &blob) && !blob.out_of_memory) {
434 disk_cache_put(disk_cache, cache_key, blob.data, blob.size, NULL);
437 blob_finish(&blob);
460 struct blob_reader blob;
461 blob_reader_init(&blob, data_obj->data, data_obj->data_size);
463 nir_shader *nir = nir_deserialize(mem_ctx, nir_options, &blob);
466 if (blob.overrun) {
479 struct blob blob;
480 blob_init(&blob);
482 nir_serialize(&blob, nir, false);
483 if (blob.out_of_memory) {
485 blob_finish(&blob);
492 blob.data, blob.size);
493 blob_finish(&blob);
535 struct blob_reader blob;
536 blob_reader_init(&blob, data, size);
539 blob_copy_bytes(&blob, &header, sizeof(header));
540 uint32_t count = blob_read_uint32(&blob);
541 if (blob.overrun)
548 int32_t type = blob_read_uint32(&blob);
549 uint32_t key_size = blob_read_uint32(&blob);
550 uint32_t data_size = blob_read_uint32(&blob);
551 const void *key_data = blob_read_bytes(&blob, key_size);
552 blob_reader_align(&blob, VK_PIPELINE_CACHE_BLOB_ALIGN);
553 const void *data = blob_read_bytes(&blob, data_size);
554 if (blob.overrun)
682 struct blob blob;
684 blob_init_fixed(&blob, pData, *pDataSize);
686 blob_init_fixed(&blob, NULL, SIZE_MAX);
689 blob_write_bytes(&blob, &cache->header, sizeof(cache->header));
692 intptr_t count_offset = blob_reserve_uint32(&blob);
695 blob_finish(&blob);
709 size_t blob_size_save = blob.size;
712 blob_write_uint32(&blob, type);
713 blob_write_uint32(&blob, object->key_size);
714 intptr_t data_size_resv = blob_reserve_uint32(&blob);
715 blob_write_bytes(&blob, object->key_data, object->key_size);
717 blob_align(&blob, VK_PIPELINE_CACHE_BLOB_ALIGN);
721 &blob, &data_size)) {
722 blob.size = blob_size_save;
723 if (blob.out_of_memory) {
733 assert(!blob.out_of_memory);
736 blob_overwrite_uint32(&blob, data_size_resv, data_size);
742 blob_overwrite_uint32(&blob, count_offset, count);
744 *pDataSize = blob.size;
746 blob_finish(&blob);
788 /* Even though dst has the object, it only has the blob version