program: Allow redundant OPTION ARB_fog_* directives.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 5 Jul 2015 02:15:16 +0000 (19:15 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 17 Jul 2015 03:26:43 +0000 (20:26 -0700)
commit4b17f0d9f58637300b0748d1fb702a7e4d51979f
treefbbe1ae7c637e94a7415b7a89c3b6de1f1025ebf
parent3a31876600cb5c4d90c998ecb5635c602eeb2bd1
program: Allow redundant OPTION ARB_fog_* directives.

A fragment program from "Pixel Piracy" contains redundant OPTION
directives:

!!ARBfp1.0
OPTION ARB_precision_hint_fastest;
OPTION ARB_fog_exp2;
OPTION ARB_precision_hint_fastest;
OPTION ARB_fog_exp2;
...

We already allow redundant ARB_precision_hint_fastest directives, but
disallow the redundant (yet consistent) ARB_fog_exp2 directives, failing
to compile the program.

The specification seems to contradict itself - the main text says that
only one fog application option may be specified, but then backpedals,
indicating the intent is to disallow /contradictory/ flags.  One of the
issues suggests that specifying contradictory ones is stupid, but
allowed, and only the last one should take effect.

Accepting multiple redundant (but consistent) directives seems harmless,
and like a reasonable interpretation of the specification.  It also
fixes a fragment program found in the wild.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/program/program_parse_extra.c