glsl: Accept language version 100 and make it the default on ES2.

This commit is contained in:
Kenneth Graunke 2010-08-16 12:34:53 -07:00
parent 814c89abdb
commit 719caa403e
4 changed files with 255 additions and 242 deletions

File diff suppressed because it is too large Load diff

View file

@ -222,6 +222,8 @@ version_statement:
| VERSION INTCONSTANT EOL
{
switch ($2) {
case 100:
state->es_shader = true;
case 110:
case 120:
case 130:

View file

@ -54,9 +54,17 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct __GLcontextRec *ctx,
/* Set default language version and extensions */
this->language_version = 110;
this->es_shader = false;
this->ARB_texture_rectangle_enable = true;
if (ctx != NULL) {
/* OpenGL ES 2.0 has different defaults from desktop GL. */
if (ctx->API == API_OPENGLES2) {
this->language_version = 100;
this->es_shader = true;
this->ARB_texture_rectangle_enable = false;
}
this->extensions = &ctx->Extensions;
this->Const.MaxLights = ctx->Const.MaxLights;

View file

@ -68,6 +68,7 @@ struct _mesa_glsl_parse_state {
exec_list translation_unit;
glsl_symbol_table *symbols;
bool es_shader;
unsigned language_version;
enum _mesa_glsl_parser_targets target;