• Home
  • Raw
  • Download

Lines Matching refs:prog

43 write_subroutines(struct blob *metadata, struct gl_shader_program *prog)  in write_subroutines()  argument
46 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in write_subroutines()
71 read_subroutines(struct blob_reader *metadata, struct gl_shader_program *prog) in read_subroutines() argument
76 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in read_subroutines()
86 subs = rzalloc_array(prog, struct gl_subroutine_function, in read_subroutines()
91 subs[j].name.string = ralloc_strdup(prog, blob_read_string (metadata)); in read_subroutines()
96 subs[j].types = rzalloc_array(prog, const struct glsl_type *, in read_subroutines()
123 write_buffer_blocks(struct blob *metadata, struct gl_shader_program *prog) in write_buffer_blocks() argument
125 blob_write_uint32(metadata, prog->data->NumUniformBlocks); in write_buffer_blocks()
126 blob_write_uint32(metadata, prog->data->NumShaderStorageBlocks); in write_buffer_blocks()
128 for (unsigned i = 0; i < prog->data->NumUniformBlocks; i++) { in write_buffer_blocks()
129 write_buffer_block(metadata, &prog->data->UniformBlocks[i]); in write_buffer_blocks()
132 for (unsigned i = 0; i < prog->data->NumShaderStorageBlocks; i++) { in write_buffer_blocks()
133 write_buffer_block(metadata, &prog->data->ShaderStorageBlocks[i]); in write_buffer_blocks()
137 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in write_buffer_blocks()
148 glprog->sh.UniformBlocks[j] - prog->data->UniformBlocks; in write_buffer_blocks()
154 prog->data->ShaderStorageBlocks; in write_buffer_blocks()
162 struct gl_shader_program *prog) in read_buffer_block() argument
164 b->name.string = ralloc_strdup(prog->data, blob_read_string (metadata)); in read_buffer_block()
172 rzalloc_array(prog->data, struct gl_uniform_buffer_variable, in read_buffer_block()
175 b->Uniforms[j].Name = ralloc_strdup(prog->data, in read_buffer_block()
182 b->Uniforms[j].IndexName = ralloc_strdup(prog->data, index_name); in read_buffer_block()
192 struct gl_shader_program *prog) in read_buffer_blocks() argument
194 prog->data->NumUniformBlocks = blob_read_uint32(metadata); in read_buffer_blocks()
195 prog->data->NumShaderStorageBlocks = blob_read_uint32(metadata); in read_buffer_blocks()
197 prog->data->UniformBlocks = in read_buffer_blocks()
198 rzalloc_array(prog->data, struct gl_uniform_block, in read_buffer_blocks()
199 prog->data->NumUniformBlocks); in read_buffer_blocks()
201 prog->data->ShaderStorageBlocks = in read_buffer_blocks()
202 rzalloc_array(prog->data, struct gl_uniform_block, in read_buffer_blocks()
203 prog->data->NumShaderStorageBlocks); in read_buffer_blocks()
205 for (unsigned i = 0; i < prog->data->NumUniformBlocks; i++) { in read_buffer_blocks()
206 read_buffer_block(metadata, &prog->data->UniformBlocks[i], prog); in read_buffer_blocks()
209 for (unsigned i = 0; i < prog->data->NumShaderStorageBlocks; i++) { in read_buffer_blocks()
210 read_buffer_block(metadata, &prog->data->ShaderStorageBlocks[i], prog); in read_buffer_blocks()
214 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in read_buffer_blocks()
230 glprog->sh.UniformBlocks[j] = prog->data->UniformBlocks + offset; in read_buffer_blocks()
236 prog->data->ShaderStorageBlocks + offset; in read_buffer_blocks()
242 write_atomic_buffers(struct blob *metadata, struct gl_shader_program *prog) in write_atomic_buffers() argument
244 blob_write_uint32(metadata, prog->data->NumAtomicBuffers); in write_atomic_buffers()
247 if (prog->_LinkedShaders[i]) { in write_atomic_buffers()
248 struct gl_program *glprog = prog->_LinkedShaders[i]->Program; in write_atomic_buffers()
253 for (unsigned i = 0; i < prog->data->NumAtomicBuffers; i++) { in write_atomic_buffers()
254 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].Binding); in write_atomic_buffers()
255 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].MinimumSize); in write_atomic_buffers()
256 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].NumUniforms); in write_atomic_buffers()
258 blob_write_bytes(metadata, prog->data->AtomicBuffers[i].StageReferences, in write_atomic_buffers()
259 sizeof(prog->data->AtomicBuffers[i].StageReferences)); in write_atomic_buffers()
261 for (unsigned j = 0; j < prog->data->AtomicBuffers[i].NumUniforms; j++) { in write_atomic_buffers()
262 blob_write_uint32(metadata, prog->data->AtomicBuffers[i].Uniforms[j]); in write_atomic_buffers()
269 struct gl_shader_program *prog) in read_atomic_buffers() argument
271 prog->data->NumAtomicBuffers = blob_read_uint32(metadata); in read_atomic_buffers()
272 prog->data->AtomicBuffers = in read_atomic_buffers()
273 rzalloc_array(prog, gl_active_atomic_buffer, in read_atomic_buffers()
274 prog->data->NumAtomicBuffers); in read_atomic_buffers()
278 if (prog->_LinkedShaders[i]) { in read_atomic_buffers()
279 struct gl_program *glprog = prog->_LinkedShaders[i]->Program; in read_atomic_buffers()
289 for (unsigned i = 0; i < prog->data->NumAtomicBuffers; i++) { in read_atomic_buffers()
290 prog->data->AtomicBuffers[i].Binding = blob_read_uint32(metadata); in read_atomic_buffers()
291 prog->data->AtomicBuffers[i].MinimumSize = blob_read_uint32(metadata); in read_atomic_buffers()
292 prog->data->AtomicBuffers[i].NumUniforms = blob_read_uint32(metadata); in read_atomic_buffers()
295 (uint8_t *) &prog->data->AtomicBuffers[i].StageReferences, in read_atomic_buffers()
296 sizeof(prog->data->AtomicBuffers[i].StageReferences)); in read_atomic_buffers()
298 prog->data->AtomicBuffers[i].Uniforms = rzalloc_array(prog, unsigned, in read_atomic_buffers()
299 prog->data->AtomicBuffers[i].NumUniforms); in read_atomic_buffers()
301 for (unsigned j = 0; j < prog->data->AtomicBuffers[i].NumUniforms; j++) { in read_atomic_buffers()
302 prog->data->AtomicBuffers[i].Uniforms[j] = blob_read_uint32(metadata); in read_atomic_buffers()
306 if (prog->data->AtomicBuffers[i].StageReferences[j]) { in read_atomic_buffers()
307 *stage_buff_list[j] = &prog->data->AtomicBuffers[i]; in read_atomic_buffers()
317 struct gl_program *prog = shProg->last_vert_prog; in write_xfb() local
319 if (!prog) { in write_xfb()
324 struct gl_transform_feedback_info *ltf = prog->sh.LinkedTransformFeedback; in write_xfb()
326 blob_write_uint32(metadata, prog->info.stage); in write_xfb()
384 struct gl_program *prog = shProg->_LinkedShaders[xfb_stage]->Program; in read_xfb() local
386 rzalloc(prog, struct gl_transform_feedback_info); in read_xfb()
388 prog->sh.LinkedTransformFeedback = ltf; in read_xfb()
389 shProg->last_vert_prog = prog; in read_xfb()
395 ltf->Outputs = rzalloc_array(prog, struct gl_transform_feedback_output, in read_xfb()
402 ltf->Varyings = rzalloc_array(prog, in read_xfb()
407 ltf->Varyings[i].name.string = ralloc_strdup(prog, blob_read_string(metadata)); in read_xfb()
421 has_uniform_storage(struct gl_shader_program *prog, unsigned idx) in has_uniform_storage() argument
423 if (!prog->data->UniformStorage[idx].builtin && in has_uniform_storage()
424 !prog->data->UniformStorage[idx].is_shader_storage && in has_uniform_storage()
425 prog->data->UniformStorage[idx].block_index == -1) in has_uniform_storage()
432 write_uniforms(struct blob *metadata, struct gl_shader_program *prog) in write_uniforms() argument
434 blob_write_uint32(metadata, prog->SamplersValidated); in write_uniforms()
435 blob_write_uint32(metadata, prog->data->NumUniformStorage); in write_uniforms()
436 blob_write_uint32(metadata, prog->data->NumUniformDataSlots); in write_uniforms()
438 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in write_uniforms()
439 encode_type_to_blob(metadata, prog->data->UniformStorage[i].type); in write_uniforms()
440 blob_write_uint32(metadata, prog->data->UniformStorage[i].array_elements); in write_uniforms()
441 if (prog->data->UniformStorage[i].name.string) { in write_uniforms()
442 blob_write_string(metadata, prog->data->UniformStorage[i].name.string); in write_uniforms()
446 blob_write_uint32(metadata, prog->data->UniformStorage[i].builtin); in write_uniforms()
447 blob_write_uint32(metadata, prog->data->UniformStorage[i].remap_location); in write_uniforms()
448 blob_write_uint32(metadata, prog->data->UniformStorage[i].block_index); in write_uniforms()
449 blob_write_uint32(metadata, prog->data->UniformStorage[i].atomic_buffer_index); in write_uniforms()
450 blob_write_uint32(metadata, prog->data->UniformStorage[i].offset); in write_uniforms()
451 blob_write_uint32(metadata, prog->data->UniformStorage[i].array_stride); in write_uniforms()
452 blob_write_uint32(metadata, prog->data->UniformStorage[i].hidden); in write_uniforms()
453 blob_write_uint32(metadata, prog->data->UniformStorage[i].is_shader_storage); in write_uniforms()
454 blob_write_uint32(metadata, prog->data->UniformStorage[i].active_shader_mask); in write_uniforms()
455 blob_write_uint32(metadata, prog->data->UniformStorage[i].matrix_stride); in write_uniforms()
456 blob_write_uint32(metadata, prog->data->UniformStorage[i].row_major); in write_uniforms()
457 blob_write_uint32(metadata, prog->data->UniformStorage[i].is_bindless); in write_uniforms()
459 prog->data->UniformStorage[i].num_compatible_subroutines); in write_uniforms()
461 prog->data->UniformStorage[i].top_level_array_size); in write_uniforms()
463 prog->data->UniformStorage[i].top_level_array_stride); in write_uniforms()
465 if (has_uniform_storage(prog, i)) { in write_uniforms()
466 blob_write_uint32(metadata, prog->data->UniformStorage[i].storage - in write_uniforms()
467 prog->data->UniformDataSlots); in write_uniforms()
470 blob_write_bytes(metadata, prog->data->UniformStorage[i].opaque, in write_uniforms()
471 sizeof(prog->data->UniformStorage[i].opaque)); in write_uniforms()
479 blob_write_uint32(metadata, prog->data->NumHiddenUniforms); in write_uniforms()
480 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in write_uniforms()
481 if (has_uniform_storage(prog, i)) { in write_uniforms()
483 prog->data->UniformStorage[i].type->component_slots() * in write_uniforms()
484 MAX2(prog->data->UniformStorage[i].array_elements, 1); in write_uniforms()
486 prog->data->UniformStorage[i].storage - in write_uniforms()
487 prog->data->UniformDataSlots; in write_uniforms()
488 blob_write_bytes(metadata, &prog->data->UniformDataDefaults[slot], in write_uniforms()
495 read_uniforms(struct blob_reader *metadata, struct gl_shader_program *prog) in read_uniforms() argument
500 prog->SamplersValidated = blob_read_uint32(metadata); in read_uniforms()
501 prog->data->NumUniformStorage = blob_read_uint32(metadata); in read_uniforms()
502 prog->data->NumUniformDataSlots = blob_read_uint32(metadata); in read_uniforms()
504 uniforms = rzalloc_array(prog->data, struct gl_uniform_storage, in read_uniforms()
505 prog->data->NumUniformStorage); in read_uniforms()
506 prog->data->UniformStorage = uniforms; in read_uniforms()
509 prog->data->NumUniformDataSlots); in read_uniforms()
510 prog->data->UniformDataSlots = data; in read_uniforms()
511 prog->data->UniformDataDefaults = in read_uniforms()
513 prog->data->NumUniformDataSlots); in read_uniforms()
515 prog->UniformHash = new string_to_uint_map; in read_uniforms()
517 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in read_uniforms()
520 uniforms[i].name.string = ralloc_strdup(prog, blob_read_string (metadata)); in read_uniforms()
537 prog->UniformHash->put(i, uniforms[i].name.string); in read_uniforms()
539 if (has_uniform_storage(prog, i)) { in read_uniforms()
549 prog->data->NumHiddenUniforms = blob_read_uint32(metadata); in read_uniforms()
550 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in read_uniforms()
551 if (has_uniform_storage(prog, i)) { in read_uniforms()
553 prog->data->UniformStorage[i].type->component_slots() * in read_uniforms()
554 MAX2(prog->data->UniformStorage[i].array_elements, 1); in read_uniforms()
556 prog->data->UniformStorage[i].storage - in read_uniforms()
557 prog->data->UniformDataSlots; in read_uniforms()
559 (uint8_t *) &prog->data->UniformDataSlots[slot], in read_uniforms()
562 assert(vec_size + prog->data->UniformStorage[i].storage <= in read_uniforms()
563 data + prog->data->NumUniformDataSlots); in read_uniforms()
567 memcpy(prog->data->UniformDataDefaults, prog->data->UniformDataSlots, in read_uniforms()
568 sizeof(union gl_constant_value) * prog->data->NumUniformDataSlots); in read_uniforms()
622 struct gl_shader_program *prog) in write_uniform_remap_tables() argument
624 write_uniform_remap_table(metadata, prog->NumUniformRemapTable, in write_uniform_remap_tables()
625 prog->data->UniformStorage, in write_uniform_remap_tables()
626 prog->UniformRemapTable); in write_uniform_remap_tables()
629 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in write_uniform_remap_tables()
633 prog->data->UniformStorage, in write_uniform_remap_tables()
641 struct gl_shader_program *prog, in read_uniform_remap_table() argument
649 rzalloc_array(prog, struct gl_uniform_storage *, num); in read_uniform_remap_table()
677 struct gl_shader_program *prog) in read_uniform_remap_tables() argument
679 prog->UniformRemapTable = in read_uniform_remap_tables()
680 read_uniform_remap_table(metadata, prog, &prog->NumUniformRemapTable, in read_uniform_remap_tables()
681 prog->data->UniformStorage); in read_uniform_remap_tables()
684 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in read_uniform_remap_tables()
689 read_uniform_remap_table(metadata, prog, in read_uniform_remap_tables()
691 prog->data->UniformStorage); in read_uniform_remap_tables()
751 write_hash_tables(struct blob *metadata, struct gl_shader_program *prog) in write_hash_tables() argument
753 write_hash_table(metadata, prog->AttributeBindings); in write_hash_tables()
754 write_hash_table(metadata, prog->FragDataBindings); in write_hash_tables()
755 write_hash_table(metadata, prog->FragDataIndexBindings); in write_hash_tables()
759 read_hash_tables(struct blob_reader *metadata, struct gl_shader_program *prog) in read_hash_tables() argument
761 read_hash_table(metadata, prog->AttributeBindings); in read_hash_tables()
762 read_hash_table(metadata, prog->FragDataBindings); in read_hash_tables()
763 read_hash_table(metadata, prog->FragDataIndexBindings); in read_hash_tables()
802 struct gl_shader_program *prog, in write_program_resource_data() argument
831 for (unsigned i = 0; i < prog->data->NumUniformBlocks; i++) { in write_program_resource_data()
833 prog->data->UniformBlocks[i].name.string) == 0) { in write_program_resource_data()
840 for (unsigned i = 0; i < prog->data->NumShaderStorageBlocks; i++) { in write_program_resource_data()
842 prog->data->ShaderStorageBlocks[i].name.string) == 0) { in write_program_resource_data()
859 for (unsigned i = 0; i < prog->data->NumUniformStorage; i++) { in write_program_resource_data()
861 prog->data->UniformStorage[i].name.string) == 0) { in write_program_resource_data()
872 for (unsigned i = 0; i < prog->data->NumAtomicBuffers; i++) { in write_program_resource_data()
874 prog->data->AtomicBuffers[i].Binding) { in write_program_resource_data()
883 prog->last_vert_prog->sh.LinkedTransformFeedback->Buffers[i].Binding) { in write_program_resource_data()
890 for (int i = 0; i < prog->last_vert_prog->sh.LinkedTransformFeedback->NumVarying; i++) { in write_program_resource_data()
892prog->last_vert_prog->sh.LinkedTransformFeedback->Varyings[i].name.string) == 0) { in write_program_resource_data()
905 prog->_LinkedShaders[_mesa_shader_stage_from_subroutine(res->Type)]; in write_program_resource_data()
915 struct gl_shader_program *prog, in read_program_resource_data() argument
923 gl_shader_variable *var = ralloc(prog, struct gl_shader_variable); in read_program_resource_data()
929 var->name.string = ralloc_strdup(prog, blob_read_string(metadata)); in read_program_resource_data()
942 res->Data = &prog->data->UniformBlocks[blob_read_uint32(metadata)]; in read_program_resource_data()
945 res->Data = &prog->data->ShaderStorageBlocks[blob_read_uint32(metadata)]; in read_program_resource_data()
957 res->Data = &prog->data->UniformStorage[blob_read_uint32(metadata)]; in read_program_resource_data()
959 res->Data = prog->UniformRemapTable[blob_read_uint32(metadata)]; in read_program_resource_data()
964 res->Data = &prog->data->AtomicBuffers[blob_read_uint32(metadata)]; in read_program_resource_data()
967 res->Data = &prog->last_vert_prog-> in read_program_resource_data()
971 res->Data = &prog->last_vert_prog-> in read_program_resource_data()
981 prog->_LinkedShaders[_mesa_shader_stage_from_subroutine(res->Type)]; in read_program_resource_data()
992 struct gl_shader_program *prog) in write_program_resource_list() argument
994 blob_write_uint32(metadata, prog->data->NumProgramResourceList); in write_program_resource_list()
996 for (unsigned i = 0; i < prog->data->NumProgramResourceList; i++) { in write_program_resource_list()
997 blob_write_uint32(metadata, prog->data->ProgramResourceList[i].Type); in write_program_resource_list()
998 write_program_resource_data(metadata, prog, in write_program_resource_list()
999 &prog->data->ProgramResourceList[i]); in write_program_resource_list()
1001 &prog->data->ProgramResourceList[i].StageReferences, in write_program_resource_list()
1002 sizeof(prog->data->ProgramResourceList[i].StageReferences)); in write_program_resource_list()
1008 struct gl_shader_program *prog) in read_program_resource_list() argument
1010 prog->data->NumProgramResourceList = blob_read_uint32(metadata); in read_program_resource_list()
1012 prog->data->ProgramResourceList = in read_program_resource_list()
1013 ralloc_array(prog->data, gl_program_resource, in read_program_resource_list()
1014 prog->data->NumProgramResourceList); in read_program_resource_list()
1016 for (unsigned i = 0; i < prog->data->NumProgramResourceList; i++) { in read_program_resource_list()
1017 prog->data->ProgramResourceList[i].Type = blob_read_uint32(metadata); in read_program_resource_list()
1018 read_program_resource_data(metadata, prog, in read_program_resource_list()
1019 &prog->data->ProgramResourceList[i]); in read_program_resource_list()
1021 (uint8_t *) &prog->data->ProgramResourceList[i].StageReferences, in read_program_resource_list()
1022 sizeof(prog->data->ProgramResourceList[i].StageReferences)); in read_program_resource_list()
1222 struct gl_shader_program *prog, in create_linked_shader_and_program() argument
1230 glprog = ctx->Driver.NewProgram(ctx, stage, prog->Name, false); in create_linked_shader_and_program()
1247 _mesa_reference_shader_program_data(&glprog->sh.data, prog->data); in create_linked_shader_and_program()
1249 prog->_LinkedShaders[stage] = linked; in create_linked_shader_and_program()
1254 struct gl_shader_program *prog) in serialize_glsl_program() argument
1256 blob_write_bytes(blob, prog->data->sha1, sizeof(prog->data->sha1)); in serialize_glsl_program()
1258 write_uniforms(blob, prog); in serialize_glsl_program()
1260 write_hash_tables(blob, prog); in serialize_glsl_program()
1262 blob_write_uint32(blob, prog->data->Version); in serialize_glsl_program()
1263 blob_write_uint32(blob, prog->IsES); in serialize_glsl_program()
1264 blob_write_uint32(blob, prog->data->linked_stages); in serialize_glsl_program()
1267 struct gl_linked_shader *sh = prog->_LinkedShaders[i]; in serialize_glsl_program()
1292 write_xfb(blob, prog); in serialize_glsl_program()
1294 write_uniform_remap_tables(blob, prog); in serialize_glsl_program()
1296 write_atomic_buffers(blob, prog); in serialize_glsl_program()
1298 write_buffer_blocks(blob, prog); in serialize_glsl_program()
1300 write_subroutines(blob, prog); in serialize_glsl_program()
1302 write_program_resource_list(blob, prog); in serialize_glsl_program()
1307 struct gl_shader_program *prog) in deserialize_glsl_program() argument
1310 if (prog->Name == 0) in deserialize_glsl_program()
1313 assert(prog->data->UniformStorage == NULL); in deserialize_glsl_program()
1315 blob_copy_bytes(blob, prog->data->sha1, sizeof(prog->data->sha1)); in deserialize_glsl_program()
1317 read_uniforms(blob, prog); in deserialize_glsl_program()
1319 read_hash_tables(blob, prog); in deserialize_glsl_program()
1321 prog->data->Version = blob_read_uint32(blob); in deserialize_glsl_program()
1322 prog->IsES = blob_read_uint32(blob); in deserialize_glsl_program()
1323 prog->data->linked_stages = blob_read_uint32(blob); in deserialize_glsl_program()
1325 unsigned mask = prog->data->linked_stages; in deserialize_glsl_program()
1328 create_linked_shader_and_program(ctx, (gl_shader_stage) j, prog, in deserialize_glsl_program()
1332 read_xfb(blob, prog); in deserialize_glsl_program()
1334 read_uniform_remap_tables(blob, prog); in deserialize_glsl_program()
1336 read_atomic_buffers(blob, prog); in deserialize_glsl_program()
1338 read_buffer_blocks(blob, prog); in deserialize_glsl_program()
1340 read_subroutines(blob, prog); in deserialize_glsl_program()
1342 read_program_resource_list(blob, prog); in deserialize_glsl_program()