Bug 108109 - [GLSL] no-overloads.vert fails
Summary: [GLSL] no-overloads.vert fails
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-01 14:01 UTC by vadym
Modified: 2018-10-10 08:03 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description vadym 2018-10-01 14:01:12 UTC
# ./bin/glslparsertest tests/spec/arb_shader_subroutine/linker/no-overloads.vert fail 1.50 --check-link
Successfully compiled and linked vertex shader tests/spec/arb_shader_subroutine/linker/no-overloads.vert: (no compiler output)
Shader source:
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_shader_subroutine
// check_link: true
// [end config]

#version 150
#extension GL_ARB_shader_subroutine: require

subroutine void func_type();

/* A program will fail to link if any shader contains two or more
 * functions with the same name, at least one of which is associated
 * with a subroutine type.
 */

subroutine (func_type) void f() {}
void f(int x) {}

void main() {}

PIGLIT: {"result": "fail" }


Accordingly to GLSL spec 4.0 this test shouldn't fail:

Section 6.1.2 Subroutines:
    
"A program will fail to compile or link if any shader
or stage contains two or more functions with the same
name if the name is associated with a subroutine type."
Comment 1 vadym 2018-10-01 14:04:57 UTC
Patch: https://patchwork.freedesktop.org/patch/254237/
Comment 2 Iago Toral 2018-10-04 15:51:12 UTC
Fixed with:

commit 5f0567a4f60c6671d4e2a942ab3f3248dbbd6997 (HEAD -> master, origin/master, origin/HEAD)
Author: Vadym Shovkoplias <vadim.shovkoplias@gmail.com>
Date:   Wed Oct 3 11:39:04 2018 +0300

    glsl/linker: Check the subroutine associated functions names
    
    >From Section 6.1.2 (Subroutines) of the GLSL 4.00 specification
    
        "A program will fail to compile or link if any shader
         or stage contains two or more functions with the same
         name if the name is associated with a subroutine type."
    
    v2:
      - error out earlier (Tapani)
      - style fixes (Iago)
    
    Fixes:
        * no-overloads.vert
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108109
    Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
    
    Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
    Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Comment 3 vadym 2018-10-10 08:03:00 UTC
Additional check to compiler added: https://patchwork.freedesktop.org/patch/255542/


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.