diff options
author | Kenneth Graunke <[email protected]> | 2013-09-23 18:18:14 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-09-26 16:55:18 -0700 |
commit | f91475d4ab7e1328904a1df443fbf85ed8acb7f3 (patch) | |
tree | 0915c00a53c92fd9f65266028a1d8ee4d4978859 /src/glsl/glsl_parser.yy | |
parent | e4af55c78f9d639653bb9290e0fc63c6658cdc4d (diff) |
glsl: Create and use a has_uniform_buffer_objects() helper.
This is better than overriding the extension enable based on the
language version; it's robust against shaders that do:
#version 140
#extension GL_ARB_uniform_buffer_object : disable
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser.yy')
-rw-r--r-- | src/glsl/glsl_parser.yy | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 56ca4ad8b07..912931a4786 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1200,7 +1200,7 @@ layout_qualifier_id: } /* See also interface_block_layout_qualifier. */ - if (!$$.flags.i && state->ARB_uniform_buffer_object_enable) { + if (!$$.flags.i && state->has_uniform_buffer_objects()) { if (strcmp($1, "std140") == 0) { $$.flags.q.std140 = 1; } else if (strcmp($1, "shared") == 0) { @@ -1328,7 +1328,7 @@ layout_qualifier_id: { $$ = $1; /* Layout qualifiers for ARB_uniform_buffer_object. */ - if ($$.flags.q.uniform && !state->ARB_uniform_buffer_object_enable) { + if ($$.flags.q.uniform && !state->has_uniform_buffer_objects()) { _mesa_glsl_error(& @1, state, "#version 140 / GL_ARB_uniform_buffer_object " "layout qualifier `%s' is used", $1); @@ -2138,7 +2138,7 @@ basic_interface_block: block->declarations.push_degenerate_list_at_head(& $4->link); if ($1.flags.q.uniform) { - if (!state->ARB_uniform_buffer_object_enable) { + if (!state->has_uniform_buffer_objects()) { _mesa_glsl_error(& @1, state, "#version 140 / GL_ARB_uniform_buffer_object " "required for defining uniform blocks"); |