if (shader_prog->Label)
shader->info->label = ralloc_strdup(shader, shader_prog->Label);
shader->info->num_textures = util_last_bit(sh->Program->SamplersUsed);
- shader->info->num_ssbos = sh->NumShaderStorageBlocks;
shader->info->clip_distance_array_size = sh->Program->ClipDistanceArraySize;
shader->info->cull_distance_array_size = sh->Program->CullDistanceArraySize;
shader->info->has_transform_feedback_varyings =
var->data.mode == ir_var_shader_storage);
unsigned num_blocks = var->data.mode == ir_var_uniform ?
- shader->Program->info.num_ubos : shader->NumShaderStorageBlocks;
+ shader->Program->info.num_ubos : shader->Program->info.num_ssbos;
struct gl_uniform_block **blks = var->data.mode == ir_var_uniform ?
shader->Program->sh.UniformBlocks : shader->ShaderStorageBlocks;
if (prog->_LinkedShaders[i]) {
if (validate_ssbo) {
max_num_buffer_blocks +=
- prog->_LinkedShaders[i]->NumShaderStorageBlocks;
+ prog->_LinkedShaders[i]->Program->info.num_ssbos;
} else {
max_num_buffer_blocks +=
prog->_LinkedShaders[i]->Program->info.num_ubos;
unsigned sh_num_blocks;
struct gl_uniform_block **sh_blks;
if (validate_ssbo) {
- sh_num_blocks = prog->_LinkedShaders[i]->NumShaderStorageBlocks;
+ sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ssbos;
sh_blks = sh->ShaderStorageBlocks;
} else {
sh_num_blocks = prog->_LinkedShaders[i]->Program->info.num_ubos;
for (unsigned i = 0; i < num_ssbo_blocks; i++) {
linked->ShaderStorageBlocks[i] = &ssbo_blocks[i];
}
- linked->NumShaderStorageBlocks = num_ssbo_blocks;
+ linked->Program->info.num_ssbos = num_ssbo_blocks;
/* At this point linked should contain all of the linked IR, so
* validate it to make sure nothing went wrong.
}
}
- total_shader_storage_blocks += sh->NumShaderStorageBlocks;
+ total_shader_storage_blocks += sh->Program->info.num_ssbos;
total_uniform_blocks += sh->Program->info.num_ubos;
const unsigned max_uniform_blocks =
const unsigned max_shader_storage_blocks =
ctx->Const.Program[i].MaxShaderStorageBlocks;
- if (max_shader_storage_blocks < sh->NumShaderStorageBlocks) {
+ if (max_shader_storage_blocks < sh->Program->info.num_ssbos) {
linker_error(prog, "Too many %s shader storage blocks (%d/%d)\n",
_mesa_shader_stage_to_string(i),
- sh->NumShaderStorageBlocks, max_shader_storage_blocks);
+ sh->Program->info.num_ssbos, max_shader_storage_blocks);
}
}
ctx->Const.Program[i].MaxImageUniforms);
total_image_units += sh->NumImages;
- total_shader_storage_blocks += sh->NumShaderStorageBlocks;
+ total_shader_storage_blocks += sh->Program->info.num_ssbos;
if (i == MESA_SHADER_FRAGMENT) {
foreach_in_list(ir_instruction, node, sh->ir) {
unsigned num_blocks;
struct gl_uniform_block **blocks;
if (this->buffer_access_type != ubo_load_access) {
- num_blocks = shader->NumShaderStorageBlocks;
+ num_blocks = shader->Program->info.num_ssbos;
blocks = shader->ShaderStorageBlocks;
} else {
num_blocks = shader->Program->info.num_ubos;
stage_prog_data->binding_table.texture_start = next_binding_table_offset;
next_binding_table_offset += num_textures;
- if (shader) {
+ if (prog->info.num_ubos) {
assert(prog->info.num_ubos <= BRW_MAX_UBO);
stage_prog_data->binding_table.ubo_start = next_binding_table_offset;
next_binding_table_offset += prog->info.num_ubos;
+ } else {
+ stage_prog_data->binding_table.ubo_start = 0xd0d0d0d0;
+ }
- assert(shader->NumShaderStorageBlocks <= BRW_MAX_SSBO);
+ if (prog->info.num_ssbos) {
+ assert(prog->info.num_ssbos <= BRW_MAX_SSBO);
stage_prog_data->binding_table.ssbo_start = next_binding_table_offset;
- next_binding_table_offset += shader->NumShaderStorageBlocks;
+ next_binding_table_offset += prog->info.num_ssbos;
} else {
- stage_prog_data->binding_table.ubo_start = 0xd0d0d0d0;
stage_prog_data->binding_table.ssbo_start = 0xd0d0d0d0;
}
uint32_t *ssbo_surf_offsets =
&stage_state->surf_offset[prog_data->binding_table.ssbo_start];
- for (int i = 0; i < shader->NumShaderStorageBlocks; i++) {
+ for (int i = 0; i < shader->Program->info.num_ssbos; i++) {
struct gl_shader_storage_buffer_binding *binding =
&ctx->ShaderStorageBufferBindings[shader->ShaderStorageBlocks[i]->Binding];
}
}
- if (shader->Program->info.num_ubos || shader->NumShaderStorageBlocks)
+ if (shader->Program->info.num_ubos || shader->Program->info.num_ssbos)
brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
}
*/
unsigned num_combined_uniform_components;
- unsigned NumShaderStorageBlocks;
struct gl_uniform_block **ShaderStorageBlocks;
struct exec_list *ir;
c = &st->ctx->Const.Program[shader->Stage];
- for (i = 0; i < shader->NumShaderStorageBlocks; i++) {
+ for (i = 0; i < shader->Program->info.num_ssbos; i++) {
struct gl_shader_storage_buffer_binding *binding;
struct st_buffer_object *st_obj;
struct pipe_shader_buffer *sb = &buffers[i];
}
}
st->pipe->set_shader_buffers(st->pipe, shader_type, c->MaxAtomicBuffers,
- shader->NumShaderStorageBlocks, buffers);
+ shader->Program->info.num_ssbos, buffers);
/* clear out any stale shader buffers */
- if (shader->NumShaderStorageBlocks < c->MaxShaderStorageBlocks)
+ if (shader->Program->info.num_ssbos < c->MaxShaderStorageBlocks)
st->pipe->set_shader_buffers(
st->pipe, shader_type,
- c->MaxAtomicBuffers + shader->NumShaderStorageBlocks,
- c->MaxShaderStorageBlocks - shader->NumShaderStorageBlocks,
+ c->MaxAtomicBuffers + shader->Program->info.num_ssbos,
+ c->MaxShaderStorageBlocks - shader->Program->info.num_ssbos,
NULL);
}
if (prog->info.num_ubos)
*states |= new_ubos;
- if (shader->NumShaderStorageBlocks)
+ if (prog->info.num_ssbos)
*states |= new_ssbos;
if (prog->info.num_abos)