mesa: Use gl_shader::Stage instead of gl_shader::Type where possible.
authorPaul Berry <stereotype441@gmail.com>
Tue, 7 Jan 2014 18:58:56 +0000 (10:58 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 8 Jan 2014 15:31:45 +0000 (07:31 -0800)
commite3b86f07da4ba9a4db6b8aae4072af6f1638b7cc
tree1b3c89c2a65cdefd6c39974e19ac337962df42b9
parent65511e5f22e2ba0a5ebd9210319a55d80ea5334e
mesa: Use gl_shader::Stage instead of gl_shader::Type where possible.

This reduces confusion since gl_shader::Type is sometimes
GL_SHADER_PROGRAM_MESA but is more frequently
GL_SHADER_{VERTEX,GEOMETRY,FRAGMENT}.  It also has the advantage that
when switching on gl_shader::Stage, the compiler will alert if one of
the possible enum types is unhandled.  Finally, many functions in
src/glsl (especially those dealing with linking) already use
gl_shader_stage to represent pipeline stages; using gl_shader::Stage
in those functions avoids the need for a conversion.

Note: in the process I changed _mesa_write_shader_to_file() so that if
it encounters an unexpected shader stage, it will use a file suffix of
"????" rather than "geom".

Reviewed-by: Brian Paul <brianp@vmware.com>
v2: Split from patch "mesa: Store gl_shader_stage enum in gl_shader objects."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser_extras.cpp
src/glsl/link_interface_blocks.cpp
src/glsl/link_varyings.cpp
src/glsl/linker.cpp
src/glsl/lower_packed_varyings.cpp
src/glsl/opt_dead_builtin_varyings.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/main/shaderapi.c
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/prog_print.c