> Loic, do you think that having a different fragment shader depending on
> texture and aspect instead of the three if statements in shape.frag could
> increase the performance even more? Or just two different shaders for the
> different aspects.
Having different shaders (as we had before) would imply an exponential number of shaders and would make maintenance a nightmare. GPUs have a feature called static flow control which means that when we branch on a fixed uniform variable, the driver can create a dedicated shader with the unused branch shaved off the code. This is also called über-shader and is used a lot in games.
> Loic, do you think that having a different fragment shader depending on
> texture and aspect instead of the three if statements in shape.frag could
> increase the performance even more? Or just two different shaders for the
> different aspects.
Having different shaders (as we had before) would imply an exponential number of shaders and would make maintenance a nightmare. GPUs have a feature called static flow control which means that when we branch on a fixed uniform variable, the driver can create a dedicated shader with the unused branch shaved off the code. This is also called über-shader and is used a lot in games.