godlikepanos / anki-3d-engine

AnKi 3D Engine - Vulkan backend, modern renderer, scripting, physics and more

Home Page:http://www.anki3d.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type or qualifier doesn't match between vertex shader and fragment shader

opened this issue · comments

Hi! I get this error when I'm trying to run testapp:

(../src/core/App.cpp:145 createInternal) Info: Initializing application (version 0.1, build release Mar 10 2015, commit 2b4908c)...
(../src/core/NativeWindowSdl.cpp:34 create) Info: Creating SDL window (OpenGL context to be requested 4.4)...
(../src/core/NativeWindowSdl.cpp:121 create) Info: SDL window created
(../src/gl/GlQueue.cpp:172 prepare) Info: OpenGL async thread started: OpenGL version 4.4.13283 Core Profile Context 14.501.1003, GLSL version 4.40
(../src/renderer/MainRenderer.cpp:35 create) Info: Initializing main renderer...
(../src/gl/GlBuffer.cpp:38 create) Warning: The size (2097152) of the uniform buffer is greater than the spec's min
(../src/gl/GlPipeline.cpp:65 create) Error: Ppline error log follows:
inTexCoords's data type or qualifiers doesn't match between vertex shader and fragment shader

(../src/gl/GlQueue.cpp:256 threadLoop) Error: Error in rendering thread. Aborting

I'm on Ubuntu 14.04 using AMD's Catalyst Omega driver (14.12).

Found a related forum thread: http://devgurus.amd.com/thread/169000

Hi,

Thanks for the report! I think I have an idea of what is wrong. I will push a patch as soon as I am done with some annoying refactoring.

No problem! Take your time

I've committed something that may fix the issue. I say "may" because I don't own an AMD GPU to test. The commit should be the 3bfb471

Now it shows this:

(../src/core/App.cpp:143 createInternal) Info: Initializing application (version 0.1, build release Mar 31 2015, commit 3bfb471)...
(../src/core/NativeWindowSdl.cpp:34 create) Info: Creating SDL window (OpenGL context to be requested 4.4)...
(../src/core/NativeWindowSdl.cpp:121 create) Info: SDL window created
(../src/gr/gl/RenderingThread.cpp:184 prepare) Info: OpenGL async thread started: OpenGL version 4.4.13374 Core Profile Context 15.20.1013, GLSL version 4.40
(../src/renderer/MainRenderer.cpp:35 create) Info: Initializing main renderer...
(../src/gr/gl/BufferImpl.cpp:38 create) Warning: The size (2097152) of the uniform buffer is greater than the spec's min
(../src/gr/gl/PipelineImpl.cpp:66 create) Error: Ppline error log follows:
inTexCoords's data type or qualifiers doesn't match between vertex shader and fragment shader

(../src/gr/gl/RenderingThread.cpp:268 threadLoop) Error: Error in rendering thread. Aborting

Aborted (core dumped)

Hmm. If I am not asking much, is it possible to get a backtrace?

To do that first go to include/anki/gr/gl/RenderingThread.h and change the line:

#define ANKI_GL_DISABLE_ASYNC 0

to

#define ANKI_GL_DISABLE_ASYNC 1

then run though GDB. When the executable aborts type:

backtrace

That will give a backtrace that I can use to locate the faulty shaders.

Thanks

Isn't the application abourted because of the line 66 in PipelineImpl.cpp? It returns the same error which I had when opened this issue except file paths are different now.

I defined ANKI_GL_DISABLE_ASYNC to 1 and now I get different error that says maps/adis/scene.lua doesn't exist (I can't find such file in repo too):

(../src/core/App.cpp:143 createInternal) Info: Initializing application (version 0.1, build release Apr  3 2015, commit 3bfb471)...
(../src/core/NativeWindowSdl.cpp:34 create) Info: Creating SDL window (OpenGL context to be requested 4.4)...
(../src/core/NativeWindowSdl.cpp:121 create) Info: SDL window created
(../src/gr/gl/RenderingThread.cpp:184 prepare) Info: OpenGL async thread started: OpenGL version 4.4.13374 Core Profile Context 15.20.1013, GLSL version 4.40
(../src/gr/gl/RenderingThread.cpp:147 start) Warning: GL queue works in synchronous mode
(../src/renderer/MainRenderer.cpp:35 create) Info: Initializing main renderer...
(../src/gr/gl/BufferImpl.cpp:38 create) Warning: The size (2097152) of the uniform buffer is greater than the spec's min
(../src/gr/gl/PipelineImpl.cpp:66 create) Error: Ppline error log follows:
inTexCoords's data type or qualifiers doesn't match between vertex shader and fragment shader

(../src/gr/gl/RenderingThread.cpp:79 flushCommandBuffer) Error: Error in command buffer execution
(../src/gr/gl/PipelineImpl.cpp:66 create) Error: Ppline error log follows:
inTexCoords's data type or qualifiers doesn't match between vertex shader and fragment shader

(../src/gr/gl/RenderingThread.cpp:79 flushCommandBuffer) Error: Error in command buffer execution
(../src/gr/gl/PipelineImpl.cpp:66 create) Error: Ppline error log follows:
inColor's data type or qualifiers doesn't match between vertex shader and fragment shader

(../src/gr/gl/RenderingThread.cpp:79 flushCommandBuffer) Error: Error in command buffer execution
(../src/renderer/MainRenderer.cpp:52 create) Info: Main renderer initialized. Rendering size 1920x1080
(../src/script/ScriptManager.cpp:30 create) Info: Initializing scripting engine...
(../src/script/ScriptManager.cpp:45 create) Info: Scripting engine initialized
(../src/core/App.cpp:275 createInternal) Info: Application initialized
(../testapp/Main.cpp:51 init) Info: Other init...
(../src/util/File.cpp:148 openCFile) Error: Failed to open file ./maps/adis/scene.lua
(../include/anki/resource/ResourcePointer.inl.h:71 load) Error: Failed to load resource: ./maps/adis/scene.lua
(../testapp/Main.cpp:560 main) Error: Error reported. See previous messages

It returns normally now so gdb can't do a backtrace:

[Thread 0x7ffff7fc9740 (LWP 3392) exited]
[Inferior 1 (process 3392) exited normally]
(gdb) backtrace
No stack.

If I define ANKI_GL_DISABLE_ASYNC back to 0, gdb returns this:

[New Thread 0x7ffff081d700 (LWP 3586)]
[New Thread 0x7fffeabfc700 (LWP 3589)]
[New Thread 0x7fffeb7fe700 (LWP 3588)]
[New Thread 0x7fffebfff700 (LWP 3587)]
[New Thread 0x7ffff101e700 (LWP 3585)]
[New Thread 0x7ffff181f700 (LWP 3584)]
[New Thread 0x7ffff2020700 (LWP 3583)]
[New Thread 0x7ffff2821700 (LWP 3582)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff081d700 (LWP 3586)]
0x00007ffff6f08267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff6f08267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007ffff6f09eca in __GI_abort () at abort.c:89
Backtrace stopped: Cannot access memory at address 0x7ffff081ce38

I think this info is not that useful if we already know that we have an OpenGL error returned in rendering thread? :)

I've made some kind of refactoring. Is it possible to pull and try again? It should abort in the correct place.

Sorry, I've being busy lately... Here you go, with the latest commit:

$ ./testapp
(../src/core/App.cpp:143 createInternal) Info: Initializing application (version 0.1, build release May  3 2015, commit 73ccec3)...
(../src/core/NativeWindowSdl.cpp:33 create) Info: Creating SDL window (OpenGL context to be requested 4.4)...
(../src/core/NativeWindowSdl.cpp:120 create) Info: SDL window created
(../src/gr/gl/RenderingThread.cpp:184 prepare) Info: OpenGL async thread started: OpenGL version 4.4.13374 Core Profile Context 15.20.1013, GLSL version 4.40
(../src/renderer/MainRenderer.cpp:34 create) Info: Initializing main renderer...
(../src/gr/gl/BufferImpl.cpp:38 create) Warning: The size (2097152) of the uniform buffer is greater than the spec's min
(../src/gr/gl/ShaderImpl.cpp:146 handleError) Error: Shader compilation failed (type 91b9):
==============================================================================

Shader Compile Log:
Compute shader failed to compile with the following errors:
ERROR: 0:70: error(#30) Built-in function parameter type check fail: offset must be a constant/literal in texture functions.
ERROR: error(#273) 1 compilation errors.  No code generated


==============================================================================
   1: #version 440 core
   2:  #define IS_RT_MIPMAP 4
   3: #define ANKI_RENDERER_WIDTH 1920
   4: #define ANKI_RENDERER_HEIGHT 1024
   5: // Copyright (C) 2009-2015, Panagiotis Christopoulos Charitos.
   6: // All rights reserved.
   7: // Code licensed under the BSD License.
   8: // http://www.anki3d.org/LICENSE
   9: // Copyright (C) 2009-2015, Panagiotis Christopoulos Charitos.
  10: // All rights reserved.
  11: // Code licensed under the BSD License.
  12: // http://www.anki3d.org/LICENSE
  13: // This file contains common code for all shaders. It's optional but it's 
  14: // recomended to include it
  15: #ifndef ANKI_SHADERS_COMMON_GLSL
  16: #define ANKI_SHADERS_COMMON_GLSL
  17: // Default precision
  18: #ifndef DEFAULT_FLOAT_PRECISION
  19: #define DEFAULT_FLOAT_PRECISION highp
  20: #endif
  21: #ifndef DEFAULT_INT_PRECISION
  22: #define DEFAULT_INT_PRECISION highp
  23: #endif
  24: precision DEFAULT_FLOAT_PRECISION float;
  25: precision DEFAULT_FLOAT_PRECISION int;
  26: #define EPSILON (0.000001)
  27: // Read from a render target texture
  28: //#define textureRt(tex_, texc_) texture(tex_, texc_)
  29: #define textureRt(tex_, texc_) textureLod(tex_, texc_, 0.0)
  30: // Common locations
  31: #define POSITION_LOCATION 0
  32: #define NORMAL_LOCATION 1
  33: #define TANGENT_LOCATION 2
  34: #define TEXTURE_COORDINATE_LOCATION 3
  35: #define TEXTURE_COORDINATE_LOCATION_1 4
  36: #define SCALE_LOCATION 6
  37: #define ALPHA_LOCATION 7
  38: #endif
  39: #if IS_RT_MIPMAP == 0
  40: # error Wrong mipmap
  41: #endif
  42: const uint WORKGROUP_SIZE_X = 16u;
  43: const uint WORKGROUP_SIZE_Y = 16u;
  44: const uint WORKGROUP_SIZE = WORKGROUP_SIZE_X * WORKGROUP_SIZE_Y;
  45: layout(
  46:   local_size_x = WORKGROUP_SIZE_X, 
  47:   local_size_y = WORKGROUP_SIZE_Y, 
  48:   local_size_z = 1) in;
  49: const uint MIPMAP_WIDTH = ANKI_RENDERER_WIDTH / (2u << (IS_RT_MIPMAP - 1u));
  50: const uint MIPMAP_HEIGHT = ANKI_RENDERER_HEIGHT / (2u << (IS_RT_MIPMAP - 1u));
  51: const uint PIXEL_READ_X = MIPMAP_WIDTH / WORKGROUP_SIZE_X;
  52: const uint PIXEL_READ_Y = MIPMAP_HEIGHT / WORKGROUP_SIZE_Y;
  53: layout(binding = 0) uniform sampler2D u_isRt;
  54: layout(std140, binding = 0) buffer _blk
  55: {
  56:   vec4 u_averageLuminancePad3;
  57: };
  58: shared float g_avgLum[WORKGROUP_SIZE];
  59: void main()
  60: {
  61:   // Gather the log-average luminance of a tile
  62:   float avgLum = 0.0;
  63:   uint yStart = gl_LocalInvocationID.y * PIXEL_READ_Y;
  64:   uint xStart = gl_LocalInvocationID.x * PIXEL_READ_X;
  65:   for(uint y = 0; y < PIXEL_READ_Y; ++y)
  66:   {       
  67:       for(uint x = 0; x < PIXEL_READ_X; ++x)
  68:       {
  69:           vec3 color = texelFetchOffset(
  70:               u_isRt, ivec2(xStart, yStart), IS_RT_MIPMAP, ivec2(x, y)).rgb;
  71:           float lum = dot(vec3(0.30, 0.59, 0.11), color);
  72:           const float DELTA = 0.000001;
  73:           avgLum += log(DELTA + lum);
  74:       }
  75:   }
  76:   avgLum *= 1.0 / float(PIXEL_READ_X * PIXEL_READ_Y);
  77:   g_avgLum[gl_LocalInvocationIndex] = avgLum;
  78:   memoryBarrierShared();
  79:   barrier();
  80:   // Gather the results into one
  81:   for(uint s = WORKGROUP_SIZE / 2u; s > 0u; s >>= 1u)
  82:   {
  83:       if(gl_LocalInvocationIndex < s)
  84:       {
  85:           g_avgLum[gl_LocalInvocationIndex] += 
  86:               g_avgLum[gl_LocalInvocationIndex + s];
  87:       }
  88:       memoryBarrierShared();
  89:       barrier();
  90:   }
  91:   // Write the result
  92:   if(gl_LocalInvocationIndex == 0)
  93:   {
  94:       float crntLum = exp(g_avgLum[0] / float(WORKGROUP_SIZE));
  95: #if 1
  96:       float prevLum = u_averageLuminancePad3.x;
  97:       // Lerp between previous and new L value
  98:       const float INTERPOLATION_FACTOR = 0.05;
  99:       u_averageLuminancePad3.x = prevLum * (1.0 - INTERPOLATION_FACTOR) 
 100:           + crntLum * INTERPOLATION_FACTOR;
 101: #else
 102:       u_averageLuminancePad3.x = crntLum;
 103: #endif
 104:   }
 105: }

(../src/gr/gl/RenderingThread.cpp:268 threadLoop) Error: Error in rendering thread. Aborting

Aborted

godlikepanos, i respect you that you don't use Visual Studio.

@Raizel Thank you... I guess. Since this section is for bugs use the contact email in http://anki3d.org/contact/ for non-bug related subjects.

It seems that, currently, all shaders compile without errors with semi-latest AMD drivers for Linux (15.302 ?). There were some bad shaders on my part and some driver issues. Closing the ticket for now.