Bug 106807 - Failed to parse macro "#line"
Summary: Failed to parse macro "#line"
Status: RESOLVED WONTFIX
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 17.1
Hardware: ARM Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-04 08:00 UTC by Zhaowei Yuan
Modified: 2018-06-14 08:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhaowei Yuan 2018-06-04 08:00:12 UTC
GLES CTS test case:
dEQP-GLES2.functional.shaders.preprocessor.builtin.line_expression_vertex
checks if GLSL compiler can parse macro "#line" successfully, following is the shader code:
    precision mediump float;
    attribute highp vec4 dEQP_Position;
    varying float out0;

    void main()
    {
        #line +20
        out0 = float(__LINE__);
	gl_Position = dEQP_Position;
		
    }

yyerror() will be called while parsing #line which casue the case fails
Comment 1 Kenneth Graunke 2018-06-04 09:03:32 UTC
I don't have links to details handy, but sometime between September 20-22, 2017 Khronos voted to make #line expression behavior undefined (including failure to parse), with the intention of making it explicitly an error in future GLSL versions.

This test is invalid and should be removed from dEQP.  We will not accept patches to implement this behavior in Mesa.

Historically, some people shipped a hack to make this invalid test pass:
https://github.com/intel/external-mesa/commit/81bb0a1474d98620a69a20396631dc63e324bf34

The right thing to do now is delete the test.
Comment 2 Juan A. Suarez 2018-06-14 08:19:55 UTC
As Kenneth said, Khronos voted to consider #line with an expression as undefined behaviour, and thus these tests were removed

https://github.com/KhronosGroup/VK-GL-CTS/commit/4ff5a922a15bcdb93e59313221033bee1204be2c


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.