Bug 99477 - [Master of Orion] Shader compile error: no matching function for call to `texture2DLod(sampler2D, vec2, float)';
Summary: [Master of Orion] Shader compile error: no matching function for call to `tex...
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-20 21:41 UTC by Andreas Schultes
Modified: 2017-01-22 00:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
render_error (44.75 KB, image/png)
2017-01-21 20:28 UTC, Andreas Schultes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schultes 2017-01-20 21:41:18 UTC
Shader compile error: no matching function for call to `texture2DLod(sampler2D, vec2, float)';

It's implemented in builtin_functions.cpp! GLSL Version is 1.30 

Got from apitrace:

//Vertex
uniform vec4 vfuniforms[144];
attribute vec4 pos;
attribute float vbatch;
varying vec4 fucxadd;
varying vec4 fucxmul;
varying vec2 tc0;
void main() {
gl_Position = vec4(0.0,0,0.0,1);
gl_Position.x = dot(pos, vfuniforms[int(vbatch * 6.0 + 2.0+ 0.1 + 0.0)]);
gl_Position.y = dot(pos, vfuniforms[int(vbatch * 6.0 + 2.0+ 0.1 + 1.0)]);
tc0.x = dot(pos, vfuniforms[int(vbatch * 6.0 + 4.0+ 0.1 + 0.0)]);
tc0.y = dot(pos, vfuniforms[int(vbatch * 6.0 + 4.0+ 0.1 + 1.0)]);
fucxadd = vfuniforms[int(vbatch * 6.0 + 0.0+ 0.1)];
fucxmul = vfuniforms[int(vbatch * 6.0 + 1.0+ 0.1)];
}


//Fragment
uniform vec4 fsize;
uniform sampler2D tex;
uniform vec4 texscale;
varying vec4 fucxadd;
varying vec4 fucxmul;
varying vec2 tc0;
void main() {
gl_FragColor       = vec4(0.0, 0.0, 0.0, 0.0);
vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
float  i = 0.0;
for (i = -fsize.x; i <= fsize.x; i++)
{{
color += texture2DLod(tex, tc0 + i * texscale.xy, 0.0);
}} // EndBox1/2.
gl_FragColor = color * fsize.w;
gl_FragColor = (gl_FragColor * vec4(fucxmul.rgb,1.0)) * fucxmul.a;
gl_FragColor += fucxadd * gl_FragColor.a;
gl_FragColor = gl_FragColor;
}

0:13(10): error: no matching function for call to `texture2DLod(sampler2D, vec2, float)'; candidates are:
0:13(1): error: operands to arithmetic operators must be numeric
0:13(1): error: could not implicitly convert error to vec4
Comment 1 Ilia Mirkin 2017-01-20 21:56:48 UTC
Are you sure that the GLSL version is 1.30? i.e. do those shaders have a #version 130 at the top? If not, they get GLSL version 1.10, which does not have those functions.

You can force it globally with force_glsl_version=130 in case you're working around buggy shaders.
Comment 2 Kenneth Graunke 2017-01-20 22:33:05 UTC
GLSL 1.30 does not include texture2DLod().  The function is called textureLod() in #version 130.
Comment 3 Kenneth Graunke 2017-01-20 22:33:49 UTC
Sorry, nevermind that - it exists in 1.30, it's just deprecated.  Should work though.
Comment 4 Andreas Schultes 2017-01-20 23:09:16 UTC
Thanks, I did a new run with apitrace and the shader compile error didn't appear. This could be a missing #version 130. But still rendering errors in the game. I'll do further investigations. I think this bug could be closed. On the first apitrace with the error there was a GL state of a GLSL version, which says it is 130. I'll check that tomorrow.
Comment 5 Andreas Schultes 2017-01-21 15:59:25 UTC
Inserting "#version 130" fix this bug. 
https://www.opengl.org/registry/doc/GLSLangSpec.Full.1.30.10.pdf on page 12. tells that a #version is required to use version 130.
Comment 6 Ilia Mirkin 2017-01-21 17:22:34 UTC
(In reply to Andreas Schultes from comment #5)
> Inserting "#version 130" fix this bug. 
> https://www.opengl.org/registry/doc/GLSLangSpec.Full.1.30.10.pdf on page 12.
> tells that a #version is required to use version 130.

FWIW it should be available in vertex shaders starting with GLSL 1.10 (no #version) required. But to use in fragment shaders, you either need #version 130 or #extension ARB_shader_texture_lod: require.
Comment 7 Kenneth Graunke 2017-01-21 19:29:41 UTC
Does the shader failing to compile make any noticable rendering difference?  I couldn't tell a difference...
Comment 8 Andreas Schultes 2017-01-21 20:28:52 UTC
Created attachment 129089 [details]
render_error

I attached a screenshot of the render error, but I can't say if it belongs to this shader. I have problems to get running a apitrace with steam. Without steam the game stops before the main menu.
Comment 9 Andreas Schultes 2017-01-21 20:31:17 UTC
The rendering error caused also BUG 99419.
Comment 10 Andreas Schultes 2017-01-22 00:09:37 UTC
I got an apitrace now. The rendering error isn't related to this shader. Also it seems not to be a render error.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.