[Mesa-dev] [PATCH 29/46] glsl: add the tessellation extension to the list for the "layout" qualifier

Marek Olšák maraeo at gmail.com
Tue Jun 16 16:01:25 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

This is technically not needed, but it makes the compiler return a better
error message if tessellation is used with GLSL < 1.50.

Instead of:
    error: syntax error, unexpected NEW_IDENTIFIER, expecting $end
It returns:
    error: #version 150 layout qualifier `triangles' used

And the tessellation spec says:
    OpenGL 3.2 and GLSL 1.50 are required.
So it makes perfect sense.
---
 src/glsl/glsl_lexer.ll | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
index 68f1989..41054f1 100644
--- a/src/glsl/glsl_lexer.ll
+++ b/src/glsl/glsl_lexer.ll
@@ -425,7 +425,8 @@ layout		{
 		      || yyextra->ARB_uniform_buffer_object_enable
 		      || yyextra->ARB_fragment_coord_conventions_enable
                       || yyextra->ARB_shading_language_420pack_enable
-                      || yyextra->ARB_compute_shader_enable) {
+                      || yyextra->ARB_compute_shader_enable
+                      || yyextra->ARB_tessellation_shader_enable) {
 		      return LAYOUT_TOK;
 		   } else {
 		      void *mem_ctx = yyextra;
-- 
2.1.0



More information about the mesa-dev mailing list