- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Trying to use the GLSL shader below, gives me an error:
error: definitions of uniform block '_Font' do not match
Vertex Shader:
#version 400
struct ViewportClass
{
float from;
float range;
vec2 center;
vec2 size;
vec2 size_fov_tan;
vec4 FracToPosXY;
vec4 ScreenToPosXY;
vec4 PosToScreen;
};
layout(row_major,std140)uniform _Viewport
{
vec4 Coords;
ViewportClass Viewport;
vec4 RTSize;
};
layout(row_major,std140)uniform _Global
{
layout(row_major)mat4 ProjMatrix;
vec3 CamAngVel;
float TesselationDensity;
vec2 GrassRangeMulAdd;
vec4 ClipPlane;
mediump vec4 BendFactor;
layout(row_major)mat4x3 CamMatrix;
};
layout(row_major,std140)uniform _Font
{
mediump float FontShadow;
mediump float FontContrast;
mediump float FontShade;
float FontDepth;
mediump vec3 FontLum;
};
layout(location=0)in vec4 ATTR0;
layout(location=1)in mediump vec3 ATTR1;
layout(location=2)in mediump vec3 ATTR2;
layout(location=3)in mediump vec4 ATTR3;
layout(location=4)in vec2 ATTR4;
layout(location=5)in vec2 ATTR5;
layout(location=6)in vec2 ATTR6;
layout(location=7)in mediump float ATTR7;
layout(location=8)in vec4 ATTR8;
layout(location=9)in vec4 ATTR9;
layout(location=10)in mediump vec4 ATTR10;
layout(location=11)in mediump vec4 ATTR11;
noperspective out vec2 IO0;
noperspective out float IO1;
vec2 _55;
void main()
{
IO0=vec2(ATTR4.x,ATTR4.y);
IO1=ATTR7;
gl_Position=vec4((ATTR0.xy*Coords.xy)+Coords.zw,((((FontDepth*ProjMatrix[2u].z)+ProjMatrix[3u].z)/FontDepth)*0.5)+0.5,1.0);
}
Pixel Shader:
#version 400
precision mediump float;
precision highp int;
layout(row_major,std140)uniform _Color
{
highp vec4 Color[2];
};
layout(row_major,std140)uniform _Font
{
float FontShadow;
float FontContrast;
float FontShade;
highp float FontDepth;
vec3 FontLum;
};
uniform mediump sampler2D ImgXY;
noperspective in highp vec2 IO0;
noperspective in float IO1;
layout(location=0)out vec4 RT0;
void main()
{
vec4 _18=texture(ImgXY,IO0);
float _22=clamp(_18.x*FontContrast,0.0,1.0);
float _26=1.0-_22;
float _29=mix(1.0-(_26*_26),_22*_22,FontLum.x);
float _30=1.0-(_18.y*FontShadow);
float _31=1.0-(_30*_30);
float _34=(_29+_31)-(_31*_29);
RT0=vec4(Color[0].xyz*((mix(FontShade,1.0,clamp(IO1,0.0,1.0))*_29)/(_34+6.103515625e-05)),Color[0].w*_34);
}
Code works fine on other platforms, Win, Mac, Android, iOS, Web.
The problem is:
in Vertex shader I have:
mediump float FontShadow;
in Pixel shader I have:
precision mediump float;
float FontShadow;
So they are actually the same precision, yet compiler complains they are not compatible.
Tested on Ubuntu 19.04
Intel Core i7-3632QM CPU @ 2.20 GHz
Intel ivybridge Mobile
Mesa DRI Intel Ivybridge Mobile
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello GSlaz,
Thank you for posting on the Intel® communities.
I would like to inform you that Intel® does not provide direct downloads and technical support for Linux drivers. The Intel® Graphics Linux driver is primarily supported through the original equipment manufacturer (OEM), the Linux distribution vendor, or by the Intel Open Source Technology Center at 01.org/linuxgraphics.
We will close this inquiry; but, if you need further assistance, please post a new question.
Esteban Ch.
Intel Customer Support Technician
A Contingent Worker at Intel

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page