glsl: don't validate binding when its not needed
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 13 Nov 2015 00:41:52 +0000 (11:41 +1100)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 17 Nov 2015 20:30:19 +0000 (07:30 +1100)
Checking that the flag has been set is all the validation thats
needed here.

Also not calling the binding validation function will make things
much simpler when adding compile time constant support as we
won't need to resolve the binding value.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/glsl/ast_to_hir.cpp

index 9856f16..97e2351 100644 (file)
@@ -6133,8 +6133,11 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
                           "uniform block");
       }
 
-      if (qual->flags.q.explicit_binding)
-         validate_binding_qualifier(state, &loc, decl_type, qual);
+      if (qual->flags.q.explicit_binding) {
+         _mesa_glsl_error(&loc, state,
+                          "binding layout qualifier cannot be applied "
+                          "to struct or interface block members");
+      }
 
       if (qual->flags.q.std140 ||
           qual->flags.q.std430 ||