Code review comment for lp://staging/~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-resolution-independance

Revision history for this message
Loïc Molinari (loic.molinari) wrote :

> 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.

« Back to merge proposal