[Mesa-dev] [PATCH 2/2] glsl: Don't require matching interpolation qualifiers for newer GLSL

Timothy Arceri t_arceri at yahoo.com.au
Wed Mar 16 22:53:57 UTC 2016


Hi Jordan, writing this on my phone so apologies for being brief. I knew I had read the restriction was dropped in Es 3.1 somewhere. However it seems there might be some spec bugs here. The ES GLSL 3.1 and 3.2 specs both have a table that says interpolation must match. Also the GLSL 4.3 spec says they must match see quote in following link.

Also removing the matching requirements will break the way we do packing. Which is addressed by this patch

https://lists.freedesktop.org/archives/mesa-dev/2016-March/110164.html



On 17 March 2016 6:57:27 am AEDT, Jordan Justen <jordan.l.justen at intel.com> wrote:
>The OpenGLES GLSL 3.1 and OpenGL GLSL 4.3 specifications both remove
>the requirement for the output and input interpolation qualifiers to
>match.
>
>Note: I'm changing desktop OpenGL to allow the interpolation to
>differ, starting with 4.3, whereas the code previously used 4.4. (This
>was first added in 32a220f1f60980de50ecefb3b9ab1f754ade8c83.)
>
>The OpenGL 4.2 spec says: "the last active shader stage output
>variables and fragment shader input variables of the same name must
>match in type and qualification (other than out matching to in)"
>
>The OpenGL 4.3 spec says: "interpolation qualification (e.g., flat)
>and auxiliary qualification (e.g. centroid) may differ."
>
>The OpenGLES GLSL 3.00.4 specification says: "The output of the vertex
>shader and the input of the fragment shader form an interface. For
>this interface, vertex shader output variables and fragment shader
>input variables of the same name must match in type and qualification
>(other than precision and out matching to in)."
>
>The OpenGLES GLSL 3.10 Specification says: "interpolation
>qualification (e.g., flat) and auxiliary qualification (e.g. centroid)
>may differ"
>
>Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
>Cc: Tapani Pälli <tapani.palli at intel.com>
>---
> src/compiler/glsl/link_varyings.cpp | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
>diff --git a/src/compiler/glsl/link_varyings.cpp
>b/src/compiler/glsl/link_varyings.cpp
>index 9d7177d..0938cf1 100644
>--- a/src/compiler/glsl/link_varyings.cpp
>+++ b/src/compiler/glsl/link_varyings.cpp
>@@ -172,17 +172,9 @@ cross_validate_types_and_qualifiers(struct
>gl_shader_program *prog,
>       return;
>    }
> 
>-   /* GLSL >= 4.40 removes text requiring interpolation qualifiers
>-    * to match cross stage, they must only match within the same
>stage.
>-    *
>-    * From page 84 (page 90 of the PDF) of the GLSL 4.40 spec:
>-    *
>-    *     "It is a link-time error if, within the same stage, the
>interpolation
>-    *     qualifiers of variables of the same name do not match.
>-    *
>-    */
>-   if (input->data.interpolation != output->data.interpolation &&
>-       prog->Version < 440) {
>+   /* Interpolation must match until OpenGL 4.3 and OpenGLES 3.1 */
>+   if (prog->Version < (prog->IsES ? 310 : 430) &&
>+       input->data.interpolation != output->data.interpolation) {
>       linker_error(prog,
>                    "%s shader output `%s' specifies %s "
>                    "interpolation qualifier, "
>-- 
>2.7.0
>
>_______________________________________________
>mesa-dev mailing list
>mesa-dev at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/mesa-dev

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160317/99ac469a/attachment-0001.html>


More information about the mesa-dev mailing list