From f62eb6c7eb22cd97c691ebdb5f25eb5fe8e9ed11 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 5 Nov 2016 09:24:51 +1100 Subject: st/mesa/glsl/i965: set num_ssbos directly in shader_info Here we also remove the duplicate field in gl_linked_shader and always get the value from shader_info instead. Reviewed-by: Lionel Landwerlin --- src/mesa/drivers/dri/i965/brw_shader.cpp | 11 +++++++---- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index e45f6cce088..cabaf622a6f 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -1207,16 +1207,19 @@ brw_assign_common_binding_table_offsets(gl_shader_stage stage, 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; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 2140312a802..28cb2ca2bd4 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -1408,7 +1408,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, 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]; @@ -1430,7 +1430,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, } } - 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; } -- cgit v1.2.3