Lines Matching refs:object

52    /** Writes this cache object to the given blob
54 * Because the cache works with both raw blob data and driver object data
69 bool (*serialize)(struct vk_pipeline_cache_object *object,
72 /** Constructs an object from cached data
76 * returns the created object
85 /** Destroys the object
89 void (*destroy)(struct vk_pipeline_cache_object *object);
98 * the pipeline cache is destroyed. Each object also has a pointer to a
100 * [de]serialize the object and clean it up when the reference count hits 0.
102 * The rest of the details of any given object are entirely up to the driver.
119 struct vk_pipeline_cache_object *object,
123 memset(object, 0, sizeof(*object));
124 object->device = device;
125 object->ops = ops;
126 p_atomic_set(&object->ref_cnt, 1);
127 object->data_size = 0; /* Unknown */
128 object->key_data = key_data;
129 object->key_size = key_size;
133 vk_pipeline_cache_object_finish(struct vk_pipeline_cache_object *object)
135 assert(p_atomic_read(&object->ref_cnt) <= 1);
139 vk_pipeline_cache_object_ref(struct vk_pipeline_cache_object *object)
141 assert(object && p_atomic_read(&object->ref_cnt) >= 1);
142 p_atomic_inc(&object->ref_cnt);
143 return object;
147 vk_pipeline_cache_object_unref(struct vk_pipeline_cache_object *object)
149 assert(object && p_atomic_read(&object->ref_cnt) >= 1);
150 if (p_atomic_dec_zero(&object->ref_cnt))
151 object->ops->destroy(object);
191 /** Attempts to look up an object in the cache by key
193 * If an object is found in the cache matching the given key, *cache_hit is
194 * set to true and a reference to that object is returned.
197 * objects in the disk cache before declaring failure. If an object is found
203 * Prior to the first vk_pipeline_cache_lookup() of a given object, it is
204 * stored as an internal raw data object with the same hash. This allows us
205 * to avoid any complex object type tagging in the serialized cache. It does,
209 * Returns a reference to the object, if found
217 /** Adds an object to the pipeline cache
219 * This function adds the given object to the pipeline cache. We do not
220 * specify a key here because the key is part of the object. See also
223 * This function consumes a reference to the object and returns a reference to
224 * the (possibly different) object in the cache. The intended usage pattern
228 * struct vk_pipeline_cache_object *object =
231 * if (object != NULL)
232 * return container_of(object, driver_type, base);
234 * object = do_compile();
235 * assert(object != NULL);
237 * object = vk_pipeline_cache_add_object(cache, object);
238 * return container_of(object, driver_type, base);
242 struct vk_pipeline_cache_object *object);