cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

kingbadger3d
Journeyman III

Opengl Shader Compiler issues with newer than 13.9 drivers on HD 5850

Hi,

Ive tried updating drivers for my card with every new release since 13.9 but i then start getting compiler issues, for example:

[0:0:0::421]Loading "shaders/postprocess.fs.glsl"...
[0:0:0::421]...DONE
[0:0:0::421]Compile status: 0, info log:

Fragment shader failed to compile with the following errors:

ERROR: 0:133: error(#160) Cannot convert from: "2-component vector of vec2" to: "highp float"

ERROR: error(#273) 1 compilation errors.  No code generated

But worked fine in earlier versions of driver. Also going back even further i built code to use from the base of opengl insights Massive Number of Shadow-Casting Lights with Layered Rendering that with older drivers CPU use was %1-2 idle same as standard in windows, then moving to newer drivers in the same app with no change i get a constant 26-28% cpu usage, ive heard people talk about the same issue of unknown reason the cpu gets used with GPU rendering even though it shouldn't at all. Obviously something is not right.

0 Likes
6 Replies
gsellers
Staff

Hi,

Without seeing your shader, it would be hard to tell what's going on. However, from the error message, it sounds like your shader assigns an array of vec2 values to a float. We have been doing quite a bit of work in our shader compiler in order to pass some tests that include negative cases (ensuring that we don't compile illegal shaders).

If you could post the shader, or at least the line generating the error, we can see where the problem is.

As for the increased CPU usage, you are right. CPU usage should not be high if the GPU is the bottleneck. We will investigate.

Thanks,

Graham

0 Likes

Hi Graham,

Cheers for the help Bud;

Shader;

float vignette = vec2(1.0) - length(vec2(0.5) - vTexcoord) / length(vec2(0.5));

If need be i can download some old drivers to try to find which was the last that didnt have the CPU above 25% usage issue. Cheers J

0 Likes

This line looks wrong:

  float vignette = vec2(1.0) - length(vec2(0.5) - vTexcoord) / length(vec2(0.5));

You're assigning a vec2 to a float. Change it to:

  float vignette = 1.0 - length(vec2(0.5) - vTexcoord) / length(vec2(0.5));

Thanks,

Graham

0 Likes

Hi Graham,

Now got another issue i don't understand.

Fragment shader failed to compile with the following errors:

ERROR: 0:30: error(#160) Cannot convert from: "4-component vector of vec4" to: "highp float"

ERROR: error(#273) 1 compilation errors.  No code generated

  float prevLum = texture(uPrevLuminanceTex, vec2(0.5));

I get the feeling the way ive coded things there may well be simular issues through all my shaders. Any chance i can just send you my Full deferred Opengl Renderer to check over. Obviously i dont want to post my work for the general public, so if you have an email i can send to if need be would be good. Cheers

James

0 Likes

Hi James,

You can't implicitly convert a vector to a scalar. In this case, the error is here:

  float prevLum = texture(uPrevLuminanceTex, vec2(0.5));

Change it to:

  float prevLum = texture(uPrevLuminanceTex, vec2(0.5)).r;

This is similar to the issue from the previous shader you posted. In general, the format of the message (ERROR: 0:30: error(#160) Cannot convert from: "4-component vector of vec4" to: "highp float") tells you two things: first, where the error is and second, what happened. The location of the error is first - 0:30 tells you that it's in the first shader string at line 30. Second, it says that you can't convert a 4-component vector to a float (I'm not sure why it says "of vec4", it should say "of float" - I will check on that).

It's likely that we were lenient in the past and allowed this to compile. Recent tightening of our rules may have broken your shaders. You should check on them systematically. If you run into harder issues, I'll arrange to take a look at your application.

Cheers,

Graham

0 Likes

Hi Graham,

Cheers for the help Bud, yeah the 4-component vector of vec4 error was what confused me at that point. Gone through all 30 shaders now and fixed 6-7 other issues that were similar. How come you guys are making the compiler even more strict (far stricter than Nvidia's anyway, being able to mix fx shader code with GL for example). Im guessing it's because Kronos now will only give opengl compliance for drivers that so tightly fit the spec?. Also PS i did a few tests of the opengl insights Massive Number of Shadow-Casting Lights with Layered Rendering code (if you want to test you self the codes on github), in the new drivers not only do you get the above 25% cpu issue but also my FPS drops from 29 FPS with layered rendering enabled to 13.4 FPS compared to even the 13.9 drivers. I can't remember which was the last catalyst that didnt have the 25% cpu usage issue (should be only1-2% CPU) but once AMD drivers page is fixed and show past driver downloads (as at the mo nothing shows on any past driver downloads page) ill track down the last driver that worked which should hopefully allow you guys to track the issue quicker. Cheers again for the help.

James

0 Likes