glsl/mesa: split gl_shader in two
authorTimothy Arceri <timothy.arceri@collabora.com>
Thu, 30 Jun 2016 04:55:40 +0000 (14:55 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 30 Jun 2016 06:51:25 +0000 (16:51 +1000)
commit1fb8c6df884c2a17cf980c4ea32db4c214903b55
treea21b0de699816ce28de37dd61531a025cc984114
parent378f07ccb5bff7857d87a4fe5dff0b5e83f99895
glsl/mesa: split gl_shader in two

There are two distinctly different uses of this struct. The first
is to store GL shader objects. The second is to store information
about a shader stage thats been linked.

The two uses actually share few fields and there is clearly confusion
about their use. For example the linked shaders map one to one with
a program so can simply be destroyed along with the program. However
previously we were calling reference counting on the linked shaders.

We were also creating linked shaders with a name even though it
is always 0 and called the driver version of the _mesa_new_shader()
function unnecessarily for GL shader objects.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
58 files changed:
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/glsl/ir_optimization.h
src/compiler/glsl/link_atomics.cpp
src/compiler/glsl/link_functions.cpp
src/compiler/glsl/link_interface_blocks.cpp
src/compiler/glsl/link_uniform_blocks.cpp
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl/link_uniforms.cpp
src/compiler/glsl/link_varyings.cpp
src/compiler/glsl/link_varyings.h
src/compiler/glsl/linker.cpp
src/compiler/glsl/linker.h
src/compiler/glsl/lower_distance.cpp
src/compiler/glsl/lower_named_interface_blocks.cpp
src/compiler/glsl/lower_packed_varyings.cpp
src/compiler/glsl/lower_shared_reference.cpp
src/compiler/glsl/lower_tess_level.cpp
src/compiler/glsl/lower_ubo_reference.cpp
src/compiler/glsl/lower_vector_derefs.cpp
src/compiler/glsl/lower_vertex_id.cpp
src/compiler/glsl/opt_dead_builtin_varyings.cpp
src/compiler/glsl/standalone.cpp
src/compiler/glsl/standalone_scaffolding.cpp
src/compiler/glsl/standalone_scaffolding.h
src/compiler/glsl/test_optpass.cpp
src/mesa/drivers/common/meta.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_link.cpp
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/i965/brw_program.h
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_tcs.c
src/mesa/drivers/dri/i965/brw_tes.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/main/api_validate.c
src/mesa/main/dd.h
src/mesa/main/ff_fragment_shader.cpp
src/mesa/main/mtypes.h
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.c
src/mesa/main/shaderobj.c
src/mesa/main/shaderobj.h
src/mesa/main/uniform_query.cpp
src/mesa/main/uniforms.c
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/ir_to_mesa.h
src/mesa/program/prog_print.c
src/mesa/program/prog_print.h
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_image.c
src/mesa/state_tracker/st_atom_storagebuf.c
src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_nir.h
src/mesa/state_tracker/st_program.c