GLES3 glLinkProgram never returns

Started by
2 comments, last by Stainless 8 years, 11 months ago

Hey guys,

I have a very weird problem. When I try to use more than one uniform buffer in a shader glLinkProgram will just go into oblivion and never return.

If I define the blocks without an instance name the lock up occurs:


layout (std140) uniform LightBlock {
    vec3 LightColor;
    vec3 DirToLight;
    vec3 AmbientColor;
};

layout (std140) uniform MaterialBlock {
    vec4 Diffuse;
    vec4 Specular;
};

But when I give the blocks instance names, the program runs just fine:


layout (std140) uniform LightBlock {
    vec3 LightColor;
    vec3 DirToLight;
    vec3 AmbientColor;
} Light;

layout (std140) uniform MaterialBlock {
    vec4 Diffuse;
    vec4 Specular;
} Material;

This is not the behaivior described in the specs. Tbh glLinkProgram should never lock up ...

I tested the Code on a Nexus 4 (Adreno 320) and Nexus 5 (Adreno 330). Am I doing something wrong or is this a driver bug from Qualcomm?

Advertisement

So I actually found the problem. It appears that when a uniform from a uniform block is used as an argument for the built-in function pow the linker isn't happy and just never links the shader. I found that when the uniform is assigned to a local variable the linker is happy:

Change


float specular = pow(max(0.0, NdotH), MaterialSpecular.w);

to


float shininess = MaterialSpecular.w;
float specular = pow(max(0.0, NdotH), shininess);

This MUST be a driver bug. Another workaround is to use instance names for the uniform blocks like in my previous post. But this is just annoying.

Qualcomm fix your shit...

This is the type of development hell that keeps me away from Android development. Always test anything you make on Adreno and Mali GPU's.

I would file a bug report with them.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Sadly this is very common.

Not only do you have to test on multiple chipsets, you have to test across devices with the same chipset.

It's not an Android only problem though, IOS has the same issues, just not as bad.

One of the problems is that the manufacturers will grab a shader compiler quite early in development, they need it in to test their own graphics drivers.

Once it's in, they tend to keep it rather than update the compiler as bug fixes are released. After all it could break code they already have running. wacko.png

One shader compiled to 226 instructions on PC. When I compiled it on iPhone, it was 325 instructions. iPad 280. Samsung Galaxy II 211. Samsung Galaxy III 537

Sorry I can only sympathize, I can't give you any practical advice other than TEST,TEST,TEST.

Now I have moved to Ps4 development, I am so glad I don't have to deal with this hell anymore.

This topic is closed to new replies.

Advertisement