st/mesa/glsl/i965: move ImageUnits and ImageAccess fields to gl_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 4 Nov 2016 09:02:21 +0000 (20:02 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 6 Jan 2017 00:21:40 +0000 (11:21 +1100)
commita1da57c19c27505b9eab4792355f2f1b5c774a0a
treeacb5353c05fee5e416c4b2bdd993975818af7687
parent3d2485f011c4f1c7de35871ca359a84415bfcc06
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 <lionel.g.landwerlin@intel.com>
12 files changed:
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl/link_uniforms.cpp
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
src/mesa/drivers/dri/i965/brw_tes_surface_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/main/mtypes.h
src/mesa/main/uniform_query.cpp
src/mesa/state_tracker/st_atom_image.c