glsl: add has_shader_image_load_store()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 23 Feb 2017 18:04:52 +0000 (19:04 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 27 Feb 2017 18:33:10 +0000 (19:33 +0100)
Preliminary work for ARB_bindless_texture which can interact
with ARB_shader_image_load_store.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser.yy
src/compiler/glsl/glsl_parser_extras.h

index db8418bbc7fceec3409a50115e4eb8fe046a7cb1..fc0443e715684dab27ef6a7b687e06974a1054a9 100644 (file)
@@ -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",
index db29165518070eace280ccd9d21f28966a9285ee..146c96289738304d64c25a0165a64062cbd44358 100644 (file)
@@ -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;
index 9f4a309ca2144eabfc2bae9ee1279696124fc46d..66ed2fa64b4e3536bd64d8102ce7e142f4e26a94 100644 (file)
@@ -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);