Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Shader errors with ATI version 11.9 drivers

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Shader errors with ATI version 11.9 drivers

Post by Ironfist »

Last night upgraded ATI drivers to 11.9. This morning while checking things out I noticed a whole raft of shader compilation errors in the log.

10:58:05.546 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for griff_boa_prototype_mainhull_b_channel_decals.fragment:
>>>>> GLSL log:
Fragment shader failed to compile with the following errors:
ERROR: 1:132: error(#397) Illegal escape sequence.
ERROR: 1:133: error(#132) Syntax error: '{' parse error
ERROR: error(#273) 2 compilation errors. No code generated

and

10:58:19.484 [shader.load.failed]: ***** ERROR: Could not build shader vortex_general.vertex/vortex_turret.fragment.
10:58:19.484 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for vortex_turret.fragment:
>>>>> GLSL log:
Fragment shader failed to compile with the following errors:
ERROR: 1:8: error(#397) Illegal escape sequence.
ERROR: 1:9: error(#132) Syntax error: '{' parse error
ERROR: error(#273) 2 compilation errors. No code generated

I had not seen anything like this before, I had updated to Trunk R4631 so wondered whether it was that, so reinstalled previous version and the errors were still there - then remembered the installation of the latest drivers so took them out and the errors disappeared, shader support was still there as was latest version of OpenGL

11:11:01.296 [rendering.opengl.version]: OpenGL renderer version: 4.1.11005 ("4.1.11005 Compatibility Profile Context"). Vendor: "ATI Technologies Inc.". Renderer: "ATI Radeon HD 5700 Series".

Game ran fine!

So re-installed version 11.8 of the ATI drivers and still no errors.
Think we need to be careful of the version 11.9 ATI drivers.

Thought I had better report this incase it saved a lot of tearing of hair etc.

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16071
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Shader errors with ATI version 11.9 drivers

Post by Cody »

Oh the woes I've had with ATI/AMD gfx drivers, which is why I've switched to an nVidia gfx card.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Shader errors with ATI version 11.9 drivers

Post by Eric Walch »

Ironfist wrote:
Game ran fine!

So re-installed version 11.8 of the ATI drivers and still no errors.
Think we need to be careful of the version 11.9 ATI drivers.
But, the big question is: Are the new drivers generating the errors, or are they just better in detecting existing errors?

Looking at the griff_boa_prototype_mainhull_b_channel_decals.fragment shader I wonder if this part is correct:

Code: Select all

// Calculate the contribution of a single light. Ought to be a function, but OS X's GLSlang implementation isn't sufficiently clever.
   #define LIGHT(idx) \
        { \
           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \
           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \
           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \
           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \
        }
Or what is the meaning of those escape characters at the end of the lines?

But I am not familiar with shaders so it could also have a special meaning. At least my open GL shader builder does not complain about the code and compiles it succesful.

At least the compiler ends with the line:

Code: Select all

Compile Succesful.
My syntax checker claims that Succesful is an unknown word and suggest to use Successful.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6569
Joined: Wed Feb 28, 2007 7:54 am

Re: Shader errors with ATI version 11.9 drivers

Post by another_commander »

Eric Walch wrote:
Looking at the griff_boa_prototype_mainhull_b_channel_decals.fragment shader I wonder if this part is correct:

Code: Select all

// Calculate the contribution of a single light. Ought to be a function, but OS X's GLSlang implementation isn't sufficiently clever.
   #define LIGHT(idx) \
        { \
           vec3 lightVector   = normalize(gl_LightSource[idx].position.xyz); \
           vec3 reflection   = normalize(-reflect(lightVector, v_normal)); \
           diffuse += gl_FrontMaterial.diffuse * gl_LightSource[idx].diffuse * max(dot(v_normal, lightVector), 0.0); \
           specular += gl_LightSource[idx].diffuse * pow(max(dot(reflection, eyeVector), 0.0), specExponent); \
        }
Or what is the meaning of those escape characters at the end of the lines?
I believe you refer to the backslashes? These just indicate that the preprocessor has to consider whatever comes after them as belonging to the same line of code. This is very common with preprocessor macros, which, instead of being written in one continuous line can be split in smaller, more readable parts. The above code is correct.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16071
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Shader errors with ATI version 11.9 drivers

Post by Cody »

Eric Walch wrote:
My syntax checker claims that Succesful is an unknown word and suggest to use Successful.
The word 'Succesful' is certainly unknown to me!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Shader errors with ATI version 11.9 drivers

Post by Eric Walch »

another_commander wrote:
I believe you refer to the backslashes? These just indicate that the preprocessor has to consider whatever comes after them as belonging to the same line of code. This is very common with preprocessor macros, which, instead of being written in one continuous line can be split in smaller, more readable parts. The above code is correct.
Okay, I understand now that it is correct. But the error was:

Code: Select all

ERROR: 1:132: error(#397) Illegal escape sequence. 
And assuming that 132 means a line error I went to line 132 that reads:

Code: Select all

   #define LIGHT(idx) \
So I now assume that the driver wrongful defines the backslash as a syntax error. It is the only place in the code were griff uses backslashes as line terminating symbol.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Shader errors with ATI version 11.9 drivers

Post by Svengali »

@Ironfist: Does it help if you put

Code: Select all

#version 120
in the first line (before everything else) of that shader?
It would be very interesting if the card can be instructed to use a specific version, forcing it to use the old way...
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Shader errors with ATI version 11.9 drivers

Post by Eric Walch »

In the Open GL Shader Language ducumentation for version 4.20 I found as update from version 4.10:

Code: Select all

•	Add line-continuation using '\', as in C++.
Somehow suggesting that it was never an official character in the open GL language and only recently added.
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Shader errors with ATI version 11.9 drivers

Post by Ironfist »

Apologies for not getting back sooner RL was getting in the way.

Both versions of the ATI OpenGL appear to be 4.1
The one with 11.9 is
10:58:03.234 [rendering.opengl.version]: OpenGL renderer version: 4.1.11079 ("4.1.11079 Compatibility Profile Context"). Vendor: "ATI Technologies Inc.". Renderer: "ATI Radeon HD 5700 Series".
Whilst the one in 11.8 is
11:19:21.921 [rendering.opengl.version]: OpenGL renderer version: 4.1.11005 ("4.1.11005 Compatibility Profile Context"). Vendor: "ATI Technologies Inc.". Renderer: "ATI Radeon HD 5700 Series".

There appears to be just 1 extra extension called GL_EXT_texture_storage as the difference between the 2 versions of OpenGL.

As I posted it is not just Griff's Boa but it happens with the Vortex as well.
I will try and add that line to the Vortex code - there are less files to edit, I like the 1 change at a time scheme of things and will let you all know how it goes.

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Shader errors with ATI version 11.9 drivers

Post by Thargoid »

The shaders in the Vortex are simplified examples based on some of Griff's. So it's no surprise if there is a generic error replicated from them. Once things are ironed out I'll update things.
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Shader errors with ATI version 11.9 drivers

Post by Ironfist »

Well, I put the "#version 120" as the first line in the file and got

22:34:43.812 [shader.load.failed]: ***** ERROR: Could not build shader vortex_general.vertex/vortex_turret.fragment.
22:34:43.968 [vortex_player.js]: Vortex Player Script Initialised
22:34:44.531 [ferdelance3-cloaking-script]: Initialising main ferdelance3 script
22:34:45.234 [ferdelance3-cloaking-script]: Initialising main ferdelance3 script
22:34:45.250 [shader.compile.failure]: ***** ERROR: GLSL vertex shader compilation failed for vortex_general.vertex:
>>>>> GLSL log:
Vertex shader failed to compile with the following errors:
ERROR: 1:1: error(#105) #version must occur before any other statement in the program
ERROR: error(#273) 1 compilation errors. No code generated
under the old version of the ATI driver

Checked by taking it out again and this error disappeared

I will re-install the new drivers and try both sets of files again and then report back

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Shader errors with ATI version 11.9 drivers

Post by Ironfist »

Right under ATI version 11.9 drivers

If the #version 120 is the first line in the file I get :-
[shader.load.failed]: ***** ERROR: Could not build shader vortex_general.vertex/vortex_turret.fragment.
[vortex_player.js]: Vortex Player Script Initialised
[shader.compile.failure]: ***** ERROR: GLSL vertex shader compilation failed for vortex_general.vertex:
>>>>> GLSL log:
Vertex shader failed to compile with the following errors:
ERROR: 1:1: error(#105) #version must occur before any other statement in the program
ERROR: error(#273) 1 compilation errors. No code generated

Whereas if I take that line out I get :-
[shader.load.fullModeFailed]: ----- WARNING: Could not build shader vortex_general.vertex/vortex_turret.fragment in full complexity mode, trying simple mode.
[shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for vortex_turret.fragment:
>>>>> GLSL log:
Fragment shader failed to compile with the following errors:
ERROR: 1:8: error(#397) Illegal escape sequence.
ERROR: 1:9: error(#132) Syntax error: '{' parse error
ERROR: error(#273) 2 compilation errors. No code generated

So going back to ATI driver 11.8 since that seems to generate the least errors, did a google search and similar errors seem to be reported under differing circumstances in a number of games.

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2479
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Shader errors with ATI version 11.9 drivers

Post by Griff »

I know it's not a proper fix for this problem, but I'll try and move the prototype boa oxp over to Ahruman's newer shaders examples over the next few days - they don't use this macro that seems to be causing the problems with the new ATI drivers
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Shader errors with ATI version 11.9 drivers

Post by Ironfist »

Griff,

I am not sure it is worth the effort yet. ATI usually update their drivers on a monthly schedule and this is the first time there has been a problem. I think it might be better until may be 11.10 or 11.11 come out and we get a more consistent view of whether this is going to be a long term problem. I posted the original message more to make sure that people did not update without the knowledge that it might break things. I will report the effects of ATI drivers as they change.

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16071
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Shader errors with ATI version 11.9 drivers

Post by Cody »

I get an odd sense of déjà vu in this thread... you could try the 11.10 beta drivers.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Post Reply