if (block_type == BLOCK_SSBO)
prog->data->ShaderStorageBlocks = blks;
- else
+ else {
+ prog->data->NumUniformBlocks = *num_blks;
prog->data->UniformBlocks = blks;
+ }
return true;
}
linked->Program->sh.UniformBlocks =
ralloc_array(linked, struct gl_uniform_block *, num_ubo_blocks);
ralloc_steal(linked, ubo_blocks);
+ linked->Program->sh.NumUniformBlocks = num_ubo_blocks;
for (unsigned i = 0; i < num_ubo_blocks; i++) {
linked->Program->sh.UniformBlocks[i] = &ubo_blocks[i];
}
for (unsigned i = 0; i < num_ubo_blocks; i++) {
linked->Program->sh.UniformBlocks[i] = &ubo_blocks[i];
}
+ linked->Program->sh.NumUniformBlocks = num_ubo_blocks;
linked->Program->info.num_ubos = num_ubo_blocks;
/* Copy ssbo blocks to linked shader list */
struct gl_program *glprog = sh->Program;
- blob_write_uint32(metadata, glprog->info.num_ubos);
+ blob_write_uint32(metadata, glprog->sh.NumUniformBlocks);
blob_write_uint32(metadata, glprog->info.num_ssbos);
- for (unsigned j = 0; j < glprog->info.num_ubos; j++) {
+ for (unsigned j = 0; j < glprog->sh.NumUniformBlocks; j++) {
uint32_t offset =
glprog->sh.UniformBlocks[j] - prog->data->UniformBlocks;
blob_write_uint32(metadata, offset);
struct gl_program *glprog = sh->Program;
- glprog->info.num_ubos = blob_read_uint32(metadata);
+ glprog->sh.NumUniformBlocks = blob_read_uint32(metadata);
glprog->info.num_ssbos = blob_read_uint32(metadata);
glprog->sh.UniformBlocks =
- rzalloc_array(glprog, gl_uniform_block *, glprog->info.num_ubos);
+ rzalloc_array(glprog, gl_uniform_block *, glprog->sh.NumUniformBlocks);
glprog->sh.ShaderStorageBlocks =
rzalloc_array(glprog, gl_uniform_block *, glprog->info.num_ssbos);
- for (unsigned j = 0; j < glprog->info.num_ubos; j++) {
+ for (unsigned j = 0; j < glprog->sh.NumUniformBlocks; j++) {
uint32_t offset = blob_read_uint32(metadata);
glprog->sh.UniformBlocks[j] = prog->data->UniformBlocks + offset;
}