Bug 107734 - [GLSL] glsl-fface-invariant, glsl-fcoord-invariant and glsl-pcoord-invariant should fail
Summary: [GLSL] glsl-fface-invariant, glsl-fcoord-invariant and glsl-pcoord-invariant ...
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
Depends on:
Reported: 2018-08-29 09:12 UTC by vadym
Modified: 2018-09-12 16:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Description vadym 2018-08-29 09:12:06 UTC
GLSL ES 1.0 linker tests glsl-fface-invariant, glsl-fcoord-invariant and glsl-pcoord-invariant have to fail as specified in spec: 

4.6.4 Invariance and Linkage
The invariance of varyings that are declared in both the vertex and fragment shaders must match.For the built-in special variables, gl_FragCoord can only be declared invariant if and only if gl_Position is declared invariant. Similarly gl_PointCoord can only be declared invariant if and only if gl_PointSize is
declared invariant. It is an error to declare gl_FrontFacing as invariant. The invariance of gl_FrontFacing is the same as the invariance of gl_Position.
Comment 1 vadym 2018-08-29 12:13:14 UTC
Patch: https://patchwork.freedesktop.org/patch/246321/
Comment 2 Tapani Pälli 2018-09-03 08:00:48 UTC
Seems a bit like : https://patchwork.freedesktop.org/patch/36417/

IIRC there was some issue with that patch ... or not. Vadym, please check if this fixes the WebGL tests also?
Comment 3 vadym 2018-09-04 08:22:01 UTC
Hi Tapani,

Yep, looks like patches are almost the same. I didn't expected that some patches can be on review since 2014 :)

I checked following WebGL tests which are related to invariance:

1) conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html (Passed: 3/3 in 100.0 ms)

2) conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html (Passed: 3/3 in 84.0 ms)

3) conformance/glsl/misc/fragcolor-fragdata-invariant.html (Passed: 1/2 Failed: 1/2 in 98.0 ms)
    failed: [unexpected fragment shader compile status] (expected: true) Declaring both gl_FragColor and gl_FragData invariant should succeed.

4) conformance/glsl/misc/shaders-with-invariance.html (Passed: 19/19 in 116.0 ms)

5) deqp/functional/gles3/shaderbuiltinvar.html (Passed: 27/31 Failed: 4/31 in 944.0 ms)
    failed: builtin_variable.max_vertex_output_vectors_vertex: Invalid builtin constant value
    failed: builtin_variable.max_vertex_output_vectors_fragment: Invalid builtin constant value
    failed: builtin_variable.max_fragment_input_vectors_vertex: Invalid builtin constant value
    failed: builtin_variable.max_fragment_input_vectors_fragment: Invalid builtin constant value

6) conformance2/glsl3/invalid-invariant.html (Passed: 3/3 in 82.0 ms)

7) conformance2/glsl3/valid-invariant.html (Passed: 4/4 in 92.0 ms)

and got the same results without and with the patch. So looks like this change doesn't affect WebGL.
Comment 4 Tapani Pälli 2018-09-12 10:05:49 UTC
Resolved by
--- 8< ---
commit 9b5c0c520f6e41f19b3568a4e0532c836bc522e4
Author: Vadym Shovkoplias <vadim.shovkoplias@gmail.com>
Date:   Fri Sep 7 15:14:52 2018 +0300

    glsl/linker: Check the invariance of built-in special variables
Comment 5 vadym 2018-09-12 16:52:32 UTC
Hi Mark,

Following shader tests are fixed now:

    * glsl-pcoord-invariant.shader_test
    * glsl-fcoord-invariant.shader_test
    * glsl-fface-invariant.shader_test

I think those tests can be moved from [expected-failures] to [fixed-tests] in mesa CI.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.