title: Does any graphics API allow efficient per-primitive branching?
body: <p>When writing fragment shaders in <strong>OpenGL</strong>, one can branch either on compile-time constants, on <em>uniform</em> variables or on <em>varying</em> variables.</p>
  <p>How performant that branching is depends on the hardware and driver implementation, but generally branching on a compile time constant is usually free and branching on a <em>uniform</em> is faster than on a <em>varying</em>.</p>
  <p>In the case of a <em>varying</em>, the rasterizer still has to interpolate the variable for each fragment and the branch has to be decided on each family execution, even if the value of the varying is the same for each fragment in the current primitive.</p>
  <p>What I wonder is whether any graphics api or extension allows some fragment shader branching that is executed only once per rasterized primitive (or in the case of tiled rendering once per primitive per bin)?</p>