glsl: Omit redundant qualifier checks on redeclarations
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 9 Oct 2018 19:01:22 +0000 (12:01 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 15 Nov 2018 22:27:29 +0000 (14:27 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/ast_to_hir.cpp

index 8a41db66b97fda35b4fa8da8c7fb3a4cae865aa5..f1fdd0c4a54759e443ccfa4234f7d96906087094 100644 (file)
@@ -4284,8 +4284,7 @@ get_variable_being_redeclared(ir_variable **var_ptr, YYLTYPE loc,
    } else if ((state->ARB_fragment_coord_conventions_enable ||
               state->is_version(150, 0))
               && strcmp(var->name, "gl_FragCoord") == 0
-              && earlier->type == var->type
-              && var->data.mode == ir_var_shader_in) {
+              && earlier->type == var->type) {
       /* Allow redeclaration of gl_FragCoord for ARB_fcc layout
        * qualifiers.
        */
@@ -4309,8 +4308,7 @@ get_variable_being_redeclared(ir_variable **var_ptr, YYLTYPE loc,
                   || strcmp(var->name, "gl_BackSecondaryColor") == 0
                   || strcmp(var->name, "gl_Color") == 0
                   || strcmp(var->name, "gl_SecondaryColor") == 0)
-              && earlier->type == var->type
-              && earlier->data.mode == var->data.mode) {
+              && earlier->type == var->type) {
       earlier->data.interpolation = var->data.interpolation;
 
       /* Layout qualifiers for gl_FragDepth. */
@@ -4318,8 +4316,7 @@ get_variable_being_redeclared(ir_variable **var_ptr, YYLTYPE loc,
                state->AMD_conservative_depth_enable ||
                state->ARB_conservative_depth_enable)
               && strcmp(var->name, "gl_FragDepth") == 0
-              && earlier->type == var->type
-              && earlier->data.mode == var->data.mode) {
+              && earlier->type == var->type) {
 
       /** From the AMD_conservative_depth spec:
        *     Within any shader, the first redeclarations of gl_FragDepth