glsl: add extra pp tokens workaround and enable for CoR

The CTS now tests to make sure these are not allowed. However, previously
drivers (including Mesa) would allow them to exist and just issue a
warning. Some old applications such as Champions of Regnum seem to
depend on this.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/422

Fixes: 43047384c3 ("glsl/glcpp: Promote "extra token at end of directive" from warning to error")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7361>
This commit is contained in:
Timothy Arceri
2020-10-29 14:19:01 +11:00
committed by Marge Bot
parent ce0b72a13a
commit a09717c4de
9 changed files with 27 additions and 1 deletions

View File

@@ -781,7 +781,10 @@ replacement_list:
junk:
/* empty */
| pp_tokens {
glcpp_error(&@1, parser, "extra tokens at end of directive");
if (parser->gl_ctx->Const.AllowExtraPPTokens)
glcpp_warning(&@1, parser, "extra tokens at end of directive");
else
glcpp_error(&@1, parser, "extra tokens at end of directive");
}
;