/* Restore shader info */
blob_copy_bytes(metadata, (uint8_t *) &glprog->info, sizeof(shader_info));
- if (glprog->info.name)
- glprog->info.name = ralloc_strdup(glprog, blob_read_string(metadata));
- if (glprog->info.label)
- glprog->info.label = ralloc_strdup(glprog, blob_read_string(metadata));
+
+ glprog->info.name = ralloc_strdup(glprog, blob_read_string(metadata));
+ glprog->info.label = ralloc_strdup(glprog, blob_read_string(metadata));
_mesa_reference_shader_program_data(ctx, &glprog->sh.data, prog->data);
_mesa_reference_program(ctx, &linked->Program, glprog);
if (sh->Program->info.name)
blob_write_string(metadata, sh->Program->info.name);
+ else
+ blob_write_string(metadata, "");
if (sh->Program->info.label)
blob_write_string(metadata, sh->Program->info.label);
+ else
+ blob_write_string(metadata, "");
}
}