https://bugs.freedesktop.org/show_bug.cgi?id=106590
Bug ID: 106590
Summary: Wrong line numbers expanded while compiling shaders
Product: Mesa
Version: 17.1
Hardware: ARM
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: glsl-compiler
Assignee: mesa-dev@lists.freedesktop.org
Reporter: zhaowei.y...@samsung.com
QA Contact: intel-3d-b...@lists.freedesktop.org
Created attachment 139657
--> https://bugs.freedesktop.org/attachment.cgi?id=139657&action=edit
patch that fix GLSL compiling issue
Following shader code is got from a CTS test case which is intend to check if
the shader compiler can expand macro with right line number:
1 #version 300 es
2 precision mediump float;
3 #define BBB __LINE__, /*
4 */ __LINE__
5 #define AAA(a,b) BBB, a, b
6
7 void main()
8 {
9 out0 = vec4(AAA(__LINE__,
10 __LINE__
11 ));
12 }
It expects to make out0 filled with (11, 11, 9, 10) values, But mesa gives
(3,4, 9, 10).
There are 2 problems:
1. Macro BBB should be expanded as the line number exactly where it is
referenced, not declared
2. Macro BBB have a character '\n' within "/**/" which should be ignored and
treat 2 "__LINE__" as the in the same line
I fixed this problem with the attached patch, please review, thanks
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev