Skip to content
Snippets Groups Projects
Commit 2385fe47 authored by Kenneth Graunke's avatar Kenneth Graunke Committed by Ian Romanick
Browse files

glsl: Bail on parsing if the #version directive is bogus.


If we didn't successfully parse the #version line, there's no point in
continuing with parsing and compiling: it's already failed.

Furthermore, it can actually be harmful: right after handling #version,
we call _mesa_glsl_initialize_types(), which checks state->es_shader and
language_version.  If it isn't valid, it hits an assertion failure.

Fixes Piglit's "invalid-version-es."  When processing "#version 110 es",
our code set state->es_shader and state->language_version = 110.  It
then properly determined that this was invalid and flagged an error.
Since we continued anyway, we hit the assertion mentioned above.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f730b1f7)
parent 886cf1e7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment