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. Dismiss Notice

Unity 5.5 (Blur Optimized) broken for iOS?

Discussion in 'General Graphics' started by reefG, Dec 9, 2016.

  1. reefG

    reefG

    Joined:
    May 27, 2013
    Posts:
    11
    Hello

    I'm running 5.5f1 and I've also tried 5.5p1, but blur optimized fails to compile when building for iOS (in Xcode).

    See below :

    Compilation failed:


    program_source:38:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[0] = TEXCOORD1;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:38:22: error: use of undeclared identifier 'TEXCOORD1'

    phase0_Input1_2[0] = TEXCOORD1;

    ^

    program_source:39:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[1] = TEXCOORD2;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:39:22: error: use of undeclared identifier 'TEXCOORD2'

    phase0_Input1_2[1] = TEXCOORD2;

    ^

    program_source:40:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[2] = TEXCOORD3;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:40:22: error: use of undeclared identifier 'TEXCOORD3'

    phase0_Input1_2[2] = TEXCOORD3;

    ^




    #include <metal_stdlib>

    #include <metal_texture>

    using namespace metal;

    constant float4 ImmCB_0_0_0[7] =

    {

    float4(0.0205000006, 0.0, 0.0, 0.0),

    float4(0.0855000019, 0.0, 0.0, 0.0),

    float4(0.231999993, 0.0, 0.0, 0.0),

    float4(0.324000001, 0.0, 0.0, 1.0),

    float4(0.231999993, 0.0, 0.0, 0.0),

    float4(0.0855000019, 0.0, 0.0, 0.0),

    float4(0.0205000006, 0.0, 0.0, 0.0)

    };

    struct Mtl_FragmentIn

    {

    half2 TEXCOORD0 [[ user(TEXCOORD0) ]] ;

    half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;

    };

    struct Mtl_FragmentOut

    {

    half4 SV_Target0 [[ color(0) ]];

    };

    fragment Mtl_FragmentOut xlatMtlMain(

    texture2d<half, access::sample > _MainTex [[ texture (0) ]] ,

    sampler sampler_MainTex [[ sampler (0) ]] ,

    Mtl_FragmentIn input [[ stage_in ]])

    {

    Mtl_FragmentOut output;

    half4 u_xlat16_0;

    half4 u_xlat16_1;

    int u_xlati2;

    half4 u_xlat16_3;

    half4 u_xlat16_4;

    bool u_xlatb7;

    half4 phase0_Input0_2[3];

    phase0_Input1_2[0] = TEXCOORD1;

    phase0_Input1_2[1] = TEXCOORD2;

    phase0_Input1_2[2] = TEXCOORD3;

    u_xlat16_0 = _MainTex.sample(sampler_MainTex, float2(input.TEXCOORD0.xy));

    u_xlat16_0 = half4(float4(u_xlat16_0) * float4(0.324000001, 0.324000001, 0.324000001, 1.0));

    u_xlat16_1 = u_xlat16_0;

    u_xlati2 = 0x0;

    while(true){

    u_xlatb7 = u_xlati2>=0x3;

    if(u_xlatb7){break;}

    u_xlat16_3 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].xy));

    u_xlat16_4 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].zw));

    u_xlat16_3 = half4(u_xlat16_3 + u_xlat16_4);

    u_xlat16_1 = half4(float4(u_xlat16_3) * ImmCB_0_0_0[u_xlati2].xxxw + float4(u_xlat16_1));

    u_xlati2 = u_xlati2 + 0x1;

    }

    output.SV_Target0 = u_xlat16_1;

    return output;

    }

    Compilation failed:


    program_source:38:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[0] = TEXCOORD1;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:38:22: error: use of undeclared identifier 'TEXCOORD1'

    phase0_Input1_2[0] = TEXCOORD1;

    ^

    program_source:39:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[1] = TEXCOORD2;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:39:22: error: use of undeclared identifier 'TEXCOORD2'

    phase0_Input1_2[1] = TEXCOORD2;

    ^

    program_source:40:1: error: use of undeclared identifier 'phase0_Input1_2'; did you mean 'phase0_Input0_2'?

    phase0_Input1_2[2] = TEXCOORD3;

    ^~~~~~~~~~~~~~~

    phase0_Input0_2

    program_source:37:7: note: 'phase0_Input0_2' declared here

    half4 phase0_Input0_2[3];

    ^

    program_source:40:22: error: use of undeclared identifier 'TEXCOORD3'

    phase0_Input1_2[2] = TEXCOORD3;

    ^




    #include <metal_stdlib>

    #include <metal_texture>

    using namespace metal;

    constant float4 ImmCB_0_0_0[7] =

    {

    float4(0.0205000006, 0.0, 0.0, 0.0),

    float4(0.0855000019, 0.0, 0.0, 0.0),

    float4(0.231999993, 0.0, 0.0, 0.0),

    float4(0.324000001, 0.0, 0.0, 1.0),

    float4(0.231999993, 0.0, 0.0, 0.0),

    float4(0.0855000019, 0.0, 0.0, 0.0),

    float4(0.0205000006, 0.0, 0.0, 0.0)

    };

    struct Mtl_FragmentIn

    {

    half2 TEXCOORD0 [[ user(TEXCOORD0) ]] ;

    half4 TEXCOORD1 [[ user(TEXCOORD1) ]] ;

    };

    struct Mtl_FragmentOut

    {

    half4 SV_Target0 [[ color(0) ]];

    };

    fragment Mtl_FragmentOut xlatMtlMain(

    texture2d<half, access::sample > _MainTex [[ texture (0) ]] ,

    sampler sampler_MainTex [[ sampler (0) ]] ,

    Mtl_FragmentIn input [[ stage_in ]])

    {

    Mtl_FragmentOut output;

    half4 u_xlat16_0;

    half4 u_xlat16_1;

    int u_xlati2;

    half4 u_xlat16_3;

    half4 u_xlat16_4;

    bool u_xlatb7;

    half4 phase0_Input0_2[3];

    phase0_Input1_2[0] = TEXCOORD1;

    phase0_Input1_2[1] = TEXCOORD2;

    phase0_Input1_2[2] = TEXCOORD3;

    u_xlat16_0 = _MainTex.sample(sampler_MainTex, float2(input.TEXCOORD0.xy));

    u_xlat16_0 = half4(float4(u_xlat16_0) * float4(0.324000001, 0.324000001, 0.324000001, 1.0));

    u_xlat16_1 = u_xlat16_0;

    u_xlati2 = 0x0;

    while(true){

    u_xlatb7 = u_xlati2>=0x3;

    if(u_xlatb7){break;}

    u_xlat16_3 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].xy));

    u_xlat16_4 = _MainTex.sample(sampler_MainTex, float2(phase0_Input0_2[u_xlati2].zw));

    u_xlat16_3 = half4(u_xlat16_3 + u_xlat16_4);

    u_xlat16_1 = half4(float4(u_xlat16_3) * ImmCB_0_0_0[u_xlati2].xxxw + float4(u_xlat16_1));

    u_xlati2 = u_xlati2 + 0x1;

    }

    output.SV_Target0 = u_xlat16_1;

    return output;

    }

    WARNING: Shader Unsupported: 'Hidden/FastBlur' - Pass '' has no fragment shader

    WARNING: Shader Unsupported: 'Hidden/FastBlur' - Setting to default shader.

    This was working fine before 5.5 - does anyone else experience this? The error messages are from Xcode and build time.

    Any assistance greatly appreciated.

    Many Thanks
     
  2. henaxing

    henaxing

    Joined:
    Jan 17, 2015
    Posts:
    41
    Mine too. I don't know why, but only iOS fails to compile it, so I can't use blur effect now.. Is this bug of Unity or Xcode??
     
    Last edited: Jan 25, 2017
  3. henaxing

    henaxing

    Joined:
    Jan 17, 2015
    Posts:
    41
    Ok, I tested it with Unity 5.5.0f3, and I got this bug. So, I upgraded Unity to 5.5.1f1 after I checked the release note which describes the fix for translating shader codes for Metal. BUT, this bug still happens.. Any help?
     
  4. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    402
  5. henaxing

    henaxing

    Joined:
    Jan 17, 2015
    Posts:
    41