<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - A function local symbols should shadow a global struct symbol."
href="https://bugs.freedesktop.org/show_bug.cgi?id=95184">95184</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>A function local symbols should shadow a global struct symbol.
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>11.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>glsl-compiler
</td>
</tr>
<tr>
<th>Assignee</th>
<td>idr@freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>corentin@wallez.net
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>intel-3d-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>This a shader compilation error that looks like it might be a bug in Mesa while
running top of tree chromium with --enable-unsafe-es3-apis --use-gl=angle on
<a href="https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/scoping.html">https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/scoping.html</a>
You'll find the relevant log below.
Basically a function parameter named S (in int func(int S) below), should
shadow the struct S declaration but the error message seems to indicate that it
didn't and that it tried to parse a constructor.
The same happens with shadowing from a local variable and shadowing from a
local struct declaration.
Note that Mesa (Intel driver) got the translated shader with the mangled names
instead.
Please let me know if you need more information.
--original-shader--
#version 300 es
precision mediump float;
bool isOk (int a, int b) { return (a == b); }
layout(location = 0) out mediump vec4 dEQP_FragColor;
in float v_in0;
uniform int ref_out0;
int out0;
struct S { int x; };
int func (int S) { return S; }
void main()
{
int in0 = int(v_in0 * 1.0025);
out0 = func(in0);
bool RES = isOk(out0, ref_out0);
dEQP_FragColor = vec4(RES, RES, RES, 1.0);
}
--translated-shader--
#version 300 es
bool webgl_26daf0ef1d00ab6d(in mediump int webgl_2420662cd003acfa, in mediump
int webgl_44a9acbe7629930d){
return (webgl_2420662cd003acfa == webgl_44a9acbe7629930d);
}
layout(location = 0) out mediump vec4 webgl_341844a501096ec4;
in mediump float webgl_c64db3cf02d35b2e;
uniform mediump int webgl_20b06c95b742317e;
mediump int webgl_50c85a6bbb49f119;
struct webgl_bc2ee2bf060ca60{
mediump int webgl_4fc82888d13de398;
} ;
mediump int webgl_8e5fc8b7c9b6652c(in mediump int webgl_bc2ee2bf060ca60){
return webgl_bc2ee2bf060ca60;
}
void main(){
mediump int webgl_e4819ca83edf6f18 = int((webgl_c64db3cf02d35b2e * 1.0025001));
(webgl_50c85a6bbb49f119 = webgl_8e5fc8b7c9b6652c(webgl_e4819ca83edf6f18));
bool webgl_64928d1969e45ae2 = webgl_26daf0ef1d00ab6d(webgl_50c85a6bbb49f119,
webgl_20b06c95b742317e);
(webgl_341844a501096ec4 = vec4(webgl_64928d1969e45ae2, webgl_64928d1969e45ae2,
webgl_64928d1969e45ae2, 1.0));
}
--info-log--
0:13(29): error: syntax error, unexpected ';', expecting '('</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>