All my shaders with CG/HLSL break in 3.5.3

I just upgraded to 3.5.3 and all my shaders containing CG/HLSL now break. In the inspector, they just give the following errors:

Shader compilation produced no results (compiler crashed?)
Parse error: syntax error at line 9

Line 9 (or whatever line it says for other shaders) is the “CGPROGRAM” directive that starts a block of CG/HLSL code. They’re all now hot pink in the game. What gives?

Previously when investigating it, I was clicking “Open compiled shader” and trying to save that, but I guess it doesn’t actually apply and recompile it in that case.

When I instead double-clicked on the shader to paste the code for ScroodgeM, and just removed the comments and saved it (changing no code), it then accepted it.

What perhaps was the problem is that they changed some symbol tables or the graphics engine’s execution of pre-compiled shaders for 3.5.3, but the update process didn’t recompile them.

Anyway, it seems to work now, so thanks for the request, ScroodgeM.

Its hard to tell what causes this, just having ran into it myself it seems like it can be a number of things.

However i’ve found out that you can get the compiler to tell you the errors if your on windows at least by using the following line in the .shader file inside the CGPROGRAM

#pragma only_renderers d3d9

for me at least, this got the errors to show up on the shader error list. You may be able to try a different renderer as for me it seems like its some compiler for a different renderer that causes the errors to just come up as ‘compiler crashed’ ect. was able to fix my errors then removed that line and everything compiled fine.

Unity - Manual: HLSL in Unity ← check out Rendering platforms section