glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 21 Oct 2011 18:17:39 +0000 (11:17 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 26 Oct 2011 00:51:43 +0000 (17:51 -0700)
commit1d5d67f8adac9f94715de9804adb536d9a7ec5ee
tree16423340036f8aec696169af5e8a9176035c7ffb
parent384ad987a1dd495681be0a5a04344fe6400e48ec
glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass

Setting this flag prevents declarations of uniforms from being removed
from the IR.  Since the IR is directly used by several API functions
that query uniforms in shaders, uniform declarations cannot be removed
after the locations have been set.  However, it should still be safe
to reorder the declarations (this is not tested).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
src/glsl/glsl_parser_extras.cpp
src/glsl/ir_optimization.h
src/glsl/linker.cpp
src/glsl/main.cpp
src/glsl/opt_dead_code.cpp
src/glsl/test_optpass.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/main/ff_fragment_shader.cpp
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp