From a1da57c19c27505b9eab4792355f2f1b5c774a0a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 4 Nov 2016 20:02:21 +1100 Subject: st/mesa/glsl/i965: move ImageUnits and ImageAccess fields 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. We drop the memset on ImageUnits because gl_program is already created using rzalloc(). Reviewed-by: Lionel Landwerlin --- src/mesa/state_tracker/st_atom_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c index a7b7371bfee..b30006a143c 100644 --- a/src/mesa/state_tracker/st_atom_image.c +++ b/src/mesa/state_tracker/st_atom_image.c @@ -58,7 +58,8 @@ st_bind_images(struct st_context *st, struct gl_linked_shader *shader, c = &st->ctx->Const.Program[shader->Stage]; for (i = 0; i < shader->NumImages; i++) { - struct gl_image_unit *u = &st->ctx->ImageUnits[shader->ImageUnits[i]]; + struct gl_image_unit *u = + &st->ctx->ImageUnits[shader->Program->sh.ImageUnits[i]]; struct st_texture_object *stObj = st_texture_object(u->TexObj); struct pipe_image_view *img = &images[i]; -- cgit v1.2.3