unsigned num_blocks = var->data.mode == ir_var_uniform ?
shader->Program->info.num_ubos : shader->NumShaderStorageBlocks;
struct gl_uniform_block **blks = var->data.mode == ir_var_uniform ?
- shader->UniformBlocks : shader->ShaderStorageBlocks;
+ shader->Program->sh.UniformBlocks : shader->ShaderStorageBlocks;
if (var->is_interface_instance()) {
const ir_array_refcount_entry *const entry = v.get_variable_entry(var);
for (unsigned i = 0; i < sh->Program->info.num_ubos; i++) {
sh->num_combined_uniform_components +=
- sh->UniformBlocks[i]->UniformBufferSize / 4;
+ sh->Program->sh.UniformBlocks[i]->UniformBufferSize / 4;
}
}
sh_blks = sh->ShaderStorageBlocks;
} else {
sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ubos;
- sh_blks = sh->UniformBlocks;
+ sh_blks = sh->Program->sh.UniformBlocks;
}
for (unsigned int j = 0; j < sh_num_blocks; j++) {
struct gl_linked_shader *sh = prog->_LinkedShaders[i];
struct gl_uniform_block **sh_blks = validate_ssbo ?
- sh->ShaderStorageBlocks : sh->UniformBlocks;
+ sh->ShaderStorageBlocks : sh->Program->sh.UniformBlocks;
blks[j].stageref |= sh_blks[stage_index]->stageref;
sh_blks[stage_index] = &blks[j];
}
/* Copy ubo blocks to linked shader list */
- linked->UniformBlocks =
+ linked->Program->sh.UniformBlocks =
ralloc_array(linked, gl_uniform_block *, num_ubo_blocks);
ralloc_steal(linked, ubo_blocks);
for (unsigned i = 0; i < num_ubo_blocks; i++) {
- linked->UniformBlocks[i] = &ubo_blocks[i];
+ linked->Program->sh.UniformBlocks[i] = &ubo_blocks[i];
}
linked->Program->info.num_ubos = num_ubo_blocks;
blocks = shader->ShaderStorageBlocks;
} else {
num_blocks = shader->Program->info.num_ubos;
- blocks = shader->UniformBlocks;
+ blocks = shader->Program->sh.UniformBlocks;
}
this->uniform_block = NULL;
for (unsigned i = 0; i < num_blocks; i++) {
for (int i = 0; i < shader->Program->info.num_ubos; i++) {
struct gl_uniform_buffer_binding *binding =
- &ctx->UniformBufferBindings[shader->UniformBlocks[i]->Binding];
+ &ctx->UniformBufferBindings[shader->Program->sh.UniformBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &ubo_surf_offsets[i]);
*/
GLenum ImageAccess[MAX_IMAGE_UNIFORMS];
+ struct gl_uniform_block **UniformBlocks;
+
union {
struct {
/**
*/
unsigned num_combined_uniform_components;
- struct gl_uniform_block **UniformBlocks;
-
unsigned NumShaderStorageBlocks;
struct gl_uniform_block **ShaderStorageBlocks;
struct gl_uniform_buffer_binding *binding;
struct st_buffer_object *st_obj;
- binding = &st->ctx->UniformBufferBindings[shader->UniformBlocks[i]->Binding];
+ binding = &st->ctx->UniformBufferBindings[shader->Program->sh.UniformBlocks[i]->Binding];
st_obj = st_buffer_object(binding->BufferObject);
cb.buffer = st_obj->buffer;
}
}
- if (program->shader) {
- for (i = 0; i < proginfo->info.num_ubos; i++) {
- unsigned size = program->shader->UniformBlocks[i]->UniformBufferSize;
- unsigned num_const_vecs = (size + 15) / 16;
- unsigned first, last;
- assert(num_const_vecs > 0);
- first = 0;
- last = num_const_vecs > 0 ? num_const_vecs - 1 : 0;
- ureg_DECL_constant2D(t->ureg, first, last, i + 1);
- }
+ for (i = 0; i < proginfo->info.num_ubos; i++) {
+ unsigned size = proginfo->sh.UniformBlocks[i]->UniformBufferSize;
+ unsigned num_const_vecs = (size + 15) / 16;
+ unsigned first, last;
+ assert(num_const_vecs > 0);
+ first = 0;
+ last = num_const_vecs > 0 ? num_const_vecs - 1 : 0;
+ ureg_DECL_constant2D(t->ureg, first, last, i + 1);
}
/* Emit immediate values.