Lines Matching refs:metadata

43 write_subroutines(struct blob *metadata, struct gl_shader_program *prog)
52 blob_write_uint32(metadata, glprog->sh.NumSubroutineUniforms);
53 blob_write_uint32(metadata, glprog->sh.MaxSubroutineFunctionIndex);
54 blob_write_uint32(metadata, glprog->sh.NumSubroutineFunctions);
58 blob_write_string(metadata, glprog->sh.SubroutineFunctions[j].name);
59 blob_write_uint32(metadata, glprog->sh.SubroutineFunctions[j].index);
60 blob_write_uint32(metadata, num_types);
63 encode_type_to_blob(metadata,
71 read_subroutines(struct blob_reader *metadata, struct gl_shader_program *prog)
82 glprog->sh.NumSubroutineUniforms = blob_read_uint32(metadata);
83 glprog->sh.MaxSubroutineFunctionIndex = blob_read_uint32(metadata);
84 glprog->sh.NumSubroutineFunctions = blob_read_uint32(metadata);
91 subs[j].name = ralloc_strdup(prog, blob_read_string (metadata));
92 subs[j].index = (int) blob_read_uint32(metadata);
93 subs[j].num_compat_types = (int) blob_read_uint32(metadata);
98 subs[j].types[k] = decode_type_from_blob(metadata);
105 write_buffer_block(struct blob *metadata, struct gl_uniform_block *b)
107 blob_write_string(metadata, b->Name);
108 blob_write_uint32(metadata, b->NumUniforms);
109 blob_write_uint32(metadata, b->Binding);
110 blob_write_uint32(metadata, b->UniformBufferSize);
111 blob_write_uint32(metadata, b->stageref);
114 blob_write_string(metadata, b->Uniforms[j].Name);
115 blob_write_string(metadata, b->Uniforms[j].IndexName);
116 encode_type_to_blob(metadata, b->Uniforms[j].Type);
117 blob_write_uint32(metadata, b->Uniforms[j].Offset);
122 write_buffer_blocks(struct blob *metadata, struct gl_shader_program *prog)
124 blob_write_uint32(metadata, prog->data->NumUniformBlocks);
125 blob_write_uint32(metadata, prog->data->NumShaderStorageBlocks);
128 write_buffer_block(metadata, &prog->data->UniformBlocks[i]);
132 write_buffer_block(metadata, &prog->data->ShaderStorageBlocks[i]);
142 blob_write_uint32(metadata, glprog->sh.NumUniformBlocks);
143 blob_write_uint32(metadata, glprog->info.num_ssbos);
148 blob_write_uint32(metadata, offset);
154 blob_write_uint32(metadata, offset);
160 read_buffer_block(struct blob_reader *metadata, struct gl_uniform_block *b,
163 b->Name = ralloc_strdup(prog->data, blob_read_string (metadata));
164 b->NumUniforms = blob_read_uint32(metadata);
165 b->Binding = blob_read_uint32(metadata);
166 b->UniformBufferSize = blob_read_uint32(metadata);
167 b->stageref = blob_read_uint32(metadata);
174 blob_read_string (metadata));
176 char *index_name = blob_read_string(metadata);
183 b->Uniforms[j].Type = decode_type_from_blob(metadata);
184 b->Uniforms[j].Offset = blob_read_uint32(metadata);
189 read_buffer_blocks(struct blob_reader *metadata,
192 prog->data->NumUniformBlocks = blob_read_uint32(metadata);
193 prog->data->NumShaderStorageBlocks = blob_read_uint32(metadata);
204 read_buffer_block(metadata, &prog->data->UniformBlocks[i], prog);
208 read_buffer_block(metadata, &prog->data->ShaderStorageBlocks[i], prog);
218 glprog->sh.NumUniformBlocks = blob_read_uint32(metadata);
219 glprog->info.num_ssbos = blob_read_uint32(metadata);
227 uint32_t offset = blob_read_uint32(metadata);
232 uint32_t offset = blob_read_uint32(metadata);
240 write_atomic_buffers(struct blob *metadata, struct gl_shader_program *prog)
242 blob_write_uint32(metadata, prog->data->NumAtomicBuffers);
247 blob_write_uint32(metadata, glprog->info.num_abos);
252 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].Binding);
253 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].MinimumSize);
254 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].NumUniforms);
256 blob_write_bytes(metadata, prog->data->AtomicBuffers[i].StageReferences,
260 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].Uniforms[j]);
266 read_atomic_buffers(struct blob_reader *metadata,
269 prog->data->NumAtomicBuffers = blob_read_uint32(metadata);
279 glprog->info.num_abos = blob_read_uint32(metadata);
288 prog->data->AtomicBuffers[i].Binding = blob_read_uint32(metadata);
289 prog->data->AtomicBuffers[i].MinimumSize = blob_read_uint32(metadata);
290 prog->data->AtomicBuffers[i].NumUniforms = blob_read_uint32(metadata);
292 blob_copy_bytes(metadata,
300 prog->data->AtomicBuffers[i].Uniforms[j] = blob_read_uint32(metadata);
313 write_xfb(struct blob *metadata, struct gl_shader_program *shProg)
318 blob_write_uint32(metadata, ~0u);
324 blob_write_uint32(metadata, prog->info.stage);
327 blob_write_uint32(metadata, shProg->TransformFeedback.BufferMode);
328 blob_write_bytes(metadata, shProg->TransformFeedback.BufferStride,
330 blob_write_uint32(metadata, shProg->TransformFeedback.NumVarying);
332 blob_write_string(metadata, shProg->TransformFeedback.VaryingNames[i]);
334 blob_write_uint32(metadata, ltf->NumOutputs);
335 blob_write_uint32(metadata, ltf->ActiveBuffers);
336 blob_write_uint32(metadata, ltf->NumVarying);
338 blob_write_bytes(metadata, ltf->Outputs,
343 blob_write_string(metadata, ltf->Varyings[i].Name);
344 blob_write_uint32(metadata, ltf->Varyings[i].Type);
345 blob_write_uint32(metadata, ltf->Varyings[i].BufferIndex);
346 blob_write_uint32(metadata, ltf->Varyings[i].Size);
347 blob_write_uint32(metadata, ltf->Varyings[i].Offset);
350 blob_write_bytes(metadata, ltf->Buffers,
356 read_xfb(struct blob_reader *metadata, struct gl_shader_program *shProg)
358 unsigned xfb_stage = blob_read_uint32(metadata);
369 shProg->TransformFeedback.BufferMode = blob_read_uint32(metadata);
370 blob_copy_bytes(metadata, &shProg->TransformFeedback.BufferStride,
372 shProg->TransformFeedback.NumVarying = blob_read_uint32(metadata);
380 strdup(blob_read_string(metadata));
389 ltf->NumOutputs = blob_read_uint32(metadata);
390 ltf->ActiveBuffers = blob_read_uint32(metadata);
391 ltf->NumVarying = blob_read_uint32(metadata);
396 blob_copy_bytes(metadata, (uint8_t *) ltf->Outputs,
405 ltf->Varyings[i].Name = ralloc_strdup(prog, blob_read_string(metadata));
406 ltf->Varyings[i].Type = blob_read_uint32(metadata);
407 ltf->Varyings[i].BufferIndex = blob_read_uint32(metadata);
408 ltf->Varyings[i].Size = blob_read_uint32(metadata);
409 ltf->Varyings[i].Offset = blob_read_uint32(metadata);
412 blob_copy_bytes(metadata, (uint8_t *) ltf->Buffers,
429 write_uniforms(struct blob *metadata, struct gl_shader_program *prog)
431 blob_write_uint32(metadata, prog->SamplersValidated);
432 blob_write_uint32(metadata, prog->data->NumUniformStorage);
433 blob_write_uint32(metadata, prog->data->NumUniformDataSlots);
436 encode_type_to_blob(metadata, prog->data->UniformStorage[i].type);
437 blob_write_uint32(metadata, prog->data->UniformStorage[i].array_elements);
439 blob_write_string(metadata, prog->data->UniformStorage[i].name);
441 blob_write_string(metadata, "");
443 blob_write_uint32(metadata, prog->data->UniformStorage[i].builtin);
444 blob_write_uint32(metadata, prog->data->UniformStorage[i].remap_location);
445 blob_write_uint32(metadata, prog->data->UniformStorage[i].block_index);
446 blob_write_uint32(metadata, prog->data->UniformStorage[i].atomic_buffer_index);
447 blob_write_uint32(metadata, prog->data->UniformStorage[i].offset);
448 blob_write_uint32(metadata, prog->data->UniformStorage[i].array_stride);
449 blob_write_uint32(metadata, prog->data->UniformStorage[i].hidden);
450 blob_write_uint32(metadata, prog->data->UniformStorage[i].is_shader_storage);
451 blob_write_uint32(metadata, prog->data->UniformStorage[i].active_shader_mask);
452 blob_write_uint32(metadata, prog->data->UniformStorage[i].matrix_stride);
453 blob_write_uint32(metadata, prog->data->UniformStorage[i].row_major);
454 blob_write_uint32(metadata, prog->data->UniformStorage[i].is_bindless);
455 blob_write_uint32(metadata,
457 blob_write_uint32(metadata,
459 blob_write_uint32(metadata,
463 blob_write_uint32(metadata, prog->data->UniformStorage[i].storage -
467 blob_write_bytes(metadata, prog->data->UniformStorage[i].opaque,
476 blob_write_uint32(metadata, prog->data->NumHiddenUniforms);
485 blob_write_bytes(metadata, &prog->data->UniformDataDefaults[slot],
492 read_uniforms(struct blob_reader *metadata, struct gl_shader_program *prog)
497 prog->SamplersValidated = blob_read_uint32(metadata);
498 prog->data->NumUniformStorage = blob_read_uint32(metadata);
499 prog->data->NumUniformDataSlots = blob_read_uint32(metadata);
515 uniforms[i].type = decode_type_from_blob(metadata);
516 uniforms[i].array_elements = blob_read_uint32(metadata);
517 uniforms[i].name = ralloc_strdup(prog, blob_read_string (metadata));
518 uniforms[i].builtin = blob_read_uint32(metadata);
519 uniforms[i].remap_location = blob_read_uint32(metadata);
520 uniforms[i].block_index = blob_read_uint32(metadata);
521 uniforms[i].atomic_buffer_index = blob_read_uint32(metadata);
522 uniforms[i].offset = blob_read_uint32(metadata);
523 uniforms[i].array_stride = blob_read_uint32(metadata);
524 uniforms[i].hidden = blob_read_uint32(metadata);
525 uniforms[i].is_shader_storage = blob_read_uint32(metadata);
526 uniforms[i].active_shader_mask = blob_read_uint32(metadata);
527 uniforms[i].matrix_stride = blob_read_uint32(metadata);
528 uniforms[i].row_major = blob_read_uint32(metadata);
529 uniforms[i].is_bindless = blob_read_uint32(metadata);
530 uniforms[i].num_compatible_subroutines = blob_read_uint32(metadata);
531 uniforms[i].top_level_array_size = blob_read_uint32(metadata);
532 uniforms[i].top_level_array_stride = blob_read_uint32(metadata);
536 uniforms[i].storage = data + blob_read_uint32(metadata);
540 blob_read_bytes(metadata, sizeof(uniforms[i].opaque)),
545 prog->data->NumHiddenUniforms = blob_read_uint32(metadata);
554 blob_copy_bytes(metadata,
576 write_uniform_remap_table(struct blob *metadata,
581 blob_write_uint32(metadata, num_entries);
588 blob_write_uint32(metadata, remap_type_inactive_explicit_location);
590 blob_write_uint32(metadata, remap_type_null_ptr);
592 blob_write_uint32(metadata, remap_type_uniform_offsets_equal);
605 blob_write_uint32(metadata, offset);
606 blob_write_uint32(metadata, count);
609 blob_write_uint32(metadata, remap_type_uniform_offset);
611 blob_write_uint32(metadata, offset);
617 write_uniform_remap_tables(struct blob *metadata,
620 write_uniform_remap_table(metadata, prog->NumUniformRemapTable,
627 write_uniform_remap_table(metadata,
636 read_uniform_remap_table(struct blob_reader *metadata,
641 unsigned num = blob_read_uint32(metadata);
649 (enum uniform_remap_type) blob_read_uint32(metadata);
656 uint32_t uni_offset = blob_read_uint32(metadata);
657 uint32_t count = blob_read_uint32(metadata);
664 uint32_t uni_offset = blob_read_uint32(metadata);
672 read_uniform_remap_tables(struct blob_reader *metadata,
676 read_uniform_remap_table(metadata, prog, &prog->NumUniformRemapTable,
685 read_uniform_remap_table(metadata, prog,
710 write_hash_table(struct blob *metadata, struct string_to_uint_map *hash)
715 whte.blob = metadata;
718 offset = metadata->size;
721 blob_write_uint32 (metadata, 0);
726 blob_overwrite_uint32 (metadata, offset, whte.num_entries);
730 read_hash_table(struct blob_reader *metadata, struct string_to_uint_map *hash)
736 num_entries = blob_read_uint32 (metadata);
739 key = blob_read_string(metadata);
740 value = blob_read_uint32(metadata);
747 write_hash_tables(struct blob *metadata, struct gl_shader_program *prog)
749 write_hash_table(metadata, prog->AttributeBindings);
750 write_hash_table(metadata, prog->FragDataBindings);
751 write_hash_table(metadata, prog->FragDataIndexBindings);
755 read_hash_tables(struct blob_reader *metadata, struct gl_shader_program *prog)
757 read_hash_table(metadata, prog->AttributeBindings);
758 read_hash_table(metadata, prog->FragDataBindings);
759 read_hash_table(metadata, prog->FragDataIndexBindings);
763 write_shader_subroutine_index(struct blob *metadata,
772 blob_write_uint32(metadata, j);
797 write_program_resource_data(struct blob *metadata,
808 encode_type_to_blob(metadata, var->type);
809 encode_type_to_blob(metadata, var->interface_type);
810 encode_type_to_blob(metadata, var->outermost_struct_type);
813 blob_write_string(metadata, var->name);
815 blob_write_string(metadata, "");
822 blob_write_bytes(metadata, ((char *)var) + s_var_ptrs,
830 blob_write_uint32(metadata, i);
839 blob_write_uint32(metadata, i);
854 blob_write_uint32(metadata, uniform_not_remapped);
858 blob_write_uint32(metadata, i);
863 blob_write_uint32(metadata, uniform_remapped);
864 blob_write_uint32(metadata, ((gl_uniform_storage *)res->Data)->remap_location);
871 blob_write_uint32(metadata, i);
880 blob_write_uint32(metadata, i);
889 blob_write_uint32(metadata, i);
902 write_shader_subroutine_index(metadata, sh, res);
910 read_program_resource_data(struct blob_reader *metadata,
921 var->type = decode_type_from_blob(metadata);
922 var->interface_type = decode_type_from_blob(metadata);
923 var->outermost_struct_type = decode_type_from_blob(metadata);
925 var->name = ralloc_strdup(prog, blob_read_string(metadata));
930 blob_copy_bytes(metadata, ((uint8_t *) var) + s_var_ptrs,
937 res->Data = &prog->data->UniformBlocks[blob_read_uint32(metadata)];
940 res->Data = &prog->data->ShaderStorageBlocks[blob_read_uint32(metadata)];
950 enum uniform_type type = (enum uniform_type) blob_read_uint32(metadata);
952 res->Data = &prog->data->UniformStorage[blob_read_uint32(metadata)];
954 res->Data = prog->UniformRemapTable[blob_read_uint32(metadata)];
959 res->Data = &prog->data->AtomicBuffers[blob_read_uint32(metadata)];
963 sh.LinkedTransformFeedback->Buffers[blob_read_uint32(metadata)];
967 sh.LinkedTransformFeedback->Varyings[blob_read_uint32(metadata)];
978 &sh->Program->sh.SubroutineFunctions[blob_read_uint32(metadata)];
986 write_program_resource_list(struct blob *metadata,
989 blob_write_uint32(metadata, prog->data->NumProgramResourceList);
992 blob_write_uint32(metadata, prog->data->ProgramResourceList[i].Type);
993 write_program_resource_data(metadata, prog,
995 blob_write_bytes(metadata,
1002 read_program_resource_list(struct blob_reader *metadata,
1005 prog->data->NumProgramResourceList = blob_read_uint32(metadata);
1012 prog->data->ProgramResourceList[i].Type = blob_read_uint32(metadata);
1013 read_program_resource_data(metadata, prog,
1015 blob_copy_bytes(metadata,
1022 write_shader_parameters(struct blob *metadata,
1025 blob_write_uint32(metadata, params->NumParameters);
1030 blob_write_uint32(metadata, param->Type);
1031 blob_write_string(metadata, param->Name);
1032 blob_write_uint32(metadata, param->Size);
1033 blob_write_uint32(metadata, param->Padded);
1034 blob_write_uint32(metadata, param->DataType);
1035 blob_write_bytes(metadata, param->StateIndexes,
1037 blob_write_uint32(metadata, param->UniformStorageIndex);
1038 blob_write_uint32(metadata, param->MainUniformStorageIndex);
1043 blob_write_bytes(metadata, params->ParameterValues,
1046 blob_write_uint32(metadata, params->StateFlags);
1047 blob_write_uint32(metadata, params->UniformBytes);
1048 blob_write_uint32(metadata, params->FirstStateVarIndex);
1049 blob_write_uint32(metadata, params->LastStateVarIndex);
1053 read_shader_parameters(struct blob_reader *metadata,
1058 uint32_t num_parameters = blob_read_uint32(metadata);
1062 gl_register_file type = (gl_register_file) blob_read_uint32(metadata);
1063 const char *name = blob_read_string(metadata);
1064 unsigned size = blob_read_uint32(metadata);
1065 bool padded = blob_read_uint32(metadata);
1066 unsigned data_type = blob_read_uint32(metadata);
1067 blob_copy_bytes(metadata, (uint8_t *) state_indexes,
1074 param->UniformStorageIndex = blob_read_uint32(metadata);
1075 param->MainUniformStorageIndex = blob_read_uint32(metadata);
1080 blob_copy_bytes(metadata, (uint8_t *) params->ParameterValues,
1083 params->StateFlags = blob_read_uint32(metadata);
1084 params->UniformBytes = blob_read_uint32(metadata);
1085 params->FirstStateVarIndex = blob_read_uint32(metadata);
1086 params->LastStateVarIndex = blob_read_uint32(metadata);
1090 write_shader_metadata(struct blob *metadata, gl_linked_shader *shader)
1096 blob_write_uint64(metadata, glprog->DualSlotInputs);
1097 blob_write_bytes(metadata, glprog->TexturesUsed,
1099 blob_write_uint64(metadata, glprog->SamplersUsed);
1101 blob_write_bytes(metadata, glprog->SamplerUnits,
1103 blob_write_bytes(metadata, glprog->sh.SamplerTargets,
1105 blob_write_uint32(metadata, glprog->ShadowSamplers);
1106 blob_write_uint32(metadata, glprog->ExternalSamplersUsed);
1107 blob_write_uint32(metadata, glprog->sh.ShaderStorageBlocksWriteAccess);
1109 blob_write_bytes(metadata, glprog->sh.ImageAccess,
1111 blob_write_bytes(metadata, glprog->sh.ImageUnits,
1116 blob_write_uint32(metadata, glprog->sh.NumBindlessSamplers);
1117 blob_write_uint32(metadata, glprog->sh.HasBoundBindlessSampler);
1119 blob_write_bytes(metadata, &glprog->sh.BindlessSamplers[i],
1123 blob_write_uint32(metadata, glprog->sh.NumBindlessImages);
1124 blob_write_uint32(metadata, glprog->sh.HasBoundBindlessImage);
1126 blob_write_bytes(metadata, &glprog->sh.BindlessImages[i],
1130 write_shader_parameters(metadata, glprog->Parameters);
1134 blob_write_uint32(metadata, (uint32_t)glprog->driver_cache_blob_size);
1136 blob_write_bytes(metadata, glprog->driver_cache_blob,
1142 read_shader_metadata(struct blob_reader *metadata,
1148 glprog->DualSlotInputs = blob_read_uint64(metadata);
1149 blob_copy_bytes(metadata, (uint8_t *) glprog->TexturesUsed,
1151 glprog->SamplersUsed = blob_read_uint64(metadata);
1153 blob_copy_bytes(metadata, (uint8_t *) glprog->SamplerUnits,
1155 blob_copy_bytes(metadata, (uint8_t *) glprog->sh.SamplerTargets,
1157 glprog->ShadowSamplers = blob_read_uint32(metadata);
1158 glprog->ExternalSamplersUsed = blob_read_uint32(metadata);
1159 glprog->sh.ShaderStorageBlocksWriteAccess = blob_read_uint32(metadata);
1161 blob_copy_bytes(metadata, (uint8_t *) glprog->sh.ImageAccess,
1163 blob_copy_bytes(metadata, (uint8_t *) glprog->sh.ImageUnits,
1168 glprog->sh.NumBindlessSamplers = blob_read_uint32(metadata);
1169 glprog->sh.HasBoundBindlessSampler = blob_read_uint32(metadata);
1176 blob_copy_bytes(metadata, (uint8_t *) &glprog->sh.BindlessSamplers[i],
1181 glprog->sh.NumBindlessImages = blob_read_uint32(metadata);
1182 glprog->sh.HasBoundBindlessImage = blob_read_uint32(metadata);
1189 blob_copy_bytes(metadata, (uint8_t *) &glprog->sh.BindlessImages[i],
1195 read_shader_parameters(metadata, glprog->Parameters);
1197 glprog->driver_cache_blob_size = (size_t)blob_read_uint32(metadata);
1201 blob_copy_bytes(metadata, glprog->driver_cache_blob,
1218 struct blob_reader *metadata)
1229 read_shader_metadata(metadata, glprog, linked);
1231 glprog->info.name = ralloc_strdup(glprog, blob_read_string(metadata));
1232 glprog->info.label = ralloc_strdup(glprog, blob_read_string(metadata));
1239 blob_copy_bytes(metadata, ((uint8_t *) &glprog->info) + s_info_ptrs,