Search Unity

Built-In Mobile Blur Crashes On Specific Galaxy S4s

Discussion in 'Shaders' started by eshan-mathur, Aug 15, 2014.

  1. eshan-mathur

    eshan-mathur

    Joined:
    Nov 22, 2011
    Posts:
    118
    Hi there,

    I'm using the built in Mobile Blur shader ("Hidden/FastBlur") and it works great on most Android devices - however there is a crash that only happens on a specific subset of Galaxy S4 devices (the i337 model) and it seems to be caused by this shader.

    Even deeper, the lines that cause it are:

    Code (CSharp):
    1. o.offs[0] = v.texcoord.xyxy + coords * half4(1.0h,1.0h,-1.0h,-1.0h);
    2. coords += netFilterWidth.xyxy;
    3. o.offs[1] = v.texcoord.xyxy + coords * half4(1.0h,1.0h,-1.0h,-1.0h);
    4. coords += netFilterWidth.xyxy;
    5. o.offs[2] = v.texcoord.xyxy + coords * half4(1.0h,1.0h,-1.0h,-1.0h);
    Commenting out the two o.offs[1] and o.offs[2] calls fixes it. Perhaps the GPU doesn't have three texture units? There is a line earlier in the shader:
    Code (CSharp):
    1. half4offs[3] : TEXCOORD1;
    Not really sure what the fix is here, but any advice would be great.
     
    Last edited: Aug 15, 2014
  2. Deepscorn

    Deepscorn

    Joined:
    Aug 13, 2015
    Posts:
    25