Bug 102677

Summary: [OpenGL CTS] KHR-GL45.CommonBugs.CommonBug_PerVertexValidation fails
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: glsl-compilerAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: jasuarez
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 102590    

Description Kenneth Graunke 2017-09-12 16:14:07 UTC
This test links together separable programs with incompatible or missing gl_PerVertex block declarations.  It expects a linker error.  We allow the link.
Comment 1 Kenneth Graunke 2017-10-07 07:04:50 UTC
In the failing case, a VS and GS are being linked together into a single program.  The vertex shader contains:

    out gl_PerVertex
    {
        vec4 gl_Position;
    };

while the geometry shader contains:

    in gl_PerVertex
    {
        float gl_ClipDistance[];
    } gl_in[];

which obviously don't match.  Unfortunately, the geometry shader doesn't actually use the gl_ClipDistance input at all, so it gets dead code eliminated at compile time, before we even consider linking.  At link time, validate_interstage_inout_blocks() is supposed to enforce matching types, but there are no longer any GS inputs with an interface type, so it can't check anything.

Not sure what to do about this.
Comment 2 Kenneth Graunke 2017-10-07 13:31:52 UTC
Oh, Eduardo sent patches to fix this back in January:

https://lists.freedesktop.org/archives/mesa-dev/2017-January/142386.html

Khronos made it pretty clear this test is valid:
https://gitlab.khronos.org/Tracker/vk-gl-cts/issues/137
Comment 3 Neil Roberts 2017-10-28 11:15:06 UTC
I’ve posted a v2 of Eduardo’s patches here:

https://lists.freedesktop.org/archives/mesa-dev/2017-October/174550.html
Comment 4 Neil Roberts 2017-10-30 17:30:19 UTC
I’ve pushed the patches to master with Ken’s RB. Thanks!

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.