title: Throw runtime error in GLSL when assertion fails for debugging
body: <p>In the function <code>distSigned</code> I am assuming that <code>l.p != vec2(0)</code>. If this isn't the case, it could break the entire shader with a hard to find bug. Is there is any way of verifying this, and throwing a runtime-error if the parameters are invalid? This would make debugging a lot easier. I know GLSL doesn't have a <code>throw</code> like Java, but maybe theres some kind of hack?</p>
  
  <pre><code>struct parallel {
      vec2 p;
      vec2 d;
  };
  
  struct pt {vec2 v;};
  
  float distSigned(pt p, parallel l) {
      vec2 l2o = fromOrigo(l);
      float d = length(l2o);
      return dot(p.v, l2o/d) - d;
  }
  </code></pre>
  
  <p>Edit: I had a look at the GLSL specification and found this:</p>
  
  <p>"Compile-time errors must be returned for lexically or
  grammatically incorrect shaders. Other errors are reported at compile time or link time as
  indicated."</p>
  
  <p>I guess this means GLSL doesn't have runtime errors? If so, maybe its possible for me to implement exceptions on my own? Is there some kind of design pattern for this?</p>