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.

Build Failed with Shader Error

Discussion in 'Unity Cloud Build' started by Jacob-Williams, Nov 17, 2016.

  1. Jacob-Williams

    Jacob-Williams

    Joined:
    Jan 30, 2009
    Posts:
    267
    I'm getting the following error when I try to build my project with UCB.

    Code (CSharp):
    1.  Player export failed. Reason: Shader error in 'Standard (Vertex Color)': Program 'fragForwardBase_VC', error X4506: ps_4_0_level_9_1 input limit (8) exceeded, shader uses 9 inputs. (on d3d11_9x)
    I've changed the Player Settings to only use Direct3D11 for Windows builds - how can I force UCB to build for DX11 only?
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    330
  3. Jacob-Williams

    Jacob-Williams

    Joined:
    Jan 30, 2009
    Posts:
    267
    Thanks for getting back to me, Ryan. The work around is to essentially to rewrite portions of the shader, and at this point I'm probably just going to replace it. However, the ultimate issue is that UCB is not respecting the Graphics API player settings. Maybe I'm missing something here?
     
  4. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    330
    If you have the Graphics APIs for Windows section of your Player Settings set up identical to the attached image (highlighted in red), UCB will definitely build for DX11 only as this is controlled entirely by this Player Settings option and not overridden by UCB.
     

    Attached Files:

  5. Jacob-Williams

    Jacob-Williams

    Joined:
    Jan 30, 2009
    Posts:
    267
    My player settings are identical to screenshot you posted. If this is the case, why does UCB try to compile the shader for d3d11_9x? Sorry for my ignorance, but I'm just trying to better understand how the system works - I assumed if Unity built the project locally just fine, UCB would work.
     
  6. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    330
    Usually, if it builds correctly locally, it should build correctly in UCB. If it doesn't, usually those issues tend to be related to platform differences between Windows and Mac. Builds currently in UCB are performed on Mac OSX as USB originally was for iOS builds only.

    As far as d3d11_9x in the logs, my shader knowledge is very rusty, but I would guess that it's using d3d11_9x instead of d3d11 due to some flags in the shader itself such as #pragma target being set to 3.0 instead of 4.0 or 5.0. If you run your build locally, in the editor logs do you see any references to d3d11_9x or are they all d3d11?
     
unityunity