I have the following GLSL program, which passes all tests by the GLSLang validator:
It segfaults when linking it (when calling `glLinkProgram`)!
AMD Radeon FirePro W9100
amdgpu pro 17.10
Ubuntu 16.04 LTS
All my other shader work just fine, so it shouldn't be a general problem with my setup!
I'd appreciate quick feedback. A segfault in a valid program with a pro driver is not very nice!
Btw, this isn't my first segfault, the last ones were not actual valid programs, but an error would still have been much nicer!
Let me know if this is the wrong forum, it was kind of hard to find an official bug report site!
Thanks for the feedback and apologies for the delay in my response. I'm patching this through to the compiler team. Will get back as soon as I hear back.
I can confirm this is a compiler-side issue. We're working on getting it resolved.
OK, so as it turns out, this is actually a shader issue. Here's the feed-back I got from the team:
in Vert2Geom geom_in;
void emit_vertex2(Vert2Geom geom_in, Canvas canvas, Uniforms uniforms, vec2 position, vec2 uv, int index)
emit_vertex2(geom_in, canvas, uniforms, p0 + thickness_aa0 * n0, vec2(0, -uv0), 1);
emit_vertex2(geom_in, canvas, uniforms, p0 - thickness_aa0 * n0, vec2(0, uv0), 1);
emit_vertex2(geom_in, canvas, uniforms, p1 + thickness_aa1 * n0, vec2(l, -uv1), 2);
emit_vertex2(geom_in, canvas, uniforms, p1 - thickness_aa1 * n0, vec2(l, uv1), 2);
the parameter geom_in has no array size, which is not allowed. According to glsl spec(chapter 4.1.9): The size of any array must be declared before passing it as an argument to a function. Violation of any of these rules result in compile-time errors.
The compiler-side issue I mentioned in my previous response is that we should be returning a compilation error for this case but we don't. We're going to improve this in one of the upcoming driver
Some further feed-back. After giving this a closer look, we ultimately concluded the GLSL spec actually permits this use case. We fixed the bug internally. One of the upcoming driver releases should start handling this shader correctly.