title: SKShader performance slowdown
body: <p>I need to implement a custom shader node using SpriteKit. 
  In simulator everything is ok. On a device (iPad 3rd gen) shader animation is smooth just for first ~30 seconds, after that shader's fps are gradually falling down until it looks like a slideshow (1 fps or even less)</p>
  
  <p>It is worth noting, that SpriteKit shows 60 fps, so does Xcode. 
  CPU is ~75% busy, but shader itself shows ~1fps.</p>
  
  <p>I own only 3rd generation iPad and I currently don't have an opportunity to test it on other devices
  Shader code is taken from wwdc session, but the issue is reproduced with any animated shaders I've tried.</p>
  
  <p>Shader itself:</p>
  
  <pre><code>void main(void)
  {
      float currTime = u_time;
  
      vec2 uv = v_tex_coord;
      vec2 circleCenter = vec2(0.5, 0.5);
      vec3 circleColor = vec3(0.8, 0.5, 0.7);
      vec3 posColor = vec3(uv, 0.5+0.5 * sin(currTime)) * circleColor;
  
      float illu = pow(1. - distance(uv, circleCenter), 4.) * 1.2;
      illu *= (2. + abs(0.4 + cos(currTime * -20. + 50. * distance(uv, circleCenter))/1.5));
      gl_FragColor = vec4(posColor * illu * 2.0, illu * 2.0);
  }
  </code></pre>
  
  <p>GameScene:</p>
  
  <pre><code>import SpriteKit
  class GameScene: SKScene {
      override func didMoveToView(view: SKView) {
          addChild(shaderSprite(view.center))
      }
  
      func shaderSprite(position: CGPoint) -&gt; SKSpriteNode {
          let sprite = SKSpriteNode(texture: SKTexture(imageNamed: "dummy"), color: nil, size: CGSizeMake(100, 100))
          sprite.shader = SKShader(fileNamed: "wwdc")
          sprite.position = position
          return sprite
      }
  }
  </code></pre>
  
  <p>Result in simulator or first ~30 seconds on iPad3:</p>
  
  <p><img src="https://i.stack.imgur.com/aUJM4.gif" alt="enter image description here"></p>
  
  <p>Result on iPad3 after ~2 minutes:</p>
  
  <p><img src="https://i.stack.imgur.com/A1cnv.gif" alt="enter image description here"></p>
  
  <p>Please point my mistake or just build the project on any other device to check if it's a device-specific issue. Thanks in advance.</p>
  
  <p>Test project: <a href="https://github.com/alexburtnik/SKShaderTest" rel="nofollow noreferrer">https://github.com/alexburtnik/SKShaderTest</a></p>