Search Issue Tracker

By Design

Votes

7

Found in

5.5.1p2

Issue ID

878185

Regression

No

Surface Shader with shader_features doesn´t compile

Shaders

-

To reproduce:
1. Open attached project;
2. Reimport shader "SurfaceBug".

Expected result: Editor compiles the Surface Shader, it is possible to reimport it.
Actual result: Shader doesn't compile, Editor is not responding when trying to reimport the Shader. If you end task (Unity Shader Compiler) in the Task Manager, Console throws errors:
-Shader compiler: internal error preprocessing shader: Protocol error - failed to read correct magic number;
-Shader error in 'SurfaceBug': Parse error: syntax error, unexpected $end, expecting TOK_SHADER at line 1.

Reproduced on versions: 5.4.4p1, 5.5.1p2, 5.6.0b7.

Comments (9)

  1. Redrag

    Dec 04, 2023 14:24

    I hit this after updating some Microsoft stuff, nothing to do with Unity. The save as UTF-8 saved the day!

  2. shubhamswaraj2021

    Aug 18, 2020 05:29

    good one <a href="https://www.lyricsauto.com">lyricsauto</a>

  3. howong

    Jan 10, 2018 01:21

    VEGABEYOND, thanks I had a similar issue and encountered the 2nd error. Saving as UTF-8 fixed it.

  4. VegaBeyond

    Sep 23, 2017 23:52

    Well I tried to 'save as' the shader to UTF-8 instead of UTF-16 and it works... Just post here if helps anyone

  5. esoinila

    Jul 10, 2017 06:44

    My new game-machine also took it's time parsing this. In the end it finished and produced this same error on 5.6.0f3

  6. yuliyF

    Jun 09, 2017 10:44

    Reproduced on 5.6p1

  7. jasonburbage

    May 13, 2017 01:00

    Thank you Jacob! You saved me hours.

  8. criticalmass

    Feb 25, 2017 14:01

    I'm suffering from the same issue.

  9. JacobK

    Feb 10, 2017 16:20

    Was having a very very similar issue, ended up just leaving unity compiling the shader, and tabbing out for about 10 minutes, it eventually compiled it fine!

    Might be worth giving that a go?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.