glsl: handle a switch where default is in the middle of cases
authorTapani Pälli <tapani.palli@intel.com>
Mon, 14 Jul 2014 06:45:46 +0000 (09:45 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 17 Jul 2014 04:39:12 +0000 (07:39 +0300)
commit48deb4dbf278c03ea49aeaa7f9d9eda231def817
tree90e159a25940475d0510c5eec6be435c51273dfd
parent9e47ed2f77d8c274104cdcbc6b7c0c7334c50fdb
glsl: handle a switch where default is in the middle of cases

This fixes following tests in es3conform:

   shaders.switch.default_not_last_dynamic_vertex
   shaders.switch.default_not_last_dynamic_fragment

and makes following tests in Piglit pass:

   glsl-1.30/execution/switch/fs-default-notlast-fallthrough
   glsl-1.30/execution/switch/fs-default_notlast

No Piglit regressions.

v2: take away unnecessary ir_if, just use conditional assignment
v3: use foreach_in_list instead of foreach_list

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
src/glsl/ast_to_hir.cpp
src/glsl/glsl_parser_extras.h