Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Shader issues / Crash on Load

Discussion in 'PSM' started by Cryogen, Apr 25, 2014.

  1. Cryogen

    Cryogen

    Joined:
    Sep 5, 2013
    Posts:
    5
    I'm getting some shader compile errors on load followed by a crash (which may be unrelated)

    The easy thing to do is just get rid of shadow support on vita (although I'm not sure what the shader platform define is), although from what I've read in these forums shadows should work.

    I really wish that it would log the actual shader program it tried to compile, because theres no way to know which line of the shader in question produced the shader compilation error.


    [143.954569] Compiling VERTEX shader "RHI/DepthRampSkybox" variation with entrypoint 'vert' (md5:7ef477b3cb087192e6e1effff168c493)
    [144.090177] Shader : RHI/DepthRampSkybox
    [144.090677] Entrypoint : vert
    [144.091061] WARN (57,12):
    unrecognized pragma directive 'multi_compile_fwdbase' will be ignored
    [144.091796] WARN (58,12):
    unrecognized pragma directive 'exclude_renderers' will be ignored
    [144.092533] WARN (59,12):
    unrecognized pragma directive 'vertex' will be ignored
    [144.093251] WARN (60,12):
    unrecognized pragma directive 'fragment' will be ignored
    [144.093963] WARN (83,9):
    local variable 'worldPos' is unreferenced
    [144.094683] WARN (330,13):
    implicit cast from 'float4' to 'float2'
    [144.095380] ERROR (331,35):
    invalid digit 'f' in decimal constant
    [144.096099] --
    [144.098155] Compiling FRAGMENT shader "RHI/DepthRampSkybox" variation with entrypoint 'frag' (md5:784898c8aea497e6f3f1ccd7477e70fb)
    [144.233921] Shader : RHI/DepthRampSkybox
    [144.234414] Entrypoint : frag
    [144.234812] WARN (57,12):
    unrecognized pragma directive 'multi_compile_fwdbase' will be ignored
    [144.235573] WARN (58,12):
    unrecognized pragma directive 'exclude_renderers' will be ignored
    [144.236307] WARN (59,12):
    unrecognized pragma directive 'vertex' will be ignored
    [144.237039] WARN (60,12):
    unrecognized pragma directive 'fragment' will be ignored
    [144.237750] WARN (83,9):
    local variable 'worldPos' is unreferenced
    [144.238451] WARN (330,13):
    implicit cast from 'float4' to 'float2'
    [144.239142] ERROR (331,35):
    invalid digit 'f' in decimal constant
    [144.239836] --
     
  2. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Currently this is a bit of a convoluted process, but in essence:

    1. In the editor, select the shader and click "open compiled shader"
    2. Isolate the section starting with "sce_vp_psm" / "sce_fp_psm" (search for the string, cut all lines before)
    3. Now the line number in the error (ERROR (331,35)) should almost match the source - you will probably have to add/subtract <5 lines.

    I just added some code to output the lines where the error is (+- 3 lines) to the console output - next update should have this fix.
     
  3. Cryogen

    Cryogen

    Joined:
    Sep 5, 2013
    Posts:
    5
    You're my hero, thank you.