}
static void
-write_uniform_remap_table(struct blob *metadata,
- struct gl_shader_program *prog)
+write_uniform_remap_tables(struct blob *metadata,
+ struct gl_shader_program *prog)
{
blob_write_uint32(metadata, prog->NumUniformRemapTable);
write_uniform_remap_table_entry(metadata, prog->data->UniformStorage,
prog->UniformRemapTable[i]);
}
+
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+ struct gl_linked_shader *sh = prog->_LinkedShaders[i];
+ if (sh) {
+ struct gl_program *glprog = sh->Program;
+ blob_write_uint32(metadata, glprog->sh.NumSubroutineUniformRemapTable);
+
+ for (unsigned j = 0; j < glprog->sh.NumSubroutineUniformRemapTable; j++) {
+ write_uniform_remap_table_entry(metadata,
+ prog->data->UniformStorage,
+ glprog->sh.SubroutineUniformRemapTable[j]);
+ }
+ }
+ }
}
static void
}
static void
-read_uniform_remap_table(struct blob_reader *metadata,
- struct gl_shader_program *prog)
+read_uniform_remap_tables(struct blob_reader *metadata,
+ struct gl_shader_program *prog)
{
prog->NumUniformRemapTable = blob_read_uint32(metadata);
read_uniform_remap_table_entry(metadata, prog->data->UniformStorage,
&prog->UniformRemapTable[i], type);
}
+
+ for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+ struct gl_linked_shader *sh = prog->_LinkedShaders[i];
+ if (sh) {
+ struct gl_program *glprog = sh->Program;
+ glprog->sh.NumSubroutineUniformRemapTable = blob_read_uint32(metadata);
+
+ glprog->sh.SubroutineUniformRemapTable =
+ rzalloc_array(glprog, struct gl_uniform_storage *,
+ glprog->sh.NumSubroutineUniformRemapTable);
+
+ for (unsigned j = 0; j < glprog->sh.NumSubroutineUniformRemapTable; j++) {
+ enum uniform_remap_type type =
+ (enum uniform_remap_type) blob_read_uint32(metadata);
+
+ read_uniform_remap_table_entry(metadata,
+ prog->data->UniformStorage,
+ &glprog->sh.SubroutineUniformRemapTable[j],
+ type);
+ }
+ }
+ }
}
struct whte_closure
write_xfb(metadata, prog);
- write_uniform_remap_table(metadata, prog);
+ write_uniform_remap_tables(metadata, prog);
write_subroutines(metadata, prog);
read_xfb(&metadata, prog);
- read_uniform_remap_table(&metadata, prog);
+ read_uniform_remap_tables(&metadata, prog);
read_subroutines(&metadata, prog);