glsl: Throw the required error when a case label is a non-constant.
authorEric Anholt <eric@anholt.net>
Sat, 28 Jan 2012 19:43:22 +0000 (11:43 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 3 Feb 2012 10:06:54 +0000 (11:06 +0100)
commit2c3e10e71935506798c413363df27afc4348fb53
tree7d85b819d3de962e02683222fc5c3164b2cace11
parent22d81f154fed9e004cca91807808ae3b81b01ced
glsl: Throw the required error when a case label is a non-constant.

It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp