Bug 108646 - error: linking with uncompiled/unspecialized shader
Summary: error: linking with uncompiled/unspecialized shader
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 18.2
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-03 21:02 UTC by Robert-André Mauchin
Modified: 2018-11-06 16:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
MPV log of shader compilation failure on Fedora with Mesa 18.2.3 (8.23 KB, text/plain)
2018-11-04 10:09 UTC, Öyvind Saether
Details

Description Robert-André Mauchin 2018-11-03 21:02:19 UTC
Observed with mesa-18.2.3 and mesa-18.2.4. This is a regression as mesa-18.2.2 works fine.

mpv with OpenGl output (-vo=gpu) started showing errors and displaying a blue screen:

Using hardware decoding (vaapi).
VO: [gpu] 1280x720 vaapi[nv12]
[vo/gpu/opengl] fragment shader source:
[vo/gpu/opengl] [  1] #version 440                                                                                                                                                            
[vo/gpu/opengl] [  2] #define tex1D texture                                                                                                                                                   
[vo/gpu/opengl] [  3] #define tex3D texture                                                                                                                                                   
[vo/gpu/opengl] [  4] #define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))                                                                                         
[vo/gpu/opengl] [  5] out vec4 out_color;                                                                                                                                                     
[vo/gpu/opengl] [  6] in vec2 texcoord0;                                                                                                                                                      
[vo/gpu/opengl] [  7] layout(std140, binding=0) uniform UBO {                                                                                                                                 
[vo/gpu/opengl] [  8] layout(offset=0) vec2 texture_size0;                                                                                                                                    
[vo/gpu/opengl] [  9] layout(offset=16) mat2 texture_rot0;                                                                                                                                    
[vo/gpu/opengl] [ 10] layout(offset=48) vec2 texture_off0;                                                                                                                                    
[vo/gpu/opengl] [ 11] layout(offset=56) vec2 pixel_size0;                                                                                                                                     
[vo/gpu/opengl] [ 12] };                                                                                                                                                                      
[vo/gpu/opengl] [ 13] uniform float random;                                                                                                                                                   
[vo/gpu/opengl] [ 14] uniform sampler2D texture0;                                                                                                                                             
[vo/gpu/opengl] [ 15] #define HOOKED_raw texture0                                                                                                                                             
[vo/gpu/opengl] [ 16] #define HOOKED_pos texcoord0                                                                                                                                            
[vo/gpu/opengl] [ 17] #define HOOKED_size texture_size0                                                                                                                                       
[vo/gpu/opengl] [ 18] #define HOOKED_rot texture_rot0                                                                                                                                         
[vo/gpu/opengl] [ 19] #define HOOKED_pt pixel_size0                                                                                                                                           
[vo/gpu/opengl] [ 20] #define HOOKED_map texmap0                                                                                                                                              
[vo/gpu/opengl] [ 21] #define HOOKED_mul 1.000000                                                                                                                                             
[vo/gpu/opengl] [ 22] #define HOOKED_tex(pos) (HOOKED_mul * vec4(texture(HOOKED_raw, pos)).rgba)                                                                                              
[vo/gpu/opengl] [ 23] #define HOOKED_texOff(off) HOOKED_tex(HOOKED_pos + HOOKED_pt * vec2(off))                                                                                               
[vo/gpu/opengl] [ 24] #define LUMA_raw texture0                                                                                                                                               
[vo/gpu/opengl] [ 25] #define LUMA_pos texcoord0                                                                                                                                              
[vo/gpu/opengl] [ 26] #define LUMA_size texture_size0                                                                                                                                         
[vo/gpu/opengl] [ 27] #define LUMA_rot texture_rot0                                                                                                                                           
[vo/gpu/opengl] [ 28] #define LUMA_pt pixel_size0                                                                                                                                             
[vo/gpu/opengl] [ 29] #define LUMA_map texmap0                                                                                                                                                
[vo/gpu/opengl] [ 30] #define LUMA_mul 1.000000                                                                                                                                               
[vo/gpu/opengl] [ 31] #define LUMA_tex(pos) (LUMA_mul * vec4(texture(LUMA_raw, pos)).rgba)                                                                                                    
[vo/gpu/opengl] [ 32] #define LUMA_texOff(off) LUMA_tex(LUMA_pos + LUMA_pt * vec2(off))                                                                                                       
[vo/gpu/opengl] [ 33] float mod289(float x) { return x - floor(x * 1.0/289.0) * 289.0; }                                                                                                      
[vo/gpu/opengl] [ 34] float permute(float x) { return mod289((34.0*x + 1.0) * x); }                                                                                                           
[vo/gpu/opengl] [ 35] float rand(float x) { return fract(x * 1.0/41.0); }                                                                                                                     
[vo/gpu/opengl] [ 36] vec4 average(float range, inout float h) {                                                                                                                              
[vo/gpu/opengl] [ 37] float dist = rand(h) * range; h = permute(h);                                                                                                                           
[vo/gpu/opengl] [ 38] float dir = rand(h) * 6.2831853; h = permute(h);                                                                                                                        
[vo/gpu/opengl] [ 39] vec2 o = dist * vec2(cos(dir), sin(dir));                                                                                                                               
[vo/gpu/opengl] [ 40] vec4 ref[4];                                                                                                                                                            
[vo/gpu/opengl] [ 41] ref[0] = HOOKED_texOff(vec2( o.x, o.y));                                                                                                                                
[vo/gpu/opengl] [ 42] ref[1] = HOOKED_texOff(vec2(-o.y, o.x));                                                                                                                                
[vo/gpu/opengl] [ 43] ref[2] = HOOKED_texOff(vec2(-o.x, -o.y));                                                                                                                               
[vo/gpu/opengl] [ 44] ref[3] = HOOKED_texOff(vec2( o.y, -o.x));                                                                                                                               
[vo/gpu/opengl] [ 45] return (ref[0] + ref[1] + ref[2] + ref[3])*0.25;                                                                                                                        
[vo/gpu/opengl] [ 46] }                                                                                                                                                                       
[vo/gpu/opengl] [ 47] void main() {                                                                                                                                                           
[vo/gpu/opengl] [ 48] vec4 color = vec4(0.0, 0.0, 0.0, 1.0);                                                                                                                                  
[vo/gpu/opengl] [ 49] {                                                                                                                                                                       
[vo/gpu/opengl] [ 50] vec3 _m = vec3(HOOKED_pos, random) + vec3(1.0);                                                                                                                         
[vo/gpu/opengl] [ 51] float h = permute(permute(permute(_m.x)+_m.y)+_m.z);                                                                                                                    
[vo/gpu/opengl] [ 52] color = HOOKED_tex(HOOKED_pos);                                                                                                                                         
[vo/gpu/opengl] [ 53] vec4 avg, diff;                                                                                                                                                         
[vo/gpu/opengl] [ 54] avg = average(16.000000, h);                                                                                                                                            
[vo/gpu/opengl] [ 55] diff = abs(color - avg);                                                                                                                                                
[vo/gpu/opengl] [ 56] color = mix(avg, color, greaterThan(diff, vec4(0.003906)));                                                                                                             
[vo/gpu/opengl] [ 57] vec3 noise;                                                                                                                                                             
[vo/gpu/opengl] [ 58] noise.x = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 59] noise.y = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 60] noise.z = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 61] color.xyz += 0.005859 * (noise - vec3(0.5));                                                                                                                            
[vo/gpu/opengl] [ 62] }                                                                                                                                                                       
[vo/gpu/opengl] [ 63] color.g = 0.000000;                                                                                                                                                     
[vo/gpu/opengl] [ 64] color.b = 0.000000;                                                                                                                                                     
[vo/gpu/opengl] [ 65] color.a = 1.000000;                                                                                                                                                     
[vo/gpu/opengl] [ 66] out_color = color;                                                                                                                                                      
[vo/gpu/opengl] [ 67] }                                                                                                                                                                       
[vo/gpu/opengl] fragment shader compile log (status=0):                                                                                                                                       
[vo/gpu/opengl] 0:36(27): error: invalid input layout qualifier used                                                                                                                          
[vo/gpu/opengl]                                                                                                                                                                               
[vo/gpu/opengl] shader link log (status=0): error: linking with uncompiled/unspecialized shader                                                                                               
[vo/gpu/opengl] fragment shader source:                                                                                                                                                       
[vo/gpu/opengl] [  1] #version 440                                                                                                                                                            
[vo/gpu/opengl] [  2] #define tex1D texture                                                                                                                                                   
[vo/gpu/opengl] [  3] #define tex3D texture                                                                                                                                                   
[vo/gpu/opengl] [  4] #define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))                                                                                         
[vo/gpu/opengl] [  5] out vec4 out_color;                                                                                                                                                     
[vo/gpu/opengl] [  6] in vec2 texcoord0;                                                                                                                                                      
[vo/gpu/opengl] [  7] layout(std140, binding=0) uniform UBO {                                                                                                                                 
[vo/gpu/opengl] [  8] layout(offset=0) vec2 texture_size0;                                                                                                                                    
[vo/gpu/opengl] [  9] layout(offset=16) mat2 texture_rot0;                                                                                                                                    
[vo/gpu/opengl] [ 10] layout(offset=48) vec2 texture_off0;                                                                                                                                    
[vo/gpu/opengl] [ 11] layout(offset=56) vec2 pixel_size0;                                                                                                                                     
[vo/gpu/opengl] [ 12] };                                                                                                                                                                      
[vo/gpu/opengl] [ 13] uniform float random;                                                                                                                                                   
[vo/gpu/opengl] [ 14] uniform sampler2D texture0;                                                                                                                                             
[vo/gpu/opengl] [ 15] #define HOOKED_raw texture0                                                                                                                                             
[vo/gpu/opengl] [ 16] #define HOOKED_pos texcoord0                                                                                                                                            
[vo/gpu/opengl] [ 17] #define HOOKED_size texture_size0                                                                                                                                       
[vo/gpu/opengl] [ 18] #define HOOKED_rot texture_rot0                                                                                                                                         
[vo/gpu/opengl] [ 19] #define HOOKED_pt pixel_size0                                                                                                                                           
[vo/gpu/opengl] [ 20] #define HOOKED_map texmap0                                                                                                                                              
[vo/gpu/opengl] [ 21] #define HOOKED_mul 1.000000                                                                                                                                             
[vo/gpu/opengl] [ 22] #define HOOKED_tex(pos) (HOOKED_mul * vec4(texture(HOOKED_raw, pos)).rgba)                                                                                              
[vo/gpu/opengl] [ 23] #define HOOKED_texOff(off) HOOKED_tex(HOOKED_pos + HOOKED_pt * vec2(off))                                                                                               
[vo/gpu/opengl] [ 24] #define CHROMA_raw texture0                                                                                                                                             
[vo/gpu/opengl] [ 25] #define CHROMA_pos texcoord0                                                                                                                                            
[vo/gpu/opengl] [ 26] #define CHROMA_size texture_size0                                                                                                                                       
[vo/gpu/opengl] [ 27] #define CHROMA_rot texture_rot0                                                                                                                                         
[vo/gpu/opengl] [ 28] #define CHROMA_pt pixel_size0                                                                                                                                           
[vo/gpu/opengl] [ 29] #define CHROMA_map texmap0                                                                                                                                              
[vo/gpu/opengl] [ 30] #define CHROMA_mul 1.000000                                                                                                                                             
[vo/gpu/opengl] [ 31] #define CHROMA_tex(pos) (CHROMA_mul * vec4(texture(CHROMA_raw, pos)).rgba)                                                                                              
[vo/gpu/opengl] [ 32] #define CHROMA_texOff(off) CHROMA_tex(CHROMA_pos + CHROMA_pt * vec2(off))                                                                                               
[vo/gpu/opengl] [ 33] float mod289(float x) { return x - floor(x * 1.0/289.0) * 289.0; }                                                                                                      
[vo/gpu/opengl] [ 34] float permute(float x) { return mod289((34.0*x + 1.0) * x); }                                                                                                           
[vo/gpu/opengl] [ 35] float rand(float x) { return fract(x * 1.0/41.0); }                                                                                                                     
[vo/gpu/opengl] [ 36] vec4 average(float range, inout float h) {                                                                                                                              
[vo/gpu/opengl] [ 37] float dist = rand(h) * range; h = permute(h);                                                                                                                           
[vo/gpu/opengl] [ 38] float dir = rand(h) * 6.2831853; h = permute(h);                                                                                                                        
[vo/gpu/opengl] [ 39] vec2 o = dist * vec2(cos(dir), sin(dir));                                                                                                                               
[vo/gpu/opengl] [ 40] vec4 ref[4];                                                                                                                                                            
[vo/gpu/opengl] [ 41] ref[0] = HOOKED_texOff(vec2( o.x, o.y));                                                                                                                                
[vo/gpu/opengl] [ 42] ref[1] = HOOKED_texOff(vec2(-o.y, o.x));                                                                                                                                
[vo/gpu/opengl] [ 43] ref[2] = HOOKED_texOff(vec2(-o.x, -o.y));                                                                                                                               
[vo/gpu/opengl] [ 44] ref[3] = HOOKED_texOff(vec2( o.y, -o.x));                                                                                                                               
[vo/gpu/opengl] [ 45] return (ref[0] + ref[1] + ref[2] + ref[3])*0.25;                                                                                                                        
[vo/gpu/opengl] [ 46] }                                                                                                                                                                       
[vo/gpu/opengl] [ 47] void main() {                                                                                                                                                           
[vo/gpu/opengl] [ 48] vec4 color = vec4(0.0, 0.0, 0.0, 1.0);                                                                                                                                  
[vo/gpu/opengl] [ 49] {                                                                                                                                                                       
[vo/gpu/opengl] [ 50] vec3 _m = vec3(HOOKED_pos, random) + vec3(1.0);                                                                                                                         
[vo/gpu/opengl] [ 51] float h = permute(permute(permute(_m.x)+_m.y)+_m.z);                                                                                                                    
[vo/gpu/opengl] [ 52] color = HOOKED_tex(HOOKED_pos);                                                                                                                                         
[vo/gpu/opengl] [ 53] vec4 avg, diff;                                                                                                                                                         
[vo/gpu/opengl] [ 54] avg = average(16.000000, h);                                                                                                                                            
[vo/gpu/opengl] [ 55] diff = abs(color - avg);                                                                                                                                                
[vo/gpu/opengl] [ 56] color = mix(avg, color, greaterThan(diff, vec4(0.003906)));                                                                                                             
[vo/gpu/opengl] [ 57] vec3 noise;                                                                                                                                                             
[vo/gpu/opengl] [ 58] noise.x = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 59] noise.y = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 60] noise.z = rand(h); h = permute(h);                                                                                                                                      
[vo/gpu/opengl] [ 61] color.xyz += 0.005859 * (noise - vec3(0.5));                                                                                                                            
[vo/gpu/opengl] [ 62] }                                                                                                                                                                       
[vo/gpu/opengl] [ 63] color.b = 0.000000;                                                                                                                                                     
[vo/gpu/opengl] [ 64] color.a = 1.000000;                                                                                                                                                     
[vo/gpu/opengl] [ 65] out_color = color;                                                                                                                                                      
[vo/gpu/opengl] [ 66] }                                                                                                                                                                       
[vo/gpu/opengl] fragment shader compile log (status=0):                                                                                                                                       
[vo/gpu/opengl] 0:36(27): error: invalid input layout qualifier used                                                                                                                          
[vo/gpu/opengl]                                                                                                                                                                               
[vo/gpu/opengl] shader link log (status=0): error: linking with uncompiled/unspecialized shader
Comment 1 Öyvind Saether 2018-11-04 10:09:31 UTC
Created attachment 142362 [details]
MPV log of shader compilation failure on Fedora with Mesa 18.2.3

I got the same problem on Fedora after upgrading from Mesa 18.2.2 to 18.2.3. As a temporary workaround downgrading fixes it.
Comment 2 madcatx 2018-11-04 10:21:27 UTC
I have recently run into this too and I have spent the better part of Saturday trying to track this down, although unsuccessfully. FTR I noticed this issue as some misrendering and missing transparency in KDE. It also makes Unigine: Superposition benchmark abort. This is on a desktop machine with Radeon RX570.

As there were not that many changes between mesa 18.2.2 and 18.2.3 I tried to bisect the issue to no avail. The weird part is that even when I build mesa-18.2.2 from source I still get the "error: invalid input layout qualifier used" failure message. I even went back to mesa-18.2.1 but I got the same result. The only way how to "fix" this appears to be installation of mesa-18.2.2 from official Fedora packages. Unless I have been doing something terribly wrong I am starting to think that this may not be a mesa issue after all.

I have mesa-18.2.4 installed on my laptop with HD3000 GPU running Arch Linux and it is all fine there.

The shader that KWin fails to compile is as simple as this:
#version 140

uniform mat4 colorMatrix;
uniform sampler2D sampler;
uniform float opacity;
noperspective in vec4 varyingTexCoords;
out vec4 fragColor;

void main(void)
{
    vec4 tex = texture(sampler, varyingTexCoords.st);
    if (opacity >= 1.0) {
        fragColor = tex * colorMatrix;
    } else {
        fragColor = tex * (opacity * colorMatrix + (1.0 - opacity) * mat4(1.0));
    }
}
Comment 3 Robert-André Mauchin 2018-11-04 10:24:40 UTC
I try to bisect the issue unsuccessfully, I'm not even sure the issue is Mesa… If I build locally i965_dri.so 18.2.2-1, it fails too, whereas the Fedora package works. My conclusion is that a dependency used during the build was working when Fedora Mesa 18.2.2-1 was built on Oct 5 but that dependency was updated and i965_dri.so 18.2.2 when built now with that updated dependency fails.
Comment 4 madcatx 2018-11-04 11:44:14 UTC
Because this looks like a Fedora packaging issue I filed a bug at RH bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1645850
Comment 5 Robert-André Mauchin 2018-11-04 12:41:22 UTC
Seems the culprit is gcc: compiled with gcc-8.2.1-2 it works, with gcc-8.2.1-4 it doesn't.
Comment 6 Robert-André Mauchin 2018-11-06 16:03:22 UTC
Fixed in Fedora gcc-8.2.1-5 and mesa-18.2.4-3. (https://bugzilla.redhat.com/show_bug.cgi?id=1645400 )

It was indeed an upstream gcc bug and not a mesa one. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87859


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.