[Mesa-dev] [PATCH] glsl: Relax requirement on Centroid matching between shader stages

Marta Lofstedt marta.lofstedt at linux.intel.com
Wed Nov 4 01:04:45 PST 2015


From: Marta Lofstedt <marta.lofstedt at intel.com>

In OpenGL 4.4, section 4.5, the requirement for interpolation
qualifiers to match over shader stages was removed.
In OpenGL ES 3.1, section 9.2.1 there is a table showing that
centroid does not have to match between shader stages.

Also see bug 92743 for more discussions.

Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
---
 src/glsl/link_varyings.cpp | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 7e77a67..d0edc71 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -96,20 +96,6 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
       }
    }
 
-   /* Check that all of the qualifiers match between stages.
-    */
-   if (input->data.centroid != output->data.centroid) {
-      linker_error(prog,
-                   "%s shader output `%s' %s centroid qualifier, "
-                   "but %s shader input %s centroid qualifier\n",
-                   _mesa_shader_stage_to_string(producer_stage),
-                   output->name,
-                   (output->data.centroid) ? "has" : "lacks",
-                   _mesa_shader_stage_to_string(consumer_stage),
-                   (input->data.centroid) ? "has" : "lacks");
-      return;
-   }
-
    if (input->data.sample != output->data.sample) {
       linker_error(prog,
                    "%s shader output `%s' %s sample qualifier, "
-- 
2.1.4



More information about the mesa-dev mailing list