diff options
author | Ian Romanick <[email protected]> | 2011-01-31 15:02:24 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-01-31 15:32:56 -0800 |
commit | 14880a510a1a288df0778395097d5a52806abfb0 (patch) | |
tree | 275eb4aa6bd212329277fb36838408a61a3d28f8 /src/glsl/glsl_parser_extras.h | |
parent | e5e34ab18eeaffa465094f6281dfe293b84376db (diff) |
glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver. We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.
NOTE: This is a candidate for the 7.9 and 7.10 branches
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 970275c0d19..8d4fca78773 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -73,6 +73,16 @@ struct _mesa_glsl_parse_state { enum _mesa_glsl_parser_targets target; /** + * Printable list of GLSL versions supported by the current context + * + * \note + * This string should probably be generated per-context instead of per + * invokation of the compiler. This should be changed when the method of + * tracking supported GLSL versions changes. + */ + const char *supported_version_string; + + /** * Implementation defined limits that affect built-in variables, etc. * * \sa struct gl_constants (in mtypes.h) @@ -93,6 +103,22 @@ struct _mesa_glsl_parse_state { /* ARB_draw_buffers */ unsigned MaxDrawBuffers; + + /** + * Set of GLSL versions supported by the current context + * + * Knowing that version X is supported doesn't mean that versions before + * X are also supported. Version 1.00 is only supported in an ES2 + * context or when GL_ARB_ES2_compatibility is supported. In an OpenGL + * 3.0 "forward compatible" context, GLSL 1.10 and 1.20 are \b not + * supported. + */ + /*@{*/ + unsigned GLSL_100ES:1; + unsigned GLSL_110:1; + unsigned GLSL_120:1; + unsigned GLSL_130:1; + /*@}*/ } Const; /** |