Bug 108250 - [GLSL] layout-location-struct.shader_test fails to link
Summary: [GLSL] layout-location-struct.shader_test fails to link
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 18.2
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-05 15:06 UTC by vadym
Modified: 2019-04-05 00:09 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.