diff options
author | Samuel Pitoiset <[email protected]> | 2017-02-23 19:04:52 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-02-27 19:33:10 +0100 |
commit | de2727925a5b69e7c7fa1fee3c7e7ad0cbabcb02 (patch) | |
tree | 50838199a7317998372f49d032e0155e43955a2c /src/compiler | |
parent | ea8086861f87d26185c01d3ac4a0951bb41dd9d3 (diff) |
glsl: add has_shader_image_load_store()
Preliminary work for ARB_bindless_texture which can interact
with ARB_shader_image_load_store.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/builtin_variables.cpp | 3 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_parser.yy | 3 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.h | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index db8418bbc7f..fc0443e7156 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -840,8 +840,7 @@ builtin_variable_generator::generate_constants() state->Const.MaxTransformFeedbackInterleavedComponents); } - if (state->is_version(420, 310) || - state->ARB_shader_image_load_store_enable) { + if (state->has_shader_image_load_store()) { add_const("gl_MaxImageUnits", state->Const.MaxImageUnits); add_const("gl_MaxVertexImageUniforms", diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index db291655180..146c9628973 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -1318,8 +1318,7 @@ layout_qualifier_id: } /* Layout qualifiers for ARB_shader_image_load_store. */ - if (state->ARB_shader_image_load_store_enable || - state->is_version(420, 310)) { + if (state->has_shader_image_load_store()) { if (!$$.flags.i) { static const struct { const char *name; diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 9f4a309ca21..66ed2fa64b4 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -330,6 +330,11 @@ struct _mesa_glsl_parse_state { is_version(400, 320); } + bool has_shader_image_load_store() const + { + return ARB_shader_image_load_store_enable || is_version(420, 310); + } + void process_version_directive(YYLTYPE *locp, int version, const char *ident); |