From: Eric Anholt Date: Thu, 26 Jul 2012 20:11:05 +0000 (-0700) Subject: glsl: Refuse to parse uniform block declarations when UBOs aren't available. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=803262a5f55ca5b94a09dfe8f35e64a579778209;p=mesa.git glsl: Refuse to parse uniform block declarations when UBOs aren't available. Fixes piglit GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 04c64f096b8..ee6a67288e8 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1929,6 +1929,16 @@ uniform_block: void *ctx = state; $$ = new(ctx) ast_uniform_block(*state->default_uniform_qualifier, $2, $4); + + if (!state->ARB_uniform_buffer_object_enable) { + _mesa_glsl_error(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks\n"); + } else if (state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks\n"); + } } | layout_qualifier UNIFORM NEW_IDENTIFIER '{' member_list '}' ';' { @@ -1939,6 +1949,16 @@ uniform_block: YYERROR; } $$ = new(ctx) ast_uniform_block(qual, $3, $5); + + if (!state->ARB_uniform_buffer_object_enable) { + _mesa_glsl_error(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks\n"); + } else if (state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks\n"); + } } ;