Bug 75294 - [SNB/IVB/HSW/BYT Bisected]Piglit spec_glsl-1.30_preprocessor_reserved_double-underscore-01.frag fails
Summary: [SNB/IVB/HSW/BYT Bisected]Piglit spec_glsl-1.30_preprocessor_reserved_double-...
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-21 02:39 UTC by lu hua
Modified: 2014-02-24 03:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description lu hua 2014-02-21 02:39:14 UTC
System Environment:
--------------------------
Platform: Haswell
Libdrm:		(master)libdrm-2.4.52-4-gc5de5abbd90333fe1359283fb3a5e457b0f389f3
Mesa:		(master)57405605a8c320f9d6ea389afd43ce6f013330a5
Xserver:	(master)xorg-server-1.15.0-627-gf34dc7fa96457ea6a0703493d74e63cca357712e
Xf86_video_intel:(master)2.99.910-47-gc91af569ee90a832899c9038badd84921e9a87fc
Cairo:		(master)4144307dbfbe7b297135d9ea4b080cae7e06b997
Libva:		(staging)fae9c44816a4c3cfc480d2879d1b4a0c1c3a1527
Libva_intel_driver:(staging)bd630edd844b88ea543a027654db296ff7da16cd
Kernel:	(drm-intel-nightly) 164a4cb4c1431a0689f85507868356fae24da638

Bug detailed description:
-------------------------
It fails on Sandybridge,Ivybridge,Haswell and Baytrail with mesa master branch, works well on 10.1 branch.
Following piglit cases also fail with same bisect commit:
spec_glsl-1.30_preprocessor_reserved_double-underscore-02.frag	
spec_glsl-1.30_preprocessor_reserved_double-underscore-03.frag	

Bisect shows:0bd78926304e72ef3566e977d0cb5a959d86b809 is the first bad commit
commit 0bd78926304e72ef3566e977d0cb5a959d86b809
Author:     Ian Romanick <ian.d.romanick@intel.com>
AuthorDate: Tue Feb 18 09:10:36 2014 -0800
Commit:     Ian Romanick <ian.d.romanick@intel.com>
CommitDate: Wed Feb 19 15:08:50 2014 -0800

    glcpp: Only warn for macro names containing __

    Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the
    GLSL ES spec (all versions) say:

        "All macro names containing two consecutive underscores ( __ ) are
        reserved for future use as predefined macro names. All macro names
        prefixed with "GL_" ("GL" followed by a single underscore) are also
        reserved."

    The intention is that names containing __ are reserved for internal use
    by the implementation, and names prefixed with GL_ are reserved for use
    by Khronos.  Since every extension adds a name prefixed with GL_ (i.e.,
    the name of the extension), that should be an error.  Names simply
    containing __ are dangerous to use, but should be allowed.  In similar
    cases, the C++ preprocessor specification says, "no diagnostic is
    required."

    Per the Khronos bug mentioned below, a future version of the GLSL
    specification will clarify this.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Tested-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    Tested-by: Darius Spitznagel <d.spitznagel@goodbytez.de>
    Cc: Tapani Pälli <lemody@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
    Bugzilla: Khronos #11702


output:
Successfully compiled fragment shader /GFX/Test/Piglit/piglit/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag: 0:13(9): preprocessor warning: Macro names containing "__" are reserved for use by the implementation.


Shader source:
// [config]
// expect_result: fail
// glsl_version: 1.30
// [end config]
//
// Check that macro names beginning with a doule underscore are reserved.
//
// From page 11 (17 of pdf) of the GLSL 1.30 spec:
//     "All macro names containing two consecutive underscores ( __ ) are
//     reserved for future use as predefined macro names."

#version 130
#define __I_AM_RESERVED 1

int f()
{
        return 0;
}

PIGLIT: {'result': 'fail' }


Reproduce steps:
-------------------------
1. xinit
2. ./bin/glslparsertest /GFX/Test/Piglit/piglit/tests/spec/glsl-1.30/preprocessor/reserved/double-underscore-01.frag fail 1.30
Comment 1 Kenneth Graunke 2014-02-21 19:41:29 UTC
Based on recent discussion with Khronos, we concluded that these tests were wrong.  Ian committed Mesa patches to make the compiler accept these shaders, and then also committed Piglit patches to change the expected result:

commit 58390b2b38a575913a46f73c0046419017b1f364
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Feb 18 09:55:00 2014 -0800

    glsl-1.30: Expect __ tests to pass

commit 3a521d467c108f25b2033132ca6ac665786c0e04
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Feb 18 09:53:37 2014 -0800

    glsl-1.10: Expect __ tests to pass

It sounds like you got the Mesa patches but not the Piglit patches.  So, this is expected.  Thanks for catching it though!
Comment 2 Ian Romanick 2014-02-21 22:20:04 UTC
*** Bug 75293 has been marked as a duplicate of this bug. ***
Comment 3 lu hua 2014-02-24 03:34:57 UTC
Fixed on latest Piglit and Mesa master branch.


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.