Bug 108250

Summary: [GLSL] layout-location-struct.shader_test fails to link
Product: Mesa Reporter: vadym <vadym.shovkoplias>
Component: glsl-compilerAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: vadym.shovkoplias
Version: 18.2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description vadym 2018-10-05 15:06:09 UTC
# bin/shader_runner ./tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test 
Failed to link:
error: vertex shader output `s2' declared as type `S2', but fragment shader input declared as type `S'
error: vertex shader output `s' declared as type `S', but fragment shader input declared as type `S1'

Test failure on line 50
Probe color at (0,0)
  Expected: 255 0 0
  Observed: 0 0 0
Test failure on line 51
Failed to link:
error: vertex shader output `s2' declared as type `S2', but fragment shader input declared as type `S'
error: vertex shader output `s' declared as type `S', but fragment shader input declared as type `S1'



Accordingly to OpenGL 4.30 spec this test shouldn't fail to link:

Section 7.4.1 (Shader Interface Matching):

"Variables or block members declared as structures are considered
to match in type if and only if structure members match in name,
type, qualification, and declaration order."
Comment 1 vadym 2018-10-05 15:10:02 UTC
Patch: https://patchwork.freedesktop.org/patch/255084/
Comment 2 Timothy Arceri 2019-04-05 00:09:37 UTC
Should be fixed by:

commit a7d40a13ec39df5c1e18c2afaf70988958c11933
Author: Sergii Romantsov <sergii.romantsov@globallogic.com>
Date:   Thu Jan 24 14:33:55 2019 +0200

    glsl: Fix input/output structure matching across shader stages
    
    Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.30 spec says:
    
        "Variables or block members declared as structures are considered
         to match in type if and only if structure members match in name,
         type, qualification, and declaration order."
    
    Fixes:
         * layout-location-struct.shader_test
    
    v2: rebased against master and small fixes
    
    Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108250

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.