Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader 'depthtile1' fails to compile. #919

Closed
lisacvuk opened this issue Mar 24, 2016 · 52 comments
Closed

Shader 'depthtile1' fails to compile. #919

lisacvuk opened this issue Mar 24, 2016 · 52 comments

Comments

@lisacvuk
Copy link

cmdline:
[FS] Lib path: /home/lisacvuk/.local/share/unvanquished 
[FS] Home path: /home/lisacvuk/.unvanquished                                                                                              
[FS] Pak search path: /home/lisacvuk/.local/share/unvanquished/pkg                                                                        
[FS] Pak search path: /home/lisacvuk/.unvanquished/pkg                                                                                    
Starting crash logging server                                                                                                             
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.49.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.48.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.47.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.46.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.45.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.44.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.43.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.42.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.41.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.40.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.39.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.38.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.37.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.36.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.35.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.34.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.33.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.32.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.31.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.30.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.29.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.28.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.27.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.26.0.pk3'...                                                
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.25.0.pk3'...                                                
execing 'default.cfg'                                                                                                                     
execing 'autogen.cfg'                                                                                                                     
----- Client Initialization -----                                                                                                         
Loading RSA keys from pubkey                                                                                                              
Daemon RSA public-key found.                                                                                                              
----- Client Initialization Complete -----                                                                                                
Calling GetRefAPI…                                                                                                                        
SDL_Init( SDL_INIT_VIDEO )...                                                                                                             
Using SDL Version 2.0.3                                                                                                                   
SDL using driver "x11"                                                                                                                    
Initializing OpenGL display                                                                                                               
Display aspect: 1.250                                                                                                                     
...setting mode -2:                                                                                                                       
 1280 1024                                                                                                                                
The change will take effect after restart.                                                                                                
Using 24 Color bits, 24 depth, 8 stencil display.                                                                                         
Using GLEW 2.0.0                                                                                                                          
Using enhanced (GL3) Renderer in GL 3.x mode...                                                                                           
Available modes: '1280x1024 800x600 1024x768 '                                                                                            
GL_RENDERER: GeForce 210/PCIe/SSE2                                                                                                        
Detected graphics driver class 'OpenGL 3+'                                                                                                
Detected graphics hardware class 'generic'                                                                                                
Initializing OpenGL extensions                                                                                                            
...ignoring GL_ARB_debug_output                                                                                                           
...found shading language version 150                                                                                                     
...using GL_ARB_half_float_pixel                                                                                                          
...using GL_ARB_texture_float                                                                                                             
...using GL_EXT_texture_integer                                                                                                           
...using GL_ARB_texture_rg                                                                                                                
...using GL_EXT_packed_depth_stencil                                                                                                      
...using GL_EXT_texture_filter_anisotropic                                                                                                
...using GL_ARB_get_program_binary                                                                                                        
...GL_ARB_buffer_storage not found                                                                                                        
...using GL_ARB_uniform_buffer_object                                                                                                     
...using GL_ARB_map_buffer_range                                                                                                          
...using GL_ARB_sync                                                                                                                      
Warn: Source for shader program depthtile1:
#version 150 core                                                                                                                         
#define varying in                                                                                                                        
#define textureCube texture                                                                                                               
#define texture2D texture                                                                                                                 
#define texture2DProj textureProj                                                                                                         
#define texture3D texture                                                                                                                 
#ifndef TEXTURE_RG                                                                                                                        
#define TEXTURE_RG 1                                                                                                                      
#endif                                                                                                                                    
#ifndef UNIFORM_BUFFER_OBJECT                                                                                                             
#define UNIFORM_BUFFER_OBJECT 1                                                                                                           
#endif                                                                                                                                    
#ifndef TEXTURE_INTEGER                                                                                                                   
#define TEXTURE_INTEGER 1                                                                                                                 
#endif                                                                                                                                    
#ifndef r_AmbientScale                                                                                                                    
#define r_AmbientScale 1.000000                                                                                                           
#endif                                                                                                                                    
#ifndef r_SpecularScale                                                                                                                   
#define r_SpecularScale 1.000000                                                                                                          
#endif                                                                                                                                    
#ifndef r_NormalScale                                                                                                                     
#define r_NormalScale 1.000000                                                                                                            
#endif                                                                                                                                    
#ifndef r_zNear                                                                                                                           
#define r_zNear 3.000000                                                                                                                  
#endif                                                                                                                                    
#ifndef M_PI                                                                                                                              
#define M_PI 3.141593                                                                                                                     
#endif                                                                                                                                    
#ifndef MAX_SHADOWMAPS                                                                                                                    
#define MAX_SHADOWMAPS 5                                                                                                                  
#endif                                                                                                                                    
#ifndef MAX_REF_LIGHTS                                                                                                                    
#define MAX_REF_LIGHTS 1024                                                                                                               
#endif                                                                                                                                    
#ifndef TILE_SIZE                                                                                                                         
#define TILE_SIZE 16                                                                                                                      
#endif                                                                                                                                    
#ifndef r_FBufScale                                                                                                                       
#define r_FBufScale vec2(0.000781, 0.000977)                                                                                              
#endif                                                                                                                                    
#ifndef r_tileStep                                                                                                                        
#define r_tileStep vec2(0.012500, 0.015625)                                                                                               
#endif                                                                                                                                    
#ifndef r_precomputedLighting                                                                                                             
#define r_precomputedLighting 1                                                                                                           
#endif                                                                                                                                    
#ifndef r_VertexSkinning                                                                                                                  
#define r_VertexSkinning 1                                                                                                                
#endif                                                                                                                                    
#ifndef MAX_GLSL_BONES                                                                                                                    
#define MAX_GLSL_BONES 233                                                                                                                
#endif                                                                                                                                    
#ifndef r_WrapAroundLighting                                                                                                              
#define r_WrapAroundLighting 0.700000                                                                                                     
#endif                                                                                                                                    
#ifndef r_HalfLambertLighting                                                                                                             
#define r_HalfLambertLighting 1                                                                                                           
#endif                                                                                                                                    
#line 0                                                                                                                                   
/*                                                                                                                                        
===========================================================================                                                               
Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>                                                                 

This file is part of XreaL source code.                                                                                                   

XreaL source code is free software; you can redistribute it                                                                               
and/or modify it under the terms of the GNU General Public License as                                                                     
published by the Free Software Foundation; either version 2 of the License,                                                               
or (at your option) any later version.                                                                                                    

XreaL source code is distributed in the hope that it will be                                                                              
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of                                                                    
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                                                             
GNU General Public License for more details.                                                                                              

You should have received a copy of the GNU General Public License                                                                         
along with XreaL source code; if not, write to the Free Software                                                                          
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA                                                                
===========================================================================                                                               
*/                                                                                                                                        

/* depthtile1_fp.glsl */                                                                                                                  

#extension GL_ARB_texture_gather : enable                                                                                                 

uniform sampler2D u_DepthMap;                                                                                                             
varying vec3 unprojectionParams;                                                                                                          

uniform vec3 u_zFar;                                                                                                                      

const vec2 pixelScale = r_FBufScale;                                                                                                      

#if __VERSION__ > 120                                                                                                                     
out vec4 outputColor;                                                                                                                     
#else                                                                                                                                     
#define outputColor gl_FragColor                                                                                                          
#endif                                                                                                                                    

vec4 depthToZ(in vec4 depth) {                                                                                                            
  return unprojectionParams.x / ( unprojectionParams.y * depth - unprojectionParams.z );                                                  
}                                                                                                                                         

float max16(in vec4 data0, in vec4 data1, in vec4 data2, in vec4 data3) {                                                                 
  vec4 max01 = max(data0, data1);                                                                                                         
  vec4 max23 = max(data2, data3);                                                                                                         
  vec4 max4 = max(max01, max23);                                                                                                          
  vec2 max2 = max(max4.xy, max4.zw);                                                                                                      
  return max(max2.x, max2.y);                                                                                                             
}                                                                                                                                         

void    main()                                                                                                                            
{                                                                                                                                         
  vec2 st = gl_FragCoord.st * 4.0 * pixelScale;                                                                                           
  vec4 depth[4], mask[4];                                                                                                                 

#ifdef GL_ARB_texture_gather                                                                                                              
  depth[0] = textureGather( u_DepthMap, st + vec2(-1.0, -1.0) * pixelScale );                                                             
  depth[1] = textureGather( u_DepthMap, st + vec2(-1.0,  1.0) * pixelScale );                                                             
  depth[2] = textureGather( u_DepthMap, st + vec2( 1.0,  1.0) * pixelScale );                                                             
  depth[3] = textureGather( u_DepthMap, st + vec2( 1.0, -1.0) * pixelScale );                                                             
#else                                                                                                                                     
  depth[0] = vec4(texture2D( u_DepthMap, st + vec2(-1.5, -1.5) * pixelScale ).x,                                                          



  depth[1] = vec4(texture2D( u_DepthMap, st + vec2( 0.5, -1.5) * pixelScale ).x,                                                          



  depth[2] = vec4(texture2D( u_DepthMap, st + vec2( 0.5,  0.5) * pixelScale ).x,                                                          



  depth[3] = vec4(texture2D( u_DepthMap, st + vec2(-1.5,  0.5) * pixelScale ).x,                                                          



#endif                                                                                                                                    
  mask[0] = 1.0 - step(1.0, depth[0]);                                                                                                    
  mask[1] = 1.0 - step(1.0, depth[1]);                                                                                                    
  mask[2] = 1.0 - step(1.0, depth[2]);                                                                                                    
  mask[3] = 1.0 - step(1.0, depth[3]);                                                                                                    

  float samples = dot( mask[0] + mask[1] + mask[2] + mask[3], vec4(1.0) );                                                                
  if ( samples > 0.0 ) {                                                                                                                  
    samples = 1.0 / samples;                                                                                                              

    depth[0] = depthToZ(depth[0]);                                                                                                        
    depth[1] = depthToZ(depth[1]);                                                                                                        
    depth[2] = depthToZ(depth[2]);                                                                                                        
    depth[3] = depthToZ(depth[3]);                                                                                                        

    float minDepth = 99999.0 - max16( mask[0] * (99999.0 - depth[0]),                                                                     




    depth[0] *= mask[0];                                                                                                                  
    depth[1] *= mask[1];                                                                                                                  
    depth[2] *= mask[2];                                                                                                                  
    depth[3] *= mask[3];                                                                                                                  

    float maxDepth = max16( depth[0], depth[1], depth[2], depth[3] );                                                                     

    float avgDepth = dot( depth[0] + depth[1] + depth[2] + depth[3],                                                                      


    depth[0] -= avgDepth * mask[0];                                                                                                       
    depth[1] -= avgDepth * mask[1];                                                                                                       
    depth[2] -= avgDepth * mask[2];
    depth[3] -= avgDepth * mask[3];

    float variance = dot( depth[0], depth[0] ) + dot( depth[1], depth[1] ) +
      dot( depth[2], depth[2] ) + dot( depth[3], depth[3] );
    variance *= samples;
    outputColor = vec4( maxDepth, minDepth, avgDepth, sqrt( variance ) );
  } else {
    // found just sky pixels
    outputColor = vec4( 99999.0, 99999.0, 99999.0, 0.0 );
  }
}

Warn: Compile log:
(0) : error C7011: implicit cast from "int" to "ivec2"

Warn: Built-in shaders failed: Couldn't compile fragment shader: depthtile1 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.25.0.pk3'... 
@DolceTriade
Copy link
Member

Hmm, try running the game with -set r_glProfile compat and see if it works then?

@lisacvuk
Copy link
Author

Nope,

./daemon -set r_glProfile compat
Unvanquished 0.49 Linux x86_64 Mar 13 2016
cmdline: -set r_glProfile compat
[FS] Lib path: /home/lisacvuk/.local/share/unvanquished 
[FS] Home path: /home/lisacvuk/.unvanquished                                                                    
[FS] Pak search path: /home/lisacvuk/.local/share/unvanquished/pkg                                              
[FS] Pak search path: /home/lisacvuk/.unvanquished/pkg                                                          
Starting crash logging server                                                                                   
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.49.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.48.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.47.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.46.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.45.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.44.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.43.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.42.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.41.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.40.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.39.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.38.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.37.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.36.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.35.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.34.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.33.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.32.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.31.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.30.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.29.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.28.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.27.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.26.0.pk3'...                      
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.25.0.pk3'...                      
execing 'default.cfg'                                                                                           
execing 'autogen.cfg'                                                                                           
----- Client Initialization -----                                                                               
Loading RSA keys from pubkey                                                                                    
Daemon RSA public-key found.                                                                                    
----- Client Initialization Complete -----                                                                      
Calling GetRefAPI…                                                                                              
SDL_Init( SDL_INIT_VIDEO )...                                                                                   
Using SDL Version 2.0.3                                                                                         
SDL using driver "x11"                                                                                          
Initializing OpenGL display                                                                                     
Display aspect: 1.250                                                                                           
...setting mode -2:                                                                                             
 1280 1024                                                                                                      
The change will take effect after restart.                                                                      
Using 24 Color bits, 24 depth, 8 stencil display.                                                               
Using GLEW 2.0.0                                                                                                
Using enhanced (GL3) Renderer in GL 3.x mode...                                                                 
Available modes: '1280x1024 800x600 1024x768 '                                                                  
GL_RENDERER: GeForce 210/PCIe/SSE2                                                                              
Detected graphics driver class 'OpenGL 3+'                                                                      
Detected graphics hardware class 'generic'                                                                      
Initializing OpenGL extensions                                                                                  
...ignoring GL_ARB_debug_output                                                                                 
...found shading language version 330                                                                           
...using GL_ARB_half_float_pixel                                                                                
...using GL_ARB_texture_float                                                                                   
...using GL_EXT_texture_integer                                                                                 
...using GL_ARB_texture_rg                                                                                      
...using GL_EXT_packed_depth_stencil                                                                            
...using GL_EXT_texture_filter_anisotropic                                                                      
...using GL_ARB_half_float_vertex                                                                               
...using GL_ARB_framebuffer_object                                                                              
...using GL_ARB_get_program_binary                                                                              
...GL_ARB_buffer_storage not found                                                                              
...using GL_ARB_uniform_buffer_object                                                                           
...using GL_ARB_map_buffer_range                                                                                
...using GL_ARB_sync                                                                                            
Warn: Source for shader program depthtile1:
#version 330 compatibility                                                                                      
#define varying in                                                                                              
#define textureCube texture                                                                                     
#define texture2D texture                                                                                       
#define texture2DProj textureProj                                                                               
#define texture3D texture                                                                                       
#ifndef TEXTURE_RG                                                                                              
#define TEXTURE_RG 1                                                                                            
#endif                                                                                                          
#ifndef UNIFORM_BUFFER_OBJECT                                                                                   
#define UNIFORM_BUFFER_OBJECT 1                                                                                 
#endif                                                                                                          
#ifndef TEXTURE_INTEGER                                                                                         
#define TEXTURE_INTEGER 1                                                                                       
#endif                                                                                                          
#ifndef r_AmbientScale                                                                                          
#define r_AmbientScale 1.000000                                                                                 
#endif                                                                                                          
#ifndef r_SpecularScale                                                                                         
#define r_SpecularScale 1.000000                                                                                
#endif                                                                                                          
#ifndef r_NormalScale                                                                                           
#define r_NormalScale 1.000000                                                                                  
#endif                                                                                                          
#ifndef r_zNear                                                                                                 
#define r_zNear 3.000000                                                                                        
#endif                                                                                                          
#ifndef M_PI                                                                                                    
#define M_PI 3.141593                                                                                           
#endif                                                                                                          
#ifndef MAX_SHADOWMAPS                                                                                          
#define MAX_SHADOWMAPS 5                                                                                        
#endif                                                                                                          
#ifndef MAX_REF_LIGHTS                                                                                          
#define MAX_REF_LIGHTS 1024                                                                                     
#endif                                                                                                          
#ifndef TILE_SIZE                                                                                               
#define TILE_SIZE 16                                                                                            
#endif                                                                                                          
#ifndef r_FBufScale                                                                                             
#define r_FBufScale vec2(0.000781, 0.000977)                                                                    
#endif                                                                                                          
#ifndef r_tileStep                                                                                              
#define r_tileStep vec2(0.012500, 0.015625)                                                                     
#endif                                                                                                          
#ifndef r_precomputedLighting                                                                                   
#define r_precomputedLighting 1                                                                                 
#endif                                                                                                          
#ifndef r_VertexSkinning                                                                                        
#define r_VertexSkinning 1                                                                                      
#endif                                                                                                          
#ifndef MAX_GLSL_BONES                                                                                          
#define MAX_GLSL_BONES 233                                                                                      
#endif                                                                                                          
#ifndef r_WrapAroundLighting                                                                                    
#define r_WrapAroundLighting 0.700000                                                                           
#endif                                                                                                          
#ifndef r_HalfLambertLighting                                                                                   
#define r_HalfLambertLighting 1                                                                                 
#endif                                                                                                          
#line 0                                                                                                         
/*                                                                                                              
===========================================================================                                     
Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>                                       

This file is part of XreaL source code.                                                                         

XreaL source code is free software; you can redistribute it                                                     
and/or modify it under the terms of the GNU General Public License as                                           
published by the Free Software Foundation; either version 2 of the License,                                     
or (at your option) any later version.                                                                          

XreaL source code is distributed in the hope that it will be                                                    
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of                                          
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                                   
GNU General Public License for more details.                                                                    

You should have received a copy of the GNU General Public License                                               
along with XreaL source code; if not, write to the Free Software                                                
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA                                      
===========================================================================                                     
*/                                                                                                              

/* depthtile1_fp.glsl */                                                                                        

#extension GL_ARB_texture_gather : enable                                                                       

uniform sampler2D u_DepthMap;                                                                                   
varying vec3 unprojectionParams;                                                                                

uniform vec3 u_zFar;                                                                                            

const vec2 pixelScale = r_FBufScale;                                                                            

#if __VERSION__ > 120                                                                                           
out vec4 outputColor;                                                                                           
#else                                                                                                           
#define outputColor gl_FragColor                                                                                
#endif                                                                                                          

vec4 depthToZ(in vec4 depth) {                                                                                  
  return unprojectionParams.x / ( unprojectionParams.y * depth - unprojectionParams.z );                        
}                                                                                                               

float max16(in vec4 data0, in vec4 data1, in vec4 data2, in vec4 data3) {                                       
  vec4 max01 = max(data0, data1);                                                                               
  vec4 max23 = max(data2, data3);                                                                               
  vec4 max4 = max(max01, max23);                                                                                
  vec2 max2 = max(max4.xy, max4.zw);                                                                            
  return max(max2.x, max2.y);                                                                                   
}                                                                                                               

void    main()                                                                                                  
{                                                                                                               
  vec2 st = gl_FragCoord.st * 4.0 * pixelScale;                                                                 
  vec4 depth[4], mask[4];                                                                                       

#ifdef GL_ARB_texture_gather                                                                                    
  depth[0] = textureGather( u_DepthMap, st + vec2(-1.0, -1.0) * pixelScale );                                   
  depth[1] = textureGather( u_DepthMap, st + vec2(-1.0,  1.0) * pixelScale );                                   
  depth[2] = textureGather( u_DepthMap, st + vec2( 1.0,  1.0) * pixelScale );                                   
  depth[3] = textureGather( u_DepthMap, st + vec2( 1.0, -1.0) * pixelScale );                                   
#else                                                                                                           
  depth[0] = vec4(texture2D( u_DepthMap, st + vec2(-1.5, -1.5) * pixelScale ).x,                                



  depth[1] = vec4(texture2D( u_DepthMap, st + vec2( 0.5, -1.5) * pixelScale ).x,                                



  depth[2] = vec4(texture2D( u_DepthMap, st + vec2( 0.5,  0.5) * pixelScale ).x,                                



  depth[3] = vec4(texture2D( u_DepthMap, st + vec2(-1.5,  0.5) * pixelScale ).x,                                



#endif                                                                                                          
  mask[0] = 1.0 - step(1.0, depth[0]);                                                                          
  mask[1] = 1.0 - step(1.0, depth[1]);                                                                          
  mask[2] = 1.0 - step(1.0, depth[2]);                                                                          
  mask[3] = 1.0 - step(1.0, depth[3]);                                                                          

  float samples = dot( mask[0] + mask[1] + mask[2] + mask[3], vec4(1.0) );                                      
  if ( samples > 0.0 ) {                                                                                        
    samples = 1.0 / samples;                                                                                    

    depth[0] = depthToZ(depth[0]);                                                                              
    depth[1] = depthToZ(depth[1]);                                                                              
    depth[2] = depthToZ(depth[2]);                                                                              
    depth[3] = depthToZ(depth[3]);                                                                              

    float minDepth = 99999.0 - max16( mask[0] * (99999.0 - depth[0]),                                           




    depth[0] *= mask[0];                                                                                        
    depth[1] *= mask[1];                                                                                        
    depth[2] *= mask[2];                                                                                        
    depth[3] *= mask[3];                                                                                        

    float maxDepth = max16( depth[0], depth[1], depth[2], depth[3] );                                           

    float avgDepth = dot( depth[0] + depth[1] + depth[2] + depth[3],                                            


    depth[0] -= avgDepth * mask[0];                                                                             
    depth[1] -= avgDepth * mask[1];                                                                             
    depth[2] -= avgDepth * mask[2];                                                                             
    depth[3] -= avgDepth * mask[3];                                                                             

    float variance = dot( depth[0], depth[0] ) + dot( depth[1], depth[1] ) +                                    
      dot( depth[2], depth[2] ) + dot( depth[3], depth[3] );                                                    
    variance *= samples;                                                                                        
    outputColor = vec4( maxDepth, minDepth, avgDepth, sqrt( variance ) );                                       
  } else {                                                                                                      
    // found just sky pixels                                                                                    
    outputColor = vec4( 99999.0, 99999.0, 99999.0, 0.0 );                                                       
  }                                                                                                             
}

Warn: Compile log:
(0) : error C7011: implicit cast from "int" to "ivec2"

Warn: Built-in shaders failed: Couldn't compile fragment shader: depthtile1 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/home/lisacvuk/.local/share/unvanquished/pkg/unvanquished_0.25.0.pk3'... 

@DolceTriade
Copy link
Member

Hmm, something is really weird: When you use the core profile, you use GLSL version 150, but when you use compatibility profile, you use GLSL version 330...

@gimhael
Copy link
Member

gimhael commented Mar 27, 2016

The shaders you pasted lack some lines after the definition of minDepth and avgDepth, but possibly that was caused by copy-and-pasting the shader to the issue tracker. If I add those missing lines from the unv source code, both the core and compat shaders successfully pass the khronos GLSL validator.

@lisacvuk
Copy link
Author

Well, should I redownload the game?

@lisacvuk
Copy link
Author

Redownloaded, still the same.

@ermo
Copy link

ermo commented Apr 1, 2016

I'm seeing the same thing using a GeForce GT 240 on F23 WS using the NVidia 340xx drivers:

[ermo@murray build]$ ./daemon
Unvanquished 0.49 Linux x86_64 Apr  1 2016
cmdline:
[FS] Lib path: /home/ermo/work/Unvanquished/build 
[FS] Home path: /home/ermo/.unvanquished 
[FS] Pak search path: /home/ermo/work/Unvanquished/build/pkg 
[FS] Pak search path: /home/ermo/.unvanquished/pkg 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.25.0.pk3'... 
execing 'default.cfg' 
execing 'autogen.cfg' 
execing 'keybindings.cfg' 
----- Client Initialization ----- 
Loading RSA keys from pubkey 
Daemon RSA public-key found. 
----- Client Initialization Complete ----- 
Calling GetRefAPI… 
SDL_Init( SDL_INIT_VIDEO )...  
Using SDL Version 2.0.3 
SDL using driver "x11" 
Initializing OpenGL display 
Display aspect: 1.778 
...setting mode -1: 
 1920 1080 
Warn: GLEW version < 2.0.0 doesn't support GL core profiles 
Using 24 Color bits, 24 depth, 8 stencil display. 
Using GLEW 1.10.0 
Using enhanced (GL3) Renderer in GL 3.x mode... 
Available modes: '1920x1080 1280x800 1440x900 1680x1050 640x480 ' 
GL_RENDERER: GeForce GT 240/PCIe/SSE2 
Detected graphics driver class 'OpenGL 3+' 
Detected graphics hardware class 'generic' 
Initializing OpenGL extensions 
...ignoring GL_ARB_debug_output 
...found shading language version 330 
...using GL_ARB_half_float_pixel 
...using GL_ARB_texture_float 
...using GL_EXT_texture_integer 
...using GL_ARB_texture_rg 
...using GL_EXT_packed_depth_stencil 
...using GL_EXT_texture_filter_anisotropic 
...using GL_ARB_half_float_vertex 
...using GL_ARB_framebuffer_object 
...using GL_ARB_get_program_binary 
...GL_ARB_buffer_storage not found 
...using GL_ARB_uniform_buffer_object 
...using GL_ARB_map_buffer_range 
...using GL_ARB_sync 
Warn: Source for shader program depthtile1:
#version 330 compatibility
#define varying in
#define textureCube texture
#define texture2D texture
#define texture2DProj textureProj
#define texture3D texture
#ifndef TEXTURE_RG
#define TEXTURE_RG 1
#endif
#ifndef UNIFORM_BUFFER_OBJECT
#define UNIFORM_BUFFER_OBJECT 1
#endif
#ifndef TEXTURE_INTEGER
#define TEXTURE_INTEGER 1
#endif
#ifndef r_AmbientScale
#define r_AmbientScale 1.000000
#endif
#ifndef r_SpecularScale
#define r_SpecularScale 1.000000
#endif
#ifndef r_NormalScale
#define r_NormalScale 1.000000
#endif
#ifndef r_zNear
#define r_zNear 3.000000
#endif
#ifndef M_PI
#define M_PI 3.141593
#endif
#ifndef MAX_SHADOWMAPS
#define MAX_SHADOWMAPS 5
#endif
#ifndef MAX_REF_LIGHTS
#define MAX_REF_LIGHTS 1024
#endif
#ifndef TILE_SIZE
#define TILE_SIZE 16
#endif
#ifndef r_FBufScale
#define r_FBufScale vec2(0.000521, 0.000926)
#endif
#ifndef r_tileStep
#define r_tileStep vec2(0.008333, 0.014815)
#endif
#ifndef EVSM
#define EVSM 1
#endif
#ifndef r_EVSMExponents
#define r_EVSMExponents vec2(42.000000, 42.000000)
#endif
#ifndef VSM_EPSILON
#define VSM_EPSILON 0.000100
#endif
#ifndef r_OverDarkeningFactor
#define r_OverDarkeningFactor 30.000000
#endif
#ifndef r_ShadowMapDepthScale
#define r_ShadowMapDepthScale 1.410000
#endif
#ifndef r_ParallelShadowSplits_2
#define r_ParallelShadowSplits_2
#endif
#ifndef r_precomputedLighting
#define r_precomputedLighting 1
#endif
#ifndef r_VertexSkinning
#define r_VertexSkinning 1
#endif
#ifndef MAX_GLSL_BONES
#define MAX_GLSL_BONES 233
#endif
#ifndef r_WrapAroundLighting
#define r_WrapAroundLighting 0.700000
#endif
#ifndef r_HalfLambertLighting
#define r_HalfLambertLighting 1
#endif
#ifndef r_RimLighting
#define r_RimLighting 1
#endif
#ifndef r_RimExponent
#define r_RimExponent 3.000000
#endif
#line 0
/*
===========================================================================
Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>

This file is part of XreaL source code.

XreaL source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

XreaL source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with XreaL source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
===========================================================================
*/

/* depthtile1_fp.glsl */

#extension GL_ARB_texture_gather : enable

uniform sampler2D u_DepthMap;
varying vec3 unprojectionParams;

uniform vec3 u_zFar;

const vec2 pixelScale = r_FBufScale;

#if __VERSION__ > 120
out vec4 outputColor;
#else
#define outputColor gl_FragColor
#endif

vec4 depthToZ(in vec4 depth) {
  return unprojectionParams.x / ( unprojectionParams.y * depth - unprojectionParams.z );
}

float max16(in vec4 data0, in vec4 data1, in vec4 data2, in vec4 data3) {
  vec4 max01 = max(data0, data1);
  vec4 max23 = max(data2, data3);
  vec4 max4 = max(max01, max23);
  vec2 max2 = max(max4.xy, max4.zw);
  return max(max2.x, max2.y);
}

void    main()
{
  vec2 st = gl_FragCoord.st * 4.0 * pixelScale;
  vec4 depth[4], mask[4];

#ifdef GL_ARB_texture_gather
  depth[0] = textureGather( u_DepthMap, st + vec2(-1.0, -1.0) * pixelScale );
  depth[1] = textureGather( u_DepthMap, st + vec2(-1.0,  1.0) * pixelScale );
  depth[2] = textureGather( u_DepthMap, st + vec2( 1.0,  1.0) * pixelScale );
  depth[3] = textureGather( u_DepthMap, st + vec2( 1.0, -1.0) * pixelScale );
#else
  depth[0] = vec4(texture2D( u_DepthMap, st + vec2(-1.5, -1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-1.5, -0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-0.5, -0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-0.5, -1.5) * pixelScale ).x);
  depth[1] = vec4(texture2D( u_DepthMap, st + vec2( 0.5, -1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 0.5, -0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 1.5, -0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 1.5, -1.5) * pixelScale ).x);
  depth[2] = vec4(texture2D( u_DepthMap, st + vec2( 0.5,  0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 0.5,  1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 1.5,  1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2( 1.5,  0.5) * pixelScale ).x);
  depth[3] = vec4(texture2D( u_DepthMap, st + vec2(-1.5,  0.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-1.5,  1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-0.5,  1.5) * pixelScale ).x,
          texture2D( u_DepthMap, st + vec2(-0.5,  0.5) * pixelScale ).x);
#endif
  mask[0] = 1.0 - step(1.0, depth[0]);
  mask[1] = 1.0 - step(1.0, depth[1]);
  mask[2] = 1.0 - step(1.0, depth[2]);
  mask[3] = 1.0 - step(1.0, depth[3]);

  float samples = dot( mask[0] + mask[1] + mask[2] + mask[3], vec4(1.0) );
  if ( samples > 0.0 ) {
    samples = 1.0 / samples;

    depth[0] = depthToZ(depth[0]);
    depth[1] = depthToZ(depth[1]);
    depth[2] = depthToZ(depth[2]);
    depth[3] = depthToZ(depth[3]);

    float minDepth = 99999.0 - max16( mask[0] * (99999.0 - depth[0]),
                      mask[1] * (99999.0 - depth[1]),
                      mask[2] * (99999.0 - depth[2]),
                      mask[3] * (99999.0 - depth[3]) );

    depth[0] *= mask[0];
    depth[1] *= mask[1];
    depth[2] *= mask[2];
    depth[3] *= mask[3];

    float maxDepth = max16( depth[0], depth[1], depth[2], depth[3] );

    float avgDepth = dot( depth[0] + depth[1] + depth[2] + depth[3],
              vec4( samples ) );

    depth[0] -= avgDepth * mask[0];
    depth[1] -= avgDepth * mask[1];
    depth[2] -= avgDepth * mask[2];
    depth[3] -= avgDepth * mask[3];

    float variance = dot( depth[0], depth[0] ) + dot( depth[1], depth[1] ) +
      dot( depth[2], depth[2] ) + dot( depth[3], depth[3] );
    variance *= samples;
    outputColor = vec4( maxDepth, minDepth, avgDepth, sqrt( variance ) );
  } else {
    // found just sky pixels
    outputColor = vec4( 99999.0, 99999.0, 99999.0, 0.0 );
  }
}

Warn: Compile log:
(0) : error C7011: implicit cast from "int" to "ivec2"

Warn: Built-in shaders failed: Couldn't compile fragment shader: depthtile1 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/home/ermo/.unvanquished/pkg/unvanquished_0.25.0.pk3'... 
[ermo@murray build]$ git branch
* master
[ermo@murray build]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ../maps.7z
    ../unvanquished.pk3.tar.gz

nothing added to commit but untracked files present (use "git add" to track)
[ermo@murray build]$ date
Fri  1 Apr 10:32:22 CEST 2016
[ermo@murray build]$

@lisacvuk
Copy link
Author

lisacvuk commented Apr 1, 2016

GeForce 210 1GB here. Pentium D 820, 3Gbytes of RAM. Maybe related to the nvidia driver?

@cmf028
Copy link
Member

cmf028 commented Apr 1, 2016

I'm going to assume that is the case because the error:
(0) : error C7011: implicit cast from "int" to "ivec2"
is completely nonsensical.
There isn't a single reference to ivec2 or use of an int value in that entire shader, and the line number is mysteriously "0" which is obviously wrong.

Hmm, something is really weird: When you use the core profile, you use GLSL version 150, but when you use compatibility profile, you use GLSL version 330

This is perfectly fine. Before OpenGL 3.3, GLSL versions followed their own scheme independent of OpenGL's version number (despite being released alongside a given OpenGL version). There is a nice page on Wikipedia that documents this.

OpenGL "core" and "compatibility" profiles were introduced with OpenGL 3.2 (GLSL version 150), and OpenGL 3.3 changes the GLSL shader version to "330" to match the GL version.

@ermo
Copy link

ermo commented Apr 2, 2016

How do I turn on more debugging output from (what I presume to be) NVidia's shader program compiler such that we might be able to pinpoint the issue and, possibly, open a bug report with NVidia with a solid repro?

Either way, it might be worth capturing this specific info here for future reference?

@cmf028
Copy link
Member

cmf028 commented Apr 2, 2016

You are unlikely to get any more debugging output than what was displayed in the console here.
The output in the above console log is a combination of:

  1. the source text given directly to the OpenGL driver (this is perfect as a solid repro, just add the driver version and other system info and copy/paste the shader code)
  2. the FULL error log given by the OpenGL driver (I would also include this in whatever NVidia bug report is opened)

You could try running with -set r_glDebugProfile 1 -set r_glDebugType 7 this would cause us to create a debug GL context and enable GL_ARB_debug_output, but I really doubt that you would get any new info.

@cmf028
Copy link
Member

cmf028 commented Jun 29, 2016

Another user (LDAsh[|]-) on IRC reported the same issue with the attached log.
This issue is also happening on Windows.
daemon.txt

@Viech Viech changed the title [Bug] Shader depthtile1 does not wish to compile. Shader 'depthtile1' fails to compile. Jul 11, 2016
@Incognito4nonymous
Copy link

I got the same issue, as well on Linux than on Windows, with or without Nvidia Drivers, it was fixed since ?

@Incognito4nonymous
Copy link

Like.... Someone ? I'm still facing that issue !

@Incognito4nonymous
Copy link

Up, someone has a workaround for this ? It is very frustrating. 😞

@DolceTriade
Copy link
Member

gimhael overhauled a lot of the shaders. Mind taking a stab to see if the issue is fixed for you?

@lisacvuk
Copy link
Author

@DolceTriade Unfortunately, I gave my Nvidia PC on which this bug appears to my brother. I'll ask him to try if it works for him, but I doubt he'll actually try.

@Viech
Copy link
Member

Viech commented Jan 26, 2017

Maybe @Incognito4nonymous can test, if it was really the very same error.

@Incognito4nonymous
Copy link

I'll try as soon as I can. Sorry for the answer time I've been extremely busy lately.

@Incognito4nonymous
Copy link

Huhhh, mmkay, I can try this, but the download being pretty heavy for my bandwidth I have to get a 75% guarantee it works beforehand.

@ZappaScript
Copy link

As of today (just downloaded the 0.50.0 torrent) it isn't working, Nvidia's compiler throws the same error. This happened with Ubuntu 16.10, a 310m and Nvidia's 340 drivers.

@DolceTriade
Copy link
Member

Thanks for letting us know. We'll continue to try to get the latest version of Unv out with the fix.

@Incognito4nonymous
Copy link

The issue seems to concern Optimus GPUs only, I have tried with my other computer and a brand new Nvidia GT 210 and it works fine.

@DolceTriade DolceTriade added this to the Critical milestone May 30, 2017
@Incognito4nonymous
Copy link

Incognito4nonymous commented Jun 1, 2017

One issue seems to be connected to this one,

[FS] Pak search path: /usr/share/games/unvanquished/pkg 
[FS] Pak search path: /home/incognito/.unvanquished/pkg 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.50.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.25.0.pk3'... 
execing 'default.cfg' 
Warn: Couldn't read conhistory: No such file or directory 
----- Client Initialization ----- 
Loading RSA keys from pubkey 
Daemon RSA public-key found. 
----- Client Initialization Complete ----- 
Calling GetRefAPI… 
SDL_Init( SDL_INIT_VIDEO )...  
Using SDL Version 2.0.5 
]ATTENTION: default value of option force_s3tc_enable overridden by environment.
SDL using driver "x11" 
Initializing OpenGL display 
Display aspect: 1.779 
...setting mode -2: 
 1366 768 
The change will take effect after restart. 
The change will take effect after restart. 
Warn: GLEW version < 2.0.0 doesn't support GL core profiles 
Using 24 Color bits, 24 depth, 8 stencil display. 
Using GLEW 1.13.0 
Using enhanced (GL3) Renderer in GL 2.x mode... 
Available modes: '640x360 720x405 864x486 960x540 1024x576 1280x720 1366x768 680x384 640x480 800x600 1024x768 ' 
GL_RENDERER: Mesa DRI Intel(R) Ironlake Mobile  
Detected graphics driver class 'Mesa' 
Detected graphics hardware class 'generic' 
Initializing OpenGL extensions 
...ignoring GL_ARB_debug_output 
...found shading language version 120 
...using GL_ARB_half_float_pixel 
...using GL_ARB_texture_float 
...using GL_EXT_texture_integer 
...using GL_ARB_texture_rg 
...using GL_EXT_texture_filter_anisotropic 
...using GL_ARB_half_float_vertex 
...using GL_ARB_framebuffer_object 
...GL_ARB_get_program_binary found, but with no binary formats 
...using GL_ARB_buffer_storage 
...GL_ARB_uniform_buffer_object not found 
...using GL_ARB_map_buffer_range 
...using GL_ARB_sync 
Warn: Source for shader program deformVertexes:
#version 120 
#extension GL_EXT_texture_integer : require
#define HAVE_EXT_texture_integer 1
#define DEFORM_STEPS 
#line 0
/*
===========================================================================
Copyright (C) 2009-2011 Robert Beckebans <trebor_7@users.sourceforge.net>

This file is part of XreaL source code.

XreaL source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

XreaL source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with XreaL source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
===========================================================================
*/
// deformVertexes_vp.glsl - Quake 3 deformVertexes semantic


float waveSin(float x) {
	return sin( radians( 360.0 * x ) );
}

float waveSquare(float x) {
	return sign( waveSin( x ) );
}

float waveTriangle(float x)
{
	return 1.0 - abs( 4.0 * fract( x + 0.25 ) - 2.0 );
}

float waveSawtooth(float x)
{
	return fract( x );
}

#if 0
// --------------------------------------------------------------------
ivec4 permute(ivec4 x) {
	return ((62 * x + 1905) * x) % 961;
}

float grad(int idx, vec4 p) {
	int i = idx & 31;
	float u = i < 24 ? p.x : p.y;
	float v = i < 16 ? p.y : p.z;
	float w = i < 8  ? p.z : p.w;

	return ((i & 4) != 0 ? -u : u)
	     + ((i & 2) != 0 ? -v : v)
	     + ((i & 1) != 0 ? -w : w);
}

vec4 fade(in vec4 t) {
	return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
}

vec4 pnoise(vec4 v) {
	ivec4 iv = ivec4(floor(v));
	vec4 rv = fract(v);
	vec4 f[2];

	f[0] = fade(rv);
	f[1] = 1.0 - f[0];

	vec4 value = vec4(0.0);
	for(int idx = 0; idx < 16; idx++) {
		ivec4 offs = ivec4( idx & 1, (idx & 2) >> 1, (idx & 4) >> 2, (idx & 8) >> 3 );
		float w = f[offs.x].x * f[offs.y].y * f[offs.z].z * f[offs.w].w;
		ivec4 p = permute(iv + offs);

		value.x += w * grad(p.x, rv);
		value.y += w * grad(p.y, rv);
		value.z += w * grad(p.z, rv);
		value.w += w * grad(p.w, rv);
	}
	return value;
}
// --------------------------------------------------------------------
#endif

void DeformVertex( inout vec4 pos,
		   inout vec3 normal,
		   inout vec2 st,
		   inout vec4 color,
		   in    float time)
{
	vec4 work = vec4(0.0);

// spread provides some variation on location
#define spread (dot(work.xyz, vec3(1.0)))

#define DSTEP_LOAD_POS(X,Y,Z)     work.xyz = pos.xyz * vec3(X,Y,Z);
#define DSTEP_LOAD_NORM(X,Y,Z)    work.xyz = normal.xyz * vec3(X,Y,Z);
#define DSTEP_LOAD_COLOR(X,Y,Z)   work.xyz = color.xyz * vec3(X,Y,Z);
#define DSTEP_LOAD_TC(X,Y,Z)      work.xyz = vec3(st, 1.0) * vec3(X,Y,Z);
#define DSTEP_LOAD_VEC(X,Y,Z)     work.xyz = vec3(X,Y,Z);
#define DSTEP_MODIFY_POS(X,Y,Z)   pos.xyz += (X + Y * work.a) * work.xyz;
#define DSTEP_MODIFY_NORM(X,Y,Z)  normal.xyz += (X + Y * work.a) * work.xyz; \
				  normal = normalize(normal);
#define DSTEP_MODIFY_COLOR(X,Y,Z) color.xyz += (X + Y * work.a) * work.xyz;
#define DSTEP_SIN(X,Y,Z)          work.a = waveSin( X + Y * spread + Z * time );
#define DSTEP_SQUARE(X,Y,Z)       work.a = waveSquare( X + Y * spread + Z * time);
#define DSTEP_TRIANGLE(X,Y,Z)     work.a = waveTriangle( X + Y * spread + Z * time);
#define	DSTEP_SAWTOOTH(X,Y,Z)     work.a = waveSawtooth( X + Y * spread + Z * time);
#define DSTEP_INV_SAWTOOTH(X,Y,Z) work.a = 1.0 - waveSawtooth( X + Y * spread + Z * time);
#define DSTEP_NOISE(X,Y,Z)        work = noise4(vec4( Y * work.xyz, Z * time));
#define DSTEP_ROTGROW(X,Y,Z)      if(work.z > X * time) { work.a = 0.0; } else { work.a = Y * atan(pos.y, pos.x) + Z * time; work.a = 0.5 * sin(work.a) + 0.5; }

	// this macro has to be #defined by the shader compiler
	DEFORM_STEPS
}
 
Warn: Compile log:
0:2(12): error: extension `GL_EXT_texture_integer' unsupported in vertex shader
 
Warn: Built-in shaders failed: Couldn't compile vertex shader: deformVertexes  ```

This happens while attempting to load the game with an Intel Core I5 on an Optimus computer.

@DolceTriade
Copy link
Member

This bug seems unrelated to this error.

Furthermore, this bug is caused when you're using Mesa, not nvidia:

Available modes: '640x360 720x405 864x486 960x540 1024x576 1280x720 1366x768 680x384 640x480 800x600 1024x768 ' 
GL_RENDERER: Mesa DRI Intel(R) Ironlake Mobile  
Detected graphics driver class 'Mesa' 
Detected graphics hardware class 'generic' ```

@Incognito4nonymous
Copy link

Yo yo yo ! So, anything new around here out of curiosity ? Mi GPU es su GPU if it is needed for testing.

@DolceTriade
Copy link
Member

Thanks, we'll try to generate a small build to facilitate testing. Currently, we're trying to narrow down the scope of why this bug appears. From our side, it seems that everything is correct and the thing that the error complains about

Warn: Compile log:
(0) : error C7011: implicit cast from "int" to "ivec2"

Doesn't even appear in our shaders, which makes it tough to figure out why stuff is failing.

@Incognito4nonymous
Copy link

Incognito4nonymous commented Jul 10, 2017

Okay, I'll wait for the build with great anticipation for further testing then. 😉
Oh and

Warn: GLEW version < 2.0.0 doesn't support GL core profiles 
Using 24 Color bits, 24 depth, 8 stencil display. 
Using GLEW 1.13.0 
Using enhanced (GL3) Renderer in GL 3.x mode... 
Available modes: '640x360 720x405 864x486 960x540 1024x576 1280x720 1366x768 680x384 640x480 800x600 1024x768 ' 
GL_RENDERER: GeForce GT 335M/PCIe/SSE2 
Detected graphics driver class 'OpenGL 3+' 
Detected graphics hardware class 'generic' 
Initializing OpenGL extensions 
...ignoring GL_ARB_debug_output 
...found shading language version 330 
...using GL_ARB_half_float_pixel 
...using GL_ARB_texture_float 
...using GL_EXT_texture_integer 
...using GL_ARB_texture_rg 
...using GL_EXT_packed_depth_stencil 
...using GL_EXT_texture_filter_anisotropic 
...using GL_ARB_half_float_vertex 
...using GL_ARB_framebuffer_object 
...using GL_ARB_get_program_binary 
...GL_ARB_buffer_storage not found 
...using GL_ARB_uniform_buffer_object 
...using GL_ARB_map_buffer_range 
...using GL_ARB_sync 
Warn: Source for shader program depthtile1:
#version 330 compatibility
#extension GL_ARB_texture_gather : require
#define HAVE_ARB_texture_gather 1
#define HAVE_EXT_texture_integer 1
#define HAVE_EXT_gpu_shader4 1
#define HAVE_ARB_uniform_buffer_object 1
#define varying in
#define textureCube texture
#define texture2D texture
#define texture2DProj textureProj
#define texture3D texture
#ifndef TEXTURE_RG
#define TEXTURE_RG 1
#endif
#ifndef UNIFORM_BUFFER_OBJECT
#define UNIFORM_BUFFER_OBJECT 1
#endif
#ifndef TEXTURE_INTEGER
#define TEXTURE_INTEGER 1
#endif
#ifndef r_AmbientScale
#define r_AmbientScale 1.000000
#endif
#ifndef r_SpecularScale
#define r_SpecularScale 1.000000
#endif
#ifndef r_NormalScale
#define r_NormalScale 1.000000
#endif
#ifndef r_zNear
#define r_zNear 3.000000
#endif
#ifndef M_PI
#define M_PI 3.141593
#endif
#ifndef MAX_SHADOWMAPS
#define MAX_SHADOWMAPS 5
#endif
#ifndef MAX_REF_LIGHTS
#define MAX_REF_LIGHTS 1024
#endif
#ifndef TILE_SIZE
#define TILE_SIZE 16
#endif
#ifndef r_FBufScale
#define r_FBufScale vec2(0.000732, 0.001302)
#endif
#ifndef r_tileStep
#define r_tileStep vec2(0.011713, 0.020833)
#endif
#ifndef r_precomputedLighting
#define r_precomputedLighting 1
#endif
#ifndef r_VertexSkinning
#define r_VertexSkinning 1
#endif
#ifndef MAX_GLSL_BONES
#define MAX_GLSL_BONES 233
#endif
#ifndef r_WrapAroundLighting
#define r_WrapAroundLighting 0.700000
#endif
#ifndef r_HalfLambertLighting
#define r_HalfLambertLighting 1
#endif
#line 0
/*
===========================================================================
Copyright (C) 2006-2011 Robert Beckebans <trebor_7@users.sourceforge.net>

This file is part of XreaL source code.

XreaL source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

XreaL source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with XreaL source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
===========================================================================
*/

/* depthtile1_fp.glsl */

uniform sampler2D u_DepthMap;
varying vec3 unprojectionParams;

uniform vec3 u_zFar;

const vec2 pixelScale = r_FBufScale;

#if __VERSION__ > 120
out vec4 outputColor;
#else
#define outputColor gl_FragColor
#endif

vec4 depthToZ(in vec4 depth) {
  return unprojectionParams.x / ( unprojectionParams.y * depth - unprojectionParams.z );
}

float max16(in vec4 data0, in vec4 data1, in vec4 data2, in vec4 data3) {
  vec4 max01 = max(data0, data1);
  vec4 max23 = max(data2, data3);
  vec4 max4 = max(max01, max23);
  vec2 max2 = max(max4.xy, max4.zw);
  return max(max2.x, max2.y);
}

void	main()
{
  vec2 st = gl_FragCoord.st * 4.0 * pixelScale;
  vec4 depth[4], mask[4];

#ifdef HAVE_ARB_texture_gather
  depth[0] = textureGather( u_DepthMap, st + vec2(-1.0, -1.0) * pixelScale );
  depth[1] = textureGather( u_DepthMap, st + vec2(-1.0,  1.0) * pixelScale );
  depth[2] = textureGather( u_DepthMap, st + vec2( 1.0,  1.0) * pixelScale );
  depth[3] = textureGather( u_DepthMap, st + vec2( 1.0, -1.0) * pixelScale );
#else
  depth[0] = vec4(texture2D( u_DepthMap, st + vec2(-1.5, -1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-1.5, -0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-0.5, -0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-0.5, -1.5) * pixelScale ).x);
  depth[1] = vec4(texture2D( u_DepthMap, st + vec2( 0.5, -1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 0.5, -0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 1.5, -0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 1.5, -1.5) * pixelScale ).x);
  depth[2] = vec4(texture2D( u_DepthMap, st + vec2( 0.5,  0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 0.5,  1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 1.5,  1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2( 1.5,  0.5) * pixelScale ).x);
  depth[3] = vec4(texture2D( u_DepthMap, st + vec2(-1.5,  0.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-1.5,  1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-0.5,  1.5) * pixelScale ).x,
		  texture2D( u_DepthMap, st + vec2(-0.5,  0.5) * pixelScale ).x);
#endif
  mask[0] = 1.0 - step(1.0, depth[0]);
  mask[1] = 1.0 - step(1.0, depth[1]);
  mask[2] = 1.0 - step(1.0, depth[2]);
  mask[3] = 1.0 - step(1.0, depth[3]);

  float samples = dot( mask[0] + mask[1] + mask[2] + mask[3], vec4(1.0) );
  if ( samples > 0.0 ) {
    samples = 1.0 / samples;

    depth[0] = depthToZ(depth[0]);
    depth[1] = depthToZ(depth[1]);
    depth[2] = depthToZ(depth[2]);
    depth[3] = depthToZ(depth[3]);

    float minDepth = - max16( mask[0] * (-depth[0]),
			      mask[1] * (-depth[1]),
			      mask[2] * (-depth[2]),
			      mask[3] * (-depth[3]) );

    depth[0] *= mask[0];
    depth[1] *= mask[1];
    depth[2] *= mask[2];
    depth[3] *= mask[3];

    float maxDepth = max16( depth[0], depth[1], depth[2], depth[3] );

    float avgDepth = dot( depth[0] + depth[1] + depth[2] + depth[3],
			  vec4( samples ) );

    depth[0] -= avgDepth * mask[0];
    depth[1] -= avgDepth * mask[1];
    depth[2] -= avgDepth * mask[2];
    depth[3] -= avgDepth * mask[3];

    float variance = dot( depth[0], depth[0] ) + dot( depth[1], depth[1] ) +
      dot( depth[2], depth[2] ) + dot( depth[3], depth[3] );
    variance *= samples;
    outputColor = vec4( maxDepth, minDepth, avgDepth, sqrt( variance ) );
  } else {
    // found just sky pixels
    outputColor = vec4( 99999.0, 99999.0, 99999.0, 0.0 );
  }
}
 
Warn: Compile log:
(0) : error C7011: implicit cast from "int" to "ivec2"
 
Warn: Built-in shaders failed: Couldn't compile fragment shader: depthtile1 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.50.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.49.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.48.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.47.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.46.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.45.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.44.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.43.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.42.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.41.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.40.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.39.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.38.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.37.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.36.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.35.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.34.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.33.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.32.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.31.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.30.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.29.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.28.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.27.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.26.0.pk3'... 
[FS] Loading pak '/usr/share/games/unvanquished/pkg/unvanquished_0.25.0.pk3'... 

@illwieckz
Copy link
Member

illwieckz commented Jul 10, 2017

@Incognito4nonymous I edited your comment to make it looking better, you can use this syntax to prevent text being interpreted (one three-backquotes line before and one after your text):

```
your **text** with _uninterpreted_ markup
```

which produces:

your **text** with _uninterpreted_ markup

instead of:

your text with uninterpreted markup

Otherwise, since the # is the markup for titles, it's translating all the #define line in titles, and since GitHub interprets #<number> as an issue reference, it uselessly pings all related issues when finding such numbers in raw text. It's useful for raw logs that can wrongly triggers the markup processor.

@Incognito4nonymous
Copy link

Ok thanks, I'll try to remember that stuff when I'll post logs.

@lisacvuk
Copy link
Author

Unfortunately, the PC the bug was occurring on has gone dead a few months ago. No way I can check for it anymore. I'm leaving this open as many other people seem to have reported the same issue.

@Incognito4nonymous
Copy link

Okay, in my opinion the best lead would be to see where the regression is, since the version alpha 42 works on all computers.

@DolceTriade
Copy link
Member

Yeah, bisecting between Alpha 42 and Alpha 50 would help. That would require someone to be able to compile the game on the hardware though...

@illwieckz
Copy link
Member

@Incognito4nonymous do you know with which version it stops to work, alpha 43?

@illwieckz
Copy link
Member

It looks like depthtile1_fp.glsl was added in commit DaemonEngine/Daemon@0bb3550 on the road to alpha 49, it's part of newly tiled renderer. @Incognito4nonymous can you check if alpha 48 works on your system, but not alpha 49?

@illwieckz
Copy link
Member

@Incognito4nonymous can you try building the daemon engine's master branch and running it this way:

./daemon -pakpath /where/you/installed/unvanquished/pkg -set r_arb_texture_gather 0

Just rebuilding the engine would be enough to test that.

@Incognito4nonymous
Copy link

Roger that, I'll test alpha 48 works on my computer and will try to compile the main daemon as soon as I can.

@Incognito4nonymous
Copy link

Incognito4nonymous commented Sep 8, 2017

@illwieckz
Nailed, seemingly the Alpha 48 works like a damn dream. And even the deform vertexes bug is absent when ran from the I5, I still gotta rebuild the engine on linux as I haven't done it yet, I'm having some minors issues with my GPU on Linux and I'll wait for it to be fixed and updated b4 giving results. ;)
EDIT, tried the command with the 0.50.0 release I had stored on my hdd with Windows and the shortcut trick, and
Built -in sharers failed : Couldn't compile fragment shader : ssao
Again I'm waiting for my Slackware to be fixed for more concrete results, but I still hope it helped.

@illwieckz
Copy link
Member

illwieckz commented Nov 19, 2017

I managed to build an hardware setup that reproduces the bug. The bug is still present in for-0.51 branch.

The hardware is an nVidia GeForce 210 and the driver is the nvidia-340 one (earlier drivers do not support this hardware). Note that the hardware is advertised for OpenGL 3.2 on the box, but the driver claims OpenGL 3.3 support (same as nouveau, but nouveau also has a bunch of nasty bugs with this hardware). The current distro used is Ubuntu 17.10.

illwieckz@gelion:~$ dpkg -l | grep nvidia
ii  nvidia-340                                 340.104-0ubuntu2                            amd64        NVIDIA binary driver - version 340.104
ii  nvidia-opencl-icd-340                      340.104-0ubuntu2                            amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                               0.8.5                                       amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                            384.69-0ubuntu1                             amd64        Tool for configuring the NVIDIA graphics driver
illwieckz@gelion:~$ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 210/PCIe/SSE2
OpenGL core profile version string: 3.3.0 NVIDIA 340.104
OpenGL core profile shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.3.0 NVIDIA 340.104
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 NVIDIA 340.104 340.104
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.00
OpenGL ES profile extensions:
illwieckz@gelion:~$ sudo lspci -nn -vvv -s 03:00.0
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT218 [GeForce 210] [10de:0a65] (rev a2) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. GT218 [GeForce 210] [1043:852d]
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 25
	NUMA node: 0
	Region 0: Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
	Region 1: Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Region 3: Memory at de000000 (64-bit, prefetchable) [size=32M]
	Region 5: I/O ports at bc00 [size=128]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: [60] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee0300c  Data: 4172
	Capabilities: [78] Express (v2) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 <64us
			ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <512ns, L1 <4us
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 128 bytes Disabled- CommClk+
			ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [b4] Vendor Specific Information: Len=14 <?>
	Capabilities: [100 v1] Virtual Channel
		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
		Arb:	Fixed- WRR32- WRR64- WRR128-
		Ctrl:	ArbSelect=Fixed
		Status:	InProgress-
		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
			Status:	NegoPending- InProgress-
	Capabilities: [128 v1] Power Budgeting <?>
	Capabilities: [600 v1] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_340

@illwieckz
Copy link
Member

@gimhael, @cmf028 we now have hardware to reproduce the bug. ↑↑↑

@Incognito4nonymous
Copy link

That's a good new, although are you able to reproduce the Deform Vertexes bug ?

@illwieckz
Copy link
Member

Your DeformVertex bug is an Intel one as seen in your log:

GL_RENDERER: Mesa DRI Intel(R) Ironlake Mobile  
Detected graphics driver class 'Mesa' 
Detected graphics hardware class 'generic'

So it's not expected to be reproduceable on NVidia. If you get that DeformVertex bug on a setup having an NVidia GPU, it means you are not using the NVidia GPU for rendering but use the IGP that is integrated in your Intel CPU instead and in the best case just use the NVidia hardware to drive the display (and perhaps you just not use it at all). Can you create another issue for this one?

Also reading this:

0:2(12): error: extension `GL_EXT_texture_integer' unsupported in vertex shader

It looks like your IGP driver is missing some OpenGL extension. On Wikipedia it's noticed this IGP only supports up to OpenGL 2.1.

@Incognito4nonymous can you open an issue for your specific DeformVertex case?

@gimhael
Copy link
Member

gimhael commented Dec 17, 2017

@Incognito4nonymous: The DeformVertexes shader on git master does not use GL_EXT_texture_integer any more, are you using an older release of Unvanquished ?

@illwieckz: Could you test if the shader compiles after disabling the GL_EXT_texture_gather extension (/r_ext_texture_gather 0) ?

@illwieckz
Copy link
Member

@gimhael I'll do (in some days)!

@illwieckz
Copy link
Member

illwieckz commented Dec 23, 2017

@gimhael it's not GL_EXT_texture_gather extension but GL_ARB_texture_gather extension.

So, doing this:

daemon -set r_arb_texture_gather 0

makes the game start and run on this specific hardware.

@Incognito4nonymous
Copy link

@gimhael I'm currently on 0.50.0, I downloaded it in September of 2016.

@illwieckz -set r_arb_texture_gather 0 doesn't seem to launch the game either, tested on Windows with a shortcut, still running into the Depthtitle1 shader issue.

@illwieckz
Copy link
Member

@Incognito4nonymous I'm not sure the trick works on 0.50.0, btw we have to release a new engine version because too much bugs of 0.50.0 are now fixed.

@Incognito4nonymous
Copy link

So... What's your suggestion ? Should I wait for the release or download the latest commit ?

@illwieckz
Copy link
Member

It's probably better for you to build the last master commit, the probability of us not releasing something between Christmas and New Year's eve is very high 😛

@illwieckz
Copy link
Member

See DaemonEngine/Daemon#63 for a pull request that aims to fix the bug (disable the related extension on this broken driver for this hardware).

@illwieckz
Copy link
Member

illwieckz commented Dec 10, 2018

this was fixed long time ago in repository, fix is shipped with latest release: https://www.unvanquished.net/?p=1278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants