summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-05 10:10:02 +1100
committerTimothy Arceri <[email protected]>2017-01-06 11:21:41 +1100
commitf5bc127b2f140213a8ceb58c4ed2d9b9a4c0449c (patch)
tree135b5edd05c97dfb21803b56cc1e3352a14a8cb5 /src/mesa
parentf62eb6c7eb22cd97c691ebdb5f25eb5fe8e9ed11 (diff)
st/mesa/glsl/i965: move ShaderStorageBlocks to gl_program
Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader variant but may have lost some required fields. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c2
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/state_tracker/st_atom_storagebuf.c2
3 files changed, 3 insertions, 4 deletions
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 28cb2ca2bd4..220e597338f 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1410,7 +1410,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
for (int i = 0; i < shader->Program->info.num_ssbos; i++) {
struct gl_shader_storage_buffer_binding *binding =
- &ctx->ShaderStorageBufferBindings[shader->ShaderStorageBlocks[i]->Binding];
+ &ctx->ShaderStorageBufferBindings[shader->Program->sh.ShaderStorageBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &ssbo_surf_offsets[i]);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index e4be2ea9a3a..0301eb57f8f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2000,6 +2000,7 @@ struct gl_program
GLenum ImageAccess[MAX_IMAGE_UNIFORMS];
struct gl_uniform_block **UniformBlocks;
+ struct gl_uniform_block **ShaderStorageBlocks;
union {
struct {
@@ -2384,8 +2385,6 @@ struct gl_linked_shader
*/
unsigned num_combined_uniform_components;
- struct gl_uniform_block **ShaderStorageBlocks;
-
struct exec_list *ir;
struct exec_list *packed_varyings;
struct exec_list *fragdata_arrays;
diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src/mesa/state_tracker/st_atom_storagebuf.c
index d01688cd649..e1efd624a4b 100644
--- a/src/mesa/state_tracker/st_atom_storagebuf.c
+++ b/src/mesa/state_tracker/st_atom_storagebuf.c
@@ -59,7 +59,7 @@ st_bind_ssbos(struct st_context *st, struct gl_linked_shader *shader,
struct pipe_shader_buffer *sb = &buffers[i];
binding = &st->ctx->ShaderStorageBufferBindings[
- shader->ShaderStorageBlocks[i]->Binding];
+ shader->Program->sh.ShaderStorageBlocks[i]->Binding];
st_obj = st_buffer_object(binding->BufferObject);
sb->buffer = st_obj->buffer;