Lines Matching refs:blob
147 struct blob *blob) in anv_shader_bin_write_to_blob() argument
149 blob_write_uint32(blob, shader->stage); in anv_shader_bin_write_to_blob()
151 blob_write_uint32(blob, shader->key->size); in anv_shader_bin_write_to_blob()
152 blob_write_bytes(blob, shader->key->data, shader->key->size); in anv_shader_bin_write_to_blob()
154 blob_write_uint32(blob, shader->kernel_size); in anv_shader_bin_write_to_blob()
155 blob_write_bytes(blob, shader->kernel.map, shader->kernel_size); in anv_shader_bin_write_to_blob()
157 blob_write_uint32(blob, shader->prog_data_size); in anv_shader_bin_write_to_blob()
158 blob_write_bytes(blob, shader->prog_data, shader->prog_data_size); in anv_shader_bin_write_to_blob()
159 blob_write_bytes(blob, shader->prog_data->relocs, in anv_shader_bin_write_to_blob()
163 blob_write_uint32(blob, shader->num_stats); in anv_shader_bin_write_to_blob()
164 blob_write_bytes(blob, shader->stats, in anv_shader_bin_write_to_blob()
170 blob_write_uint32(blob, xfb_info_size); in anv_shader_bin_write_to_blob()
171 blob_write_bytes(blob, shader->xfb_info, xfb_info_size); in anv_shader_bin_write_to_blob()
173 blob_write_uint32(blob, 0); in anv_shader_bin_write_to_blob()
176 blob_write_bytes(blob, shader->bind_map.surface_sha1, in anv_shader_bin_write_to_blob()
178 blob_write_bytes(blob, shader->bind_map.sampler_sha1, in anv_shader_bin_write_to_blob()
180 blob_write_bytes(blob, shader->bind_map.push_sha1, in anv_shader_bin_write_to_blob()
182 blob_write_uint32(blob, shader->bind_map.surface_count); in anv_shader_bin_write_to_blob()
183 blob_write_uint32(blob, shader->bind_map.sampler_count); in anv_shader_bin_write_to_blob()
184 blob_write_bytes(blob, shader->bind_map.surface_to_descriptor, in anv_shader_bin_write_to_blob()
187 blob_write_bytes(blob, shader->bind_map.sampler_to_descriptor, in anv_shader_bin_write_to_blob()
190 blob_write_bytes(blob, shader->bind_map.push_ranges, in anv_shader_bin_write_to_blob()
193 return !blob->out_of_memory; in anv_shader_bin_write_to_blob()
198 struct blob_reader *blob) in anv_shader_bin_create_from_blob() argument
200 gl_shader_stage stage = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
202 uint32_t key_size = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
203 const void *key_data = blob_read_bytes(blob, key_size); in anv_shader_bin_create_from_blob()
205 uint32_t kernel_size = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
206 const void *kernel_data = blob_read_bytes(blob, kernel_size); in anv_shader_bin_create_from_blob()
208 uint32_t prog_data_size = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
209 const void *prog_data_bytes = blob_read_bytes(blob, prog_data_size); in anv_shader_bin_create_from_blob()
210 if (blob->overrun) in anv_shader_bin_create_from_blob()
217 blob_read_bytes(blob, prog_data.base.num_relocs * in anv_shader_bin_create_from_blob()
220 uint32_t num_stats = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
222 blob_read_bytes(blob, num_stats * sizeof(stats[0])); in anv_shader_bin_create_from_blob()
225 uint32_t xfb_size = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
227 xfb_info = blob_read_bytes(blob, xfb_size); in anv_shader_bin_create_from_blob()
230 blob_copy_bytes(blob, bind_map.surface_sha1, sizeof(bind_map.surface_sha1)); in anv_shader_bin_create_from_blob()
231 blob_copy_bytes(blob, bind_map.sampler_sha1, sizeof(bind_map.sampler_sha1)); in anv_shader_bin_create_from_blob()
232 blob_copy_bytes(blob, bind_map.push_sha1, sizeof(bind_map.push_sha1)); in anv_shader_bin_create_from_blob()
233 bind_map.surface_count = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
234 bind_map.sampler_count = blob_read_uint32(blob); in anv_shader_bin_create_from_blob()
236 blob_read_bytes(blob, bind_map.surface_count * in anv_shader_bin_create_from_blob()
239 blob_read_bytes(blob, bind_map.sampler_count * in anv_shader_bin_create_from_blob()
241 blob_copy_bytes(blob, bind_map.push_ranges, sizeof(bind_map.push_ranges)); in anv_shader_bin_create_from_blob()
243 if (blob->overrun) in anv_shader_bin_create_from_blob()
493 struct blob_reader blob; in anv_pipeline_cache_load() local
494 blob_reader_init(&blob, data, size); in anv_pipeline_cache_load()
497 blob_copy_bytes(&blob, &header, sizeof(header)); in anv_pipeline_cache_load()
498 uint32_t count = blob_read_uint32(&blob); in anv_pipeline_cache_load()
499 if (blob.overrun) in anv_pipeline_cache_load()
515 anv_shader_bin_create_from_blob(device, &blob); in anv_pipeline_cache_load()
578 struct blob blob; in anv_GetPipelineCacheData() local
580 blob_init_fixed(&blob, pData, *pDataSize); in anv_GetPipelineCacheData()
582 blob_init_fixed(&blob, NULL, SIZE_MAX); in anv_GetPipelineCacheData()
592 blob_write_bytes(&blob, &header, sizeof(header)); in anv_GetPipelineCacheData()
595 intptr_t count_offset = blob_reserve_uint32(&blob); in anv_GetPipelineCacheData()
598 blob_finish(&blob); in anv_GetPipelineCacheData()
607 size_t save_size = blob.size; in anv_GetPipelineCacheData()
608 if (!anv_shader_bin_write_to_blob(shader, &blob)) { in anv_GetPipelineCacheData()
610 blob.size = save_size; in anv_GetPipelineCacheData()
619 blob_overwrite_uint32(&blob, count_offset, count); in anv_GetPipelineCacheData()
621 *pDataSize = blob.size; in anv_GetPipelineCacheData()
623 blob_finish(&blob); in anv_GetPipelineCacheData()
686 struct blob_reader blob; in anv_device_search_for_kernel() local
687 blob_reader_init(&blob, buffer, buffer_size); in anv_device_search_for_kernel()
688 bin = anv_shader_bin_create_from_blob(device, &blob); in anv_device_search_for_kernel()
737 struct blob binary; in anv_device_upload_kernel()
777 struct blob_reader blob; in anv_device_search_for_nir() local
778 blob_reader_init(&blob, snir->data, snir->size); in anv_device_search_for_nir()
780 nir_shader *nir = nir_deserialize(mem_ctx, nir_options, &blob); in anv_device_search_for_nir()
781 if (blob.overrun) { in anv_device_search_for_nir()
806 struct blob blob; in anv_device_upload_nir() local
807 blob_init(&blob); in anv_device_upload_nir()
809 nir_serialize(&blob, nir, false); in anv_device_upload_nir()
810 if (blob.out_of_memory) { in anv_device_upload_nir()
811 blob_finish(&blob); in anv_device_upload_nir()
822 blob_finish(&blob); in anv_device_upload_nir()
828 ralloc_size(cache->nir_cache, sizeof(*snir) + blob.size); in anv_device_upload_nir()
830 snir->size = blob.size; in anv_device_upload_nir()
831 memcpy(snir->data, blob.data, blob.size); in anv_device_upload_nir()
833 blob_finish(&blob); in anv_device_upload_nir()