Bug 95184 - A function local symbols should shadow a global struct symbol.
Summary: A function local symbols should shadow a global struct symbol.
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 11.2
Hardware: All Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-28 12:12 UTC by Corentin Wallez
Modified: 2016-07-11 12:49 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Corentin Wallez 2016-04-28 12:12:26 UTC
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 https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/scoping.html
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 '('
Comment 1 Stephane Marchesin 2016-06-16 17:12:05 UTC
Ian, do you know if that's expected?
Comment 2 Ilia Mirkin 2016-07-09 04:22:41 UTC
Can you double-check that this is still a thing with 12.0? I recall this being an issue a while ago, and then I think it may have gotten fixed in response to some CTS tests...
Comment 3 Corentin Wallez 2016-07-11 12:49:18 UTC
Seems it has been fixed, tests pass with 12.0


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.